Changeset 12708
- Timestamp:
- 2006-09-08T09:41:27+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/FormatManager.java
r12641 r12708 240 240 { 241 241 ArrayList variable_model = new ArrayList(); 242 variable_model.add( "");242 variable_model.add(Dictionary.get("CDM.FormatManager.Insert_Variable")); 243 243 variable_model.add("[Text]"); 244 244 ArrayList every_metadata_set_element = MetadataSetManager.getEveryMetadataSetElement(); … … 344 344 345 345 JPanel variable_pane = new JPanel(); 346 JLabel variable_label = new JLabel(Dictionary.get("CDM.FormatManager.Variable")); 347 346 348 347 variable_combobox = new JComboBox(variable_model.toArray()); 349 348 variable_combobox.setToolTipText(Dictionary.get("CDM.FormatManager.Variable_Tooltip")); … … 427 426 variable_pane.setBorder(BorderFactory.createEmptyBorder(2,0,2,0)); 428 427 variable_pane.setLayout(new GridLayout(1,3)); 429 variable_pane.add( variable_label);428 variable_pane.add(new JPanel()); 430 429 variable_pane.add(variable_combobox); 431 430 variable_pane.add(rupanel); … … 483 482 feature_combobox.setSelectedItem(selected_feature); 484 483 485 // Update the variable model, trying to maintain the same selected object 486 Object selected_variable = variable_combobox.getSelectedItem(); 484 // Update the variable model, 487 485 variable_model = buildVariableModel(); 488 486 variable_combobox.setModel(new DefaultComboBoxModel(variable_model.toArray())); 489 variable_combobox.setSelectedItem(selected_variable); 490 } 487 } 491 488 } 492 489 … … 835 832 implements ActionListener { 836 833 public void actionPerformed(ActionEvent event) { 834 int selected_index = variable_combobox.getSelectedIndex(); 835 if (selected_index == 0) return; 837 836 String selected_value = (String)variable_combobox.getSelectedItem(); 838 839 if (!selected_value.equals("")){ 840 editor_textarea.insert(selected_value, editor_textarea.getCaretPosition()); 841 undo_button.setEnabled(true); 842 843 } 844 } 845 837 editor_textarea.insert(selected_value, editor_textarea.getCaretPosition()); 838 undo_button.setEnabled(true); 839 variable_combobox.setSelectedIndex(0); 840 } 841 846 842 } 847 843
Note:
See TracChangeset
for help on using the changeset viewer.