- Timestamp:
- 2003-05-27T15:57:37+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/combobox/GComboBox.java
r4293 r4366 55 55 */ 56 56 public class GComboBox 57 57 extends JComboBox { 58 58 59 59 private JTextField text; 60 60 61 62 63 64 61 public GComboBox() { 62 super(); 63 text = (JTextField) this.getEditor().getEditorComponent(); 64 } 65 65 66 67 68 69 66 public GComboBox(ComboBoxModel model) { 67 super(model); 68 text = (JTextField) this.getEditor().getEditorComponent(); 69 } 70 70 71 72 73 71 public void addDocumentListener(DocumentListener listener) { 72 if(text != null) text.getDocument().addDocumentListener(listener); 73 } 74 74 75 76 77 75 public void addKeyListener(KeyListener listener) { 76 if(text != null) text.addKeyListener(listener); 77 } 78 78 79 80 81 82 83 84 85 79 public String getText() { 80 if(text != null) { 81 return text.getText(); 82 } 83 GComboBoxModel model = (GComboBoxModel)this.getModel(); 84 return (String)model.getSelectedItem(); 85 } 86 86 87 88 89 87 public void setText(String value) { 88 if(text != null) text.setText(value); 89 } 90 90 91 92 93 91 public void removeDocumentListener(DocumentListener listener) { 92 if(text != null) text.getDocument().removeDocumentListener(listener); 93 } 94 94 95 96 97 95 public void removeKeyListener(KeyListener listener) { 96 if(text != null) text.removeKeyListener(listener); 97 } 98 98 }
Note:
See TracChangeset
for help on using the changeset viewer.