Changeset 9196
- Timestamp:
- 2005-02-25T15:33:11+13:00 (19 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/ExportCollectionPrompt.java
r9150 r9196 405 405 */ 406 406 private class CollectionListListener 407 implements ListSelectionListener { 407 implements ListSelectionListener 408 { 408 409 /** Any implementation of ListSelectionListener must include this method so we can be informed when the list selection changes. 409 410 * @param event a <strong>ListSelectionEvent</strong> containing all the relevant information garnered from the event itself 410 411 */ 411 public void valueChanged(ListSelectionEvent event) { 412 ok_button.setEnabled(false); 413 if(!list.isSelectionEmpty()) { 414 collection = (BasicCollectionConfiguration) ((CheckListEntry)list.getSelectedValue()).getObject(); 415 args = new String[3]; 416 args[0] = collection.getCreator(); 417 args[1] = collection.getMaintainer(); 418 args[2] = collection.getDescription(); 419 Dictionary.setText(details_textarea, "DeleteCollectionPrompt.Details", args); 420 details_textarea.setCaretPosition(0); 421 ok_button.setEnabled(true); 412 public void valueChanged(ListSelectionEvent event) 413 { 414 // Can only export when something is ticked 415 ok_button.setEnabled(!list.isNothingTicked()); 416 417 if (list.isSelectionEmpty()) { 418 // This only happens when the dialog is first entered 419 Dictionary.setText(details_textarea, "DeleteCollectionPrompt.No_Collection"); 420 return; 422 421 } 423 else { 424 Dictionary.setText(details_textarea, "DeleteCollectionPrompt.No_Collection"); 425 ok_button.setEnabled(false); 426 } 427 } 428 } 429 430 /** The OK button listener implementation. */ 422 423 collection = (BasicCollectionConfiguration) ((CheckListEntry) list.getSelectedValue()).getObject(); 424 args = new String[3]; 425 args[0] = collection.getCreator(); 426 args[1] = collection.getMaintainer(); 427 args[2] = collection.getDescription(); 428 Dictionary.setText(details_textarea, "DeleteCollectionPrompt.Details", args); 429 details_textarea.setCaretPosition(0); 430 } 431 } 432 433 434 /** The OK button listener implementation. */ 431 435 private class OKButtonListener 432 436 implements ActionListener { … … 510 514 } 511 515 } 512 513 514 516 } 515 516 517 518 -
trunk/gli/src/org/greenstone/gatherer/util/CheckList.java
r9185 r9196 113 113 } 114 114 return result; 115 } 116 117 118 /** This is different from isSelectionEmpty! */ 119 public boolean isNothingTicked() 120 { 121 DefaultListModel model = (DefaultListModel) getModel(); 122 for (int i = 0; i < model.size(); i++) { 123 if (((CheckListEntry) model.get(i)).isSelected()) { 124 return false; 125 } 126 } 127 128 return true; 115 129 } 116 130
Note:
See TracChangeset
for help on using the changeset viewer.