Changeset 5221
- Timestamp:
- 2003-08-19T17:29:04+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/SearchTypeManager.java
r5088 r5221 41 41 import org.greenstone.gatherer.cdm.SearchType; 42 42 import org.greenstone.gatherer.cdm.DOMProxyListModel; 43 import org.greenstone.gatherer.gui.DoubleImageButton; 43 44 import org.greenstone.gatherer.gui.GComboBox; 44 45 import org.greenstone.gatherer.msm.MSMUtils; … … 111 112 112 113 private JLabel current_search_types_label; 113 private JLabel move_down_label;114 private JLabel move_up_label;115 114 private JLabel search_type_label; 116 115 private JLabel title_label; … … 145 144 146 145 JPanel movement_panel = new JPanel(); 147 move_up_button = new JButton(); 148 move_up_label = new JLabel("CDM.Move.Move_Up"); 149 move_up_label.setHorizontalAlignment(JLabel.CENTER); 150 move_up_label.setPreferredSize(LABEL_SIZE); 151 move_up_button.setLayout(new BorderLayout()); 152 ImageIcon move_up_icon = Utility.getImage("arrow-up.gif"); 153 move_up_button.add(new JLabel(move_up_icon), BorderLayout.WEST); 154 move_up_button.add(move_up_label, BorderLayout.CENTER); 155 move_up_button.add(new JLabel(move_up_icon), BorderLayout.EAST); 146 147 move_up_button = new DoubleImageButton("CDM.Move.Move_Up", Utility.getImage("arrow-up.gif"), Utility.getImage("arrow-up-disabled.gif")); 148 move_up_button.setEnabled(false); 156 149 move_up_button.setMnemonic(KeyEvent.VK_U); 157 move_down_button = new JButton(); 158 move_down_label = new JLabel("CDM.Move.Move_Down"); 159 move_down_label.setHorizontalAlignment(JLabel.CENTER); 160 move_down_label.setPreferredSize(LABEL_SIZE); 161 move_down_button.setLayout(new BorderLayout()); 162 ImageIcon move_down_icon = Utility.getImage("arrow-down.gif"); 163 move_down_button.add(new JLabel(move_down_icon), BorderLayout.WEST); 164 move_down_button.add(move_down_label, BorderLayout.CENTER); 165 move_down_button.add(new JLabel(move_down_icon), BorderLayout.EAST); 150 move_up_button.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE); 151 152 move_down_button = new DoubleImageButton("CDM.Move.Move_Down", Utility.getImage("arrow-down.gif"), Utility.getImage("arrow-down-disabled.gif")); 153 move_down_button.setEnabled(false); 166 154 move_down_button.setMnemonic(KeyEvent.VK_D); 155 move_down_button.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE); 167 156 168 157 JPanel search_type_panel = new JPanel(); … … 193 182 Gatherer.dictionary.register(enable_advanced_searches_checkbox, null, false); 194 183 Gatherer.dictionary.register(instructions_textarea, null, false); 195 Gatherer.dictionary.register(move_ down_label, null, false);196 Gatherer.dictionary.register(move_ up_label, null, false);184 Gatherer.dictionary.register(move_up_button, null, false); 185 Gatherer.dictionary.register(move_down_button, null, false); 197 186 Gatherer.dictionary.register(remove_button, null, false); 198 187 Gatherer.dictionary.register(search_type_label, null, false); … … 249 238 Gatherer.dictionary.deregister(enable_advanced_searches_checkbox); 250 239 Gatherer.dictionary.deregister(instructions_textarea); 251 Gatherer.dictionary.deregister(move_ down_label);252 Gatherer.dictionary.deregister(move_ up_label);240 Gatherer.dictionary.deregister(move_up_button); 241 Gatherer.dictionary.deregister(move_down_button); 253 242 Gatherer.dictionary.deregister(remove_button); 254 243 Gatherer.dictionary.deregister(search_type_label); … … 305 294 public void valueChanged(ListSelectionEvent event) { 306 295 if(!event.getValueIsAdjusting()) { 307 remove_button.setEnabled(current_search_types_list.getModel().getSize() > 1 && !current_search_types_list.isSelectionEmpty()); 296 if (current_search_types_list.isSelectionEmpty()) { 297 move_up_button.setEnabled(false); 298 move_down_button.setEnabled(false); 299 } 300 else { 301 move_up_button.setEnabled(true); 302 move_down_button.setEnabled(true); 303 remove_button.setEnabled(current_search_types_list.getModel().getSize() > 1); 304 } 308 305 } 309 306 }
Note:
See TracChangeset
for help on using the changeset viewer.