Changeset 6395
- Timestamp:
- 2004-01-09T15:18:06+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/CollectionPane.java
r6318 r6395 44 44 import javax.swing.event.*; 45 45 import javax.swing.tree.*; 46 import org.greenstone.gatherer.Configuration; 46 47 import org.greenstone.gatherer.Dictionary; 47 48 import org.greenstone.gatherer.Gatherer; … … 82 83 /** The collection model which is used to build, and hold the data of, the collection tree. */ 83 84 private TreeModel collection = null; 84 /** The GTree model used as the data source for the workspace tree. */85 /** The Tree model used as the data source for the workspace tree. */ 85 86 private TreeModel workspace = null; 86 87 /** The button used to cancel all pending file queue jobs. */ … … 241 242 collection_tree.setEnabled(ready); 242 243 collection_filter.setEnabled(ready); 244 collection_filter.setEditable(Gatherer.config.getMode() > Configuration.LIBRARIAN_MODE); 243 245 Dictionary.registerTooltip(collection_filter.getComboBox(), "Collection.Filter_Tooltip"); 244 246 … … 294 296 workspace_filter = Gatherer.g_man.getFilter(workspace_tree); 295 297 workspace_filter.setBackground(Gatherer.config.getColor("coloring.workspace_heading_background", false)); 296 // Change the default colours of this filters combobox. 297 GComboBox fcb = workspace_filter.getComboBox(); 298 fcb.setBackgroundNonSelectionColor(Gatherer.config.getColor("coloring.editable_background", false)); 299 fcb.setTextNonSelectionColor(Gatherer.config.getColor("coloring.workspace_tree_foreground", false)); 300 fcb.setBackgroundSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false)); 301 fcb.setTextSelectionColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false)); 302 Dictionary.registerTooltip(fcb, "Collection.Filter_Tooltip"); 303 fcb = null; 298 workspace_filter.setEditable(Gatherer.config.getMode() > Configuration.LIBRARIAN_MODE); 299 Dictionary.registerTooltip(workspace_filter.getComboBox(), "Collection.Filter_Tooltip"); 304 300 305 301 // Collection Tree … … 348 344 collection_filter.setBackground(Color.lightGray); 349 345 } 350 // Change the default colours of this filters combobox. 351 fcb = collection_filter.getComboBox(); 352 fcb.setBackgroundNonSelectionColor(Gatherer.config.getColor("coloring.editable_background", false)); 353 fcb.setTextNonSelectionColor(Gatherer.config.getColor("coloring.collection_tree_foreground", false)); 354 fcb.setBackgroundSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false)); 355 fcb.setTextSelectionColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false)); 356 fcb = null; 346 // Add a tool tip 347 Dictionary.registerTooltip(collection_filter.getComboBox(), "Collection.Filter_Tooltip"); 357 348 358 349 tree_pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); … … 462 453 } 463 454 464 465 * @see org.greenstone.gatherer.tree.GTree466 467 455 /** Called to inform this control panel that it has just gained focus as an effect of the user clicking on its tab. 456 * @see org.greenstone.gatherer.gui.tree.DragTree 457 */ 458 public void gainFocus() { 468 459 // Update the menubar's idea of whats been selected 469 460 if (collection_tree != null) { 470 461 if (collection_tree.isSelectionEmpty()) { 471 462 Gatherer.g_man.menu_bar.setMetaAuditSuffix(null); 472 473 463 } 464 else { 474 465 Gatherer.g_man.menu_bar.setMetaAuditSuffix(collection_tree.getSelectionDetails()); 475 466 } 476 467 } 477 468 // Update the meta-audit view to show the current selection, if any. 478 469 Gatherer.g_man.meta_audit.setRecords(getSelected()); 479 480 481 482 470 } 471 472 /** Retrieve a list of the currently selected file records in the active tree. */ 473 public FileNode[] getSelected() { 483 474 TreePath paths[] = collection_tree.getSelectionPaths(); 484 475 FileNode records[] = null; 485 476 if(paths != null) { 486 487 477 records = new FileNode[paths.length]; 478 for(int i = 0; i < records.length; i++) { 488 479 records[i] = (FileNode) paths[i].getLastPathComponent(); 489 480 } 490 481 } 491 482 return records; 492 493 494 483 } 484 485 public String getSelectionDetails() { 495 486 return collection_tree.getSelectionDetails(); 496 } 497 498 499 public void refreshCollectionTree(int refresh_reason) 500 { 487 } 488 489 /** Called whenever the detail mode changes to ensure the filters are at an appropriate level (ie only editable by those that understand regular expression matching) 490 * @param mode the mode level as an int 491 */ 492 public void modeChanged(int mode) { 493 collection_filter.setEditable(mode > Configuration.LIBRARIAN_MODE); 494 workspace_filter.setEditable(mode > Configuration.LIBRARIAN_MODE); 495 } 496 497 public void refreshCollectionTree(int refresh_reason) { 501 498 collection_tree.refresh(null); 502 } 503 504 505 public void refreshWorkspaceTree(int refresh_reason) 506 { 499 } 500 501 502 public void refreshWorkspaceTree(int refresh_reason) { 507 503 workspace_tree.refresh(refresh_reason); 508 509 510 504 } 505 506 511 507 /** Used to set the enabled state, and hence the colouring, of the two tree labels. 512 508 * @param label The <strong>JLabel</strong> to be affected.
Note:
See TracChangeset
for help on using the changeset viewer.