source: trunk/gli/src/org/greenstone/gatherer/gui/EnrichPane.java@ 10547

Last change on this file since 10547 was 10547, checked in by mdewsnip, 19 years ago

Now uploads all the modified metadata.xml files when the EnrichPane loses focus, rather than after each edit.

  • Property svn:keywords set to Author Date Id Revision
File size: 23.9 KB
Line 
1/**
2 *############################################################################
3 * A component of the Greenstone Librarian Interface, part of the Greenstone
4 * digital library suite from the New Zealand Digital Library Project at the
5 * University of Waikato, New Zealand.
6 *
7 * Author: Michael Dewsnip, NZDL Project, University of Waikato, NZ
8 * Based on code by John Thompson
9 *
10 * Copyright (C) 2005 New Zealand Digital Library Project
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 *############################################################################
26 */
27
28package org.greenstone.gatherer.gui;
29
30
31import java.awt.*;
32import java.awt.event.*;
33import java.io.*;
34import java.util.*;
35import javax.swing.*;
36import javax.swing.event.*;
37import javax.swing.text.*;
38import javax.swing.tree.*;
39import org.greenstone.gatherer.Configuration;
40import org.greenstone.gatherer.DebugStream;
41import org.greenstone.gatherer.Dictionary;
42import org.greenstone.gatherer.Gatherer;
43import org.greenstone.gatherer.collection.CollectionTree;
44import org.greenstone.gatherer.collection.CollectionTreeNode;
45import org.greenstone.gatherer.gui.tree.DragTree;
46import org.greenstone.gatherer.metadata.MetadataElement;
47import org.greenstone.gatherer.metadata.MetadataValue;
48import org.greenstone.gatherer.metadata.MetadataValueTableEntry;
49import org.greenstone.gatherer.metadata.MetadataValueTreeNode;
50import org.greenstone.gatherer.metadata.MetadataXMLFileManager;
51import org.greenstone.gatherer.util.DragGroup;
52import org.greenstone.gatherer.util.TreeSynchronizer;
53
54
55/** Provides a view of controls for the editing of metadata.
56 */
57public class EnrichPane
58 extends JPanel
59 implements TreeSelectionListener
60{
61 static private Dimension MINIMUM_SIZE = new Dimension(100, 100);
62 static private Dimension COLLECTION_TREE_SIZE = new Dimension(250, 500);
63
64 /** The collection tree. */
65 private CollectionTree collection_tree = null;
66 /** The currently reported selection. */
67 private CollectionTreeNode[] file_nodes = null;
68 /** Used to dynamically filter the collection tree. Synchronized with the same filter in the Gather view. */
69 private Filter collection_filter = null;
70 /** The label at the top of the collection tree, which shows the collection name. */
71 private JLabel collection_label;
72 /** The splitpane dividing the collection tree and the metadata editing controls. */
73 private JSplitPane external_split;
74 /** The metadata value table shows the metadata values that are currently assigned to a file. */
75 private MetadataValueTablePane metadata_value_table_pane = null;
76 /** The metadata value tree shows the metadata values that are currently assigned to a metadata element. */
77 private MetadataValueTreePane metadata_value_tree_pane = null;
78 /** Provide synchronization between the collection trees in this view and the collection pane view. */
79 private TreeSynchronizer collection_tree_sync = null;
80
81
82 /** Constructor.
83 * @param tree_sync The <strong>TreeSynchronizer</strong> to be used on the collection tree
84 */
85 public EnrichPane(TreeSynchronizer collection_tree_sync)
86 {
87 this.collection_tree_sync = collection_tree_sync;
88
89 // Create the metadata value tree pane
90 metadata_value_tree_pane = new MetadataValueTreePane();
91 metadata_value_tree_pane.addMetadataValueTreeSelectionListener(new MetadataValueTreeSelectionListener());
92
93 // Create metadata value table pane
94 metadata_value_table_pane = new MetadataValueTablePane();
95 metadata_value_table_pane.addMetadataValueTableListSelectionListener(new MetadataValueTableListSelectionListener());
96 metadata_value_table_pane.addMetadataValueTableMouseListener(new MetadataValueTableMouseListener());
97 metadata_value_table_pane.addMetadataValueTextFieldDocumentListener(new MetadataValueTextFieldDocumentListener());
98 metadata_value_table_pane.addMetadataValueTextFieldKeyListener(new MetadataValueTextFieldKeyListener());
99 }
100
101
102 /** Some actions can only occur after this panel has been displayed on-screen, so this method is provided to do exactly that. Such actions include the proportioning of the split panes and the setting of table column widths.
103 */
104 public void afterDisplay()
105 {
106 external_split.setDividerLocation(0.3);
107 }
108
109
110 /** Used to create, connect and layout the components to be shown on this control panel.
111 * @see org.greenstone.gatherer.Gatherer
112 * @see org.greenstone.gatherer.file.FileOpenActionListener
113 * @see org.greenstone.gatherer.gui.Filter
114 */
115 public void display()
116 {
117 // Creation
118 JPanel collection_pane = new JPanel(new BorderLayout());
119 collection_pane.setMinimumSize(MINIMUM_SIZE);
120 collection_pane.setPreferredSize(COLLECTION_TREE_SIZE);
121
122 external_split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
123
124 collection_label = new JLabel();
125 Dictionary.registerText(collection_label, "Collection.No_Collection");
126 collection_label.setOpaque(true);
127
128 DragGroup group = new DragGroup();
129 collection_tree = new CollectionTree("Enrich", Gatherer.c_man.getCollectionTreeModel(), false);
130 group.add(collection_tree);
131 collection_tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
132 collection_tree.putClientProperty("JTree.lineStyle", "Angled");
133 collection_tree.addMouseListener(Gatherer.g_man.foa_listener);
134 collection_tree.addMouseListener(new RightButtonListener());
135 collection_tree.addTreeSelectionListener(this);
136 collection_tree.addTreeExpansionListener(Gatherer.g_man.foa_listener);
137 collection_tree.setBackgroundNonSelectionColor(Configuration.getColor("coloring.collection_tree_background", false));
138 collection_tree.setTextNonSelectionColor(Configuration.getColor("coloring.collection_tree_foreground", false));
139 collection_tree.setBackgroundSelectionColor(Configuration.getColor("coloring.collection_selection_background", false));
140 collection_tree.setTextSelectionColor(Configuration.getColor("coloring.collection_selection_foreground", false));
141 collection_tree.setRootVisible(false);
142
143 KeyListenerImpl key_listener = new KeyListenerImpl();
144 collection_tree.addKeyListener(key_listener);
145 JScrollPane collection_scroll = new JScrollPane(collection_tree);
146
147 collection_filter = Gatherer.g_man.getFilter(collection_tree);
148 collection_filter.setBackground(Configuration.getColor("coloring.collection_heading_background", false));
149 collection_filter.setEditable(Configuration.getMode() > Configuration.LIBRARIAN_MODE);
150 Dictionary.registerTooltip(collection_filter.getComboBox(), "Collection.Filter_Tooltip");
151
152 // Layout
153 collection_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(3,3,3,3), BorderFactory.createLoweredBevelBorder()));
154 collection_pane.setMinimumSize(MINIMUM_SIZE);
155 collection_pane.setPreferredSize(new Dimension(Gatherer.g_man.getSize().width / 3, Gatherer.g_man.getSize().height));
156
157 // Collection Pane
158 collection_pane.add(collection_label, BorderLayout.NORTH);
159 collection_pane.add(collection_scroll, BorderLayout.CENTER);
160 collection_pane.add(collection_filter, BorderLayout.SOUTH);
161
162 JSplitPane metadata_editing_pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
163 metadata_editing_pane.setBorder(BorderFactory.createEmptyBorder(0,5,5,5));
164 metadata_editing_pane.setDividerSize(8);
165
166 metadata_editing_pane.add(metadata_value_table_pane, JSplitPane.TOP);
167 metadata_editing_pane.add(metadata_value_tree_pane, JSplitPane.BOTTOM);
168 metadata_editing_pane.setDividerLocation(250);
169
170 external_split.add(collection_pane, JSplitPane.LEFT);
171 external_split.add(metadata_editing_pane, JSplitPane.RIGHT);
172
173 this.setLayout(new BorderLayout());
174 this.add(external_split, BorderLayout.CENTER);
175 }
176
177
178 /** Called to inform this pane that it has just gained focus as an effect of the user clicking on its tab
179 */
180 public void gainFocus()
181 {
182 // If there is nothing in the collection tree there is nothing to do
183 if (collection_tree == null || collection_tree.getRowCount() == 0) {
184 return;
185 }
186
187 // Select the first node in the tree if nothing is already selected
188 if (collection_tree.getSelectionPaths() == null) {
189 collection_tree.setImmediate(true);
190 collection_tree.setSelectionRow(0);
191 collection_tree.setImmediate(false);
192 return;
193 }
194
195 // Force all of the controls to be updated
196 valueChanged(null);
197 }
198
199
200 /** Called to inform this pane that it has just lost focus as an effect of the user clicking on another tab
201 */
202 public void loseFocus()
203 {
204 // Upload the modified metadata.xml files to the server now, if we're using one
205 MetadataXMLFileManager.uploadModifiedMetadataXMLFiles();
206 }
207
208
209 /** 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)
210 * @param mode the mode level as an int
211 */
212 public void modeChanged(int mode)
213 {
214 collection_filter.setEditable(mode > Configuration.LIBRARIAN_MODE);
215 }
216
217
218 /** Refresh this pane, depending on what has just happened (refresh_reason). */
219 public void refresh(int refresh_reason, boolean collection_loaded)
220 {
221 if (collection_loaded) {
222 // Update collection label
223 Dictionary.registerText(collection_label, "Collection.Collection");
224 collection_label.setBackground(Configuration.getColor("coloring.collection_heading_background", false));
225 collection_label.setForeground(Configuration.getColor("coloring.collection_heading_foreground", false));
226
227 // Update collection tree
228 if (refresh_reason == Gatherer.COLLECTION_OPENED) {
229 collection_tree.setModel(Gatherer.c_man.getCollectionTreeModel());
230 }
231
232 // Update collection filter
233 collection_filter.setBackground(Configuration.getColor("coloring.collection_heading_background", false));
234 }
235 else {
236 // Update collection label
237 Dictionary.registerText(collection_label, "Collection.No_Collection");
238 collection_label.setBackground(Color.lightGray);
239 collection_label.setForeground(Color.black);
240
241 // Update collection tree
242 collection_tree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode("Error")));
243
244 // Update collection filter
245 collection_filter.setBackground(Color.lightGray);
246 }
247
248 // Enable or disable the controls
249 collection_tree.setEnabled(collection_loaded);
250 collection_filter.setEnabled(collection_loaded);
251
252 // Ensure that this collection tree view is synchronized with all others
253 collection_tree_sync.add(collection_tree);
254
255 // Force the metadata table to be rebuilt (for switching extracted metadata on or off)
256 if (refresh_reason == Gatherer.PREFERENCES_CHANGED) {
257 metadata_value_table_pane.stopEditingAndRebuild(file_nodes);
258 }
259 }
260
261
262 /** Called whenever the collection tree selection changes. This causes the metadata value table to be rebuilt. */
263 public void valueChanged(TreeSelectionEvent event)
264 {
265 // Nothing selected in the collection tree
266 if (collection_tree.getSelectionCount() == 0) {
267 file_nodes = null;
268 }
269
270 // Some files selected in the collection tree
271 else {
272 TreePath paths[] = collection_tree.getSelectionPaths();
273 file_nodes = new CollectionTreeNode[paths.length];
274 for (int i = 0; i < paths.length; i++) {
275 file_nodes[i] = (CollectionTreeNode) paths[i].getLastPathComponent();
276 }
277 }
278
279 // Update the metadata value table (and consequently, the metadata value tree)
280 metadata_value_table_pane.stopEditingAndRebuild(file_nodes);
281 }
282
283
284 private class MetadataValueTableListSelectionListener
285 implements ListSelectionListener
286 {
287 public void valueChanged(ListSelectionEvent list_selection_event)
288 {
289 // We only want to handle one event per selection, so wait for the value to stabilise
290 if (list_selection_event.getValueIsAdjusting()) {
291 return;
292 }
293
294 // Update the metadata value tree for the current table selection
295 metadata_value_tree_pane.rebuild(metadata_value_table_pane.getSelectedMetadataValueTableEntry());
296 }
297 }
298
299
300 private class MetadataValueTableMouseListener
301 extends MouseAdapter
302 {
303 public void mouseClicked(MouseEvent mouse_event)
304 {
305 // We're only interested in clicks on the inherited column
306 if (metadata_value_table_pane.isMouseEventForInheritedMetadataValueTableColumn(mouse_event) == false) {
307 return;
308 }
309
310 // If the selected metadata is inherited, switch to the folder it came from
311 MetadataValueTableEntry selected_metadata_value_table_entry = metadata_value_table_pane.getSelectedMetadataValueTableEntry();
312 if (selected_metadata_value_table_entry.isInheritedMetadata()) {
313 collection_tree.setSelection(selected_metadata_value_table_entry.getFolderMetadataInheritedFrom());
314 }
315 }
316 }
317
318
319 private class MetadataValueTextFieldDocumentListener
320 implements DocumentListener
321 {
322 /** Gives notification that an attribute or set of attributes changed */
323 public void changedUpdate(DocumentEvent document_event) {
324 validate(document_event);
325 }
326
327 /** Gives notification that there was an insert into the document */
328 public void insertUpdate(DocumentEvent document_event) {
329 validate(document_event);
330 }
331
332 /** Gives notification that a portion of the document has been removed */
333 public void removeUpdate(DocumentEvent document_event) {
334 validate(document_event);
335 }
336
337
338 /** Ensures that the value tree is updated in response to changes in the value text field */
339 private void validate(DocumentEvent document_event)
340 {
341 try {
342 Document document = document_event.getDocument();
343 String metadata_value_string = document.getText(0, document.getLength());
344 metadata_value_tree_pane.selectBestPathForMetadataValue(metadata_value_string);
345 }
346 catch (Exception exception) {
347 DebugStream.printStackTrace(exception);
348 }
349 }
350 }
351
352
353 private class MetadataValueTextFieldKeyListener
354 extends KeyAdapter
355 {
356 /** Gives notification of key events on the text field */
357 public void keyPressed(KeyEvent key_event)
358 {
359 // Tab: Auto-complete what is selected in the metadata value tree
360 if (key_event.getKeyCode() == KeyEvent.VK_TAB) {
361 MetadataValueTreeNode selected_metadata_value_tree_node = metadata_value_tree_pane.getSelectedMetadataValueTreeNode();
362 if (selected_metadata_value_tree_node != null) {
363 metadata_value_table_pane.setMetadataValueTextFieldValue(selected_metadata_value_tree_node.getFullValue());
364 }
365
366 // We do not want this event to be processed by the table also
367 key_event.consume();
368 }
369
370 // Enter: save the current value then add a blank row for the selected metadata element
371 if (key_event.getKeyCode() == KeyEvent.VK_ENTER) {
372 metadata_value_table_pane.stopEditingAndAddBlankRowForSelectedMetadataElement();
373 }
374 }
375 }
376
377
378 private class MetadataValueTreeSelectionListener
379 implements TreeSelectionListener
380 {
381 public void valueChanged(TreeSelectionEvent tree_selection_event)
382 {
383 // When a node is selected in the tree, fill the metadata value text field with the selected node's value
384 MetadataValueTreeNode selected_metadata_value_tree_node = metadata_value_tree_pane.getSelectedMetadataValueTreeNode();
385 if (selected_metadata_value_tree_node != null) {
386 metadata_value_table_pane.setMetadataValueTextFieldValue(selected_metadata_value_tree_node.getFullValue());
387 }
388 }
389 }
390
391
392 /** This class listens for certain key presses, such as [Up] or [Down], -copied from Gather Pane */
393 private class KeyListenerImpl
394 extends KeyAdapter {
395 private boolean vk_left_pressed = false;
396 /** Called whenever a key that was pressed is released, it is this action that will cause the desired effects (this allows for the key event itself to be processed prior to this listener dealing with it). */
397 public void keyReleased(KeyEvent event) {
398 ///ystem.err.println("Key Release detected. " + event.getKeyCode());
399 if (event.getKeyCode() == KeyEvent.VK_UP || event.getKeyCode() == KeyEvent.VK_DOWN) {
400 DragTree tree = (DragTree)event.getSource();
401 // we need to manually do the up and down selections
402 boolean up = (event.getKeyCode() == KeyEvent.VK_UP);
403 int current_row = tree.getLeadSelectionRow();
404 tree.setImmediate(true);
405 if (up) {
406 if (current_row > 0) {
407 tree.clearSelection();
408 tree.setSelectionRow(current_row-1);
409 }
410 } else {
411 if (current_row < tree.getRowCount()-1){
412 tree.clearSelection();
413 tree.setSelectionRow(current_row+1);
414 }
415 }
416 tree.setImmediate(false);
417 }
418 else if (event.getKeyCode() == KeyEvent.VK_LEFT) {
419 // left key on a file shifts the selection to the parent folder
420 DragTree tree = (DragTree)event.getSource();
421 TreePath path = tree.getLeadSelectionPath();
422 if(path != null) {
423 File file = ((CollectionTreeNode) path.getLastPathComponent()).getFile();
424 if(file != null) {
425 if (file.isFile() || vk_left_pressed) {
426 vk_left_pressed = false;
427 TreePath parent_path = path.getParentPath();
428 if (parent_path != null && parent_path.getParentPath() != null) {
429 // if this file is in the top level folder, don't move the focus
430 tree.setImmediate(true);
431 tree.clearSelection();
432 tree.setSelectionPath(parent_path);
433 tree.setImmediate(false);
434 }
435 }
436 }
437 }
438 }
439 }
440
441 // we need to watch for left clicks on an unopened folder - should shift the focus to teh parent folder. But because there is some other mysterious key listener that does opening and closing folders on right and left clicks, we must detect the situation before the other handler has done its job, and process it after.
442 public void keyPressed(KeyEvent event) {
443 if (event.getKeyCode() == KeyEvent.VK_LEFT) {
444 // left key on closed directory shifts the selection to the parent folder
445 DragTree tree = (DragTree)event.getSource();
446 TreePath path = tree.getLeadSelectionPath();
447 if(path == null) return;
448 File file = ((CollectionTreeNode) path.getLastPathComponent()).getFile();
449 if(file == null) return;
450
451 if (file.isDirectory() && tree.isCollapsed(path)) {
452 vk_left_pressed = true;
453 }
454 }
455 }
456 }
457
458
459 /** A listener for right mouse button clicks over the collection tree. */
460 private class RightButtonListener
461 extends MouseAdapter {
462 /** Called whenever a mouse click occurs (right or left) over a target component.
463 * @param event A <strong>MouseEvent</strong> containing further information about the mouse click action.
464 * @see org.greenstone.gatherer.gui.EnrichPane.RightButtonMenu
465 */
466 public void mouseClicked(MouseEvent event) {
467 if (SwingUtilities.isRightMouseButton(event)) {
468 new RightButtonMenu(event);
469 }
470 }
471 }
472
473
474 /** When a user right-clicks within the collection tree they are presented with a small popup menu of context based options. This class provides such functionality.
475 */
476 private class RightButtonMenu
477 extends JPopupMenu
478 implements ActionListener {
479
480 /** The tree over which the right click action occurred. */
481 private DragTree tree = null;
482 /** The tree nodes selected when the right click action occurred. */
483 private TreePath[] selection_paths = null;
484 /** The file record over which the right click action occurred. */
485 private CollectionTreeNode node = null;
486
487 private JMenuItem collapse_folder = null;
488 private JMenuItem expand_folder = null;
489 private JMenuItem metaaudit = null;
490 private JMenuItem open_externally = null;
491
492
493 private RightButtonMenu(MouseEvent event)
494 {
495 super();
496 this.tree = collection_tree;
497
498 // Note we have to use setImmediate() with the set selction paths
499 // otherwise the selection doesn't get updated until after the
500 // popup comes up.
501
502 // the right click position
503 TreePath right_click_path = tree.getPathForLocation(event.getX(), event.getY());
504 if (right_click_path == null) {
505 // user has clicked outside of the tree, clear the selection
506 selection_paths = null;
507 tree.setImmediate(true);
508 tree.clearSelection();
509 tree.setImmediate(false);
510 } else {
511 // Get the paths currently selected in the tree
512 selection_paths = tree.getSelectionPaths();
513 if (selection_paths == null) {
514 // nothing currently selected - we shift the selection to
515 // the node that was right clicked on
516 selection_paths = new TreePath[1];
517 selection_paths[0] = right_click_path;
518 tree.setImmediate(true);
519 tree.setSelectionPath(right_click_path);
520 tree.setImmediate(false);
521 } else if (selection_paths.length == 1 && ! selection_paths[0].equals( right_click_path)) {
522 tree.setImmediate(true);
523 tree.clearSelection();
524 tree.setSelectionPath(right_click_path);
525 tree.setImmediate(false);
526 selection_paths[0] = right_click_path;
527 } else {
528 // we had multiply selected paths in the tree.
529 // if we clicked on one of those paths, then use all the
530 // current selection, otherwise clear the selection and
531 // select the one we right clicked on
532 boolean clicked_in_selection = false;
533 for (int i=0; i<selection_paths.length; i++) {
534 if (selection_paths[i].equals(right_click_path)) {
535 clicked_in_selection = true;
536 break;
537 }
538 }
539 if (!clicked_in_selection) {
540 // want the tree to update right away
541 tree.setImmediate(true);
542 tree.clearSelection();
543 tree.setSelectionPath(right_click_path);
544 tree.setImmediate(false);
545 selection_paths = new TreePath[1];
546 selection_paths[0] = right_click_path;
547 }
548 }
549 }
550 // finally we have the correct selection paths!
551
552 // Create an appropriate context menu, based on what is selected
553 buildContextMenu(selection_paths);
554
555 // Show the popup menu on screen
556 show(tree, event.getX(), event.getY());
557 }
558
559
560 private void buildContextMenu(TreePath[] selection_paths)
561 {
562 // If nothing is selected, no options are available
563 if (selection_paths == null) {
564 return;
565 }
566
567 DebugStream.println("Number of files/folders selected: " + selection_paths.length);
568
569 // Always have meta-audit option
570 metaaudit = new JMenuItem(Dictionary.get("Menu.Metadata_View", collection_tree.getSelectionDetails()), KeyEvent.VK_A);
571 metaaudit.addActionListener(this);
572 add(metaaudit);
573
574 // Only meta-audit is available if multiple items are selected...
575 if (selection_paths.length > 1) {
576 return;
577 }
578
579 TreePath path = selection_paths[0];
580 node = (CollectionTreeNode) path.getLastPathComponent();
581
582 // ---- Options for file nodes ----
583 if (node.isLeaf()) {
584 // Open the file in an external program
585 open_externally = new JMenuItem(Dictionary.get("Menu.Open_Externally"), KeyEvent.VK_O);
586 open_externally.addActionListener(this);
587 add(open_externally);
588 return;
589 }
590
591 // ---- Options for folder nodes ----
592 // Collapse or expand, depending on current status
593 if (tree.isExpanded(path)) {
594 collapse_folder = new JMenuItem(Dictionary.get("Menu.Collapse"), KeyEvent.VK_C);
595 collapse_folder.addActionListener(this);
596 add(collapse_folder);
597 }
598 else {
599 expand_folder = new JMenuItem(Dictionary.get("Menu.Expand"), KeyEvent.VK_O);
600 expand_folder.addActionListener(this);
601 add(expand_folder);
602 }
603 }
604
605
606 /** Called whenever one of the menu items is clicked, this method then causes the appropriate effect. */
607 public void actionPerformed(ActionEvent event)
608 {
609 Object source = event.getSource();
610
611 // Collapse folder
612 if (source == collapse_folder) {
613 tree.collapsePath(selection_paths[0]);
614 }
615
616 // Expand folder
617 else if (source == expand_folder) {
618 tree.expandPath(selection_paths[0]);
619 }
620
621 // Meta-audit
622 else if (source == metaaudit) {
623 Gatherer.g_man.showMetaAuditBox();
624 }
625
626 // Open in external program
627 else if (source == open_externally) {
628 Gatherer.f_man.openFileInExternalApplication(node.getFile());
629 }
630 }
631 }
632}
Note: See TracBrowser for help on using the repository browser.