Changeset 8386
- Timestamp:
- 2004-10-20T13:40:02+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/MetadataSetView.java
r8313 r8386 124 124 extends JPanel 125 125 implements Control { 126 /** Opens the MEM and systematically performs as if the add set button were clicked.*/126 /** Adds a new set to the collection*/ 127 127 private JButton add_button; 128 /** Opens the MEM and systematically performs as if the remove set button were clicked. */ 128 /** Will eventually launch GEMS for editing the selected set, for now just gives a message */ 129 private JButton edit_button; 130 /** REmoves a set from the collection */ 129 131 private JButton remove_button; 130 132 /** The label denoting the element list. */ … … 201 203 add_button.setMnemonic(KeyEvent.VK_A); 202 204 Dictionary.registerBoth(add_button, "CDM.MetadataSetManager.Add", "CDM.MetadataSetManager.Add_Tooltip"); 205 edit_button = new GLIButton(); 206 edit_button.setEnabled(false); 207 edit_button.setMnemonic(KeyEvent.VK_E); 208 Dictionary.registerBoth(edit_button, "CDM.MetadataSetManager.Edit", "CDM.MetadataSetManager.Edit_Tooltip"); 209 203 210 remove_button = new GLIButton(); 204 211 remove_button.setEnabled(false); … … 209 216 // Add listeners 210 217 add_button.addActionListener(new AddButtonListener()); 218 edit_button.addActionListener(new EditButtonListener()); 211 219 remove_button.addActionListener(new RemoveButtonListener()); 212 220 set_list.addListSelectionListener(list_listener); … … 233 241 button_pane.setLayout(new GridLayout(1,3,0,0)); 234 242 button_pane.add(add_button); 243 button_pane.add(edit_button); 235 244 button_pane.add(remove_button); 236 245 … … 258 267 list_listener.valueChanged(new ListSelectionEvent(set_list, 0, 0, true)); 259 268 } 269 if (!set_list.isSelectionEmpty()) { 270 edit_button.setEnabled(true); 271 remove_button.setEnabled(true); 272 } else { 273 edit_button.setEnabled(false); 274 remove_button.setEnabled(false); 275 } 276 260 277 } 261 278 … … 289 306 290 307 308 /** Listens for clicks on the edit button. */ 309 private class EditButtonListener 310 implements ActionListener { 311 312 /** Called when the edit button is clicked. 313 * @param event an ActionEvent containing information about the mouse click 314 */ 315 public void actionPerformed(ActionEvent event) 316 { 317 // do a pop up message 318 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.MetadataSetManager.Edit_Message"), Dictionary.get("CDM.MetadataSetManager.Edit_Message_Title"), JOptionPane.INFORMATION_MESSAGE); 319 320 } 321 } 322 323 291 324 private class MetadataSetListCellRenderer 292 325 implements ListCellRenderer … … 323 356 element_list.setListData(new Vector(metadata_set.getMetadataSetElements())); 324 357 remove_button.setEnabled(true); 358 edit_button.setEnabled(true); 325 359 326 360 // Finally check the directionality and scroll as necessary … … 335 369 else { 336 370 remove_button.setEnabled(false); 371 edit_button.setEnabled(false); 337 372 } 338 373 }
Note:
See TracChangeset
for help on using the changeset viewer.