Changeset 5251
- Timestamp:
- 2003-08-22T10:02:41+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/CollectionPane.java
r5157 r5251 559 559 this.tree = tree; 560 560 TreePath path = tree.getClosestPathForLocation(event.getX(), event.getY()); 561 node = (FileNode)path.getLastPathComponent(); 562 // Set Options based on selection and tree 563 if(tree.getSelectionCount() != 0 && tree == collection_tree) { 564 show_metaaudit = new JMenuItem(get("Menu.Metadata_View") + " " + collection_tree.getSelectionDetails(), KeyEvent.VK_V); 565 show_metaaudit.addActionListener(this); 566 add(show_metaaudit); 567 } 568 if(tree == collection_tree && node != null && node.getFile() != null && node.getFile().isDirectory() && !node.isReadOnly()) { 569 new_folder = new JMenuItem(get("New_Folder"), KeyEvent.VK_N); 570 new_folder.addActionListener(this); 571 add(new_folder); 572 add(new JSeparator()); 573 } 574 if(node == null || (node != null && !node.isReadOnly())) { 575 delete = new JMenuItem(get("Delete"), KeyEvent.VK_D); 576 delete.addActionListener(this); 577 add(delete); 578 } 579 if(tree == workspace_tree && node != null && !node.isLeaf()) { 580 String node_name = node.toString(); 581 FileNode root = (FileNode) tree.getModel().getRoot(); 582 if(!node_name.equals(get("Tree.World")) && !node_name.equals(get("Tree.Root")) && !node_name.equals(get("Tree.Public")) && !node_name.equals(get("Tree.Private"))) { 583 // You can unmap 1st level nodes. 584 if(root.getIndex(node) != -1) { 585 unmap = new JMenuItem(get("MappingPrompt.Unmap"), KeyEvent.VK_U); 586 unmap.addActionListener(this); 587 add(unmap); 561 if(path != null) { 562 node = (FileNode)path.getLastPathComponent(); 563 // Set Options based on selection and tree 564 if(tree.getSelectionCount() != 0 && tree == collection_tree) { 565 show_metaaudit = new JMenuItem(get("Menu.Metadata_View") + " " + collection_tree.getSelectionDetails(), KeyEvent.VK_V); 566 show_metaaudit.addActionListener(this); 567 add(show_metaaudit); 568 } 569 if(tree == collection_tree && node != null && node.getFile() != null && node.getFile().isDirectory() && !node.isReadOnly()) { 570 new_folder = new JMenuItem(get("New_Folder"), KeyEvent.VK_N); 571 new_folder.addActionListener(this); 572 add(new_folder); 573 add(new JSeparator()); 574 } 575 if(node == null || (node != null && !node.isReadOnly())) { 576 delete = new JMenuItem(get("Delete"), KeyEvent.VK_D); 577 delete.addActionListener(this); 578 add(delete); 579 } 580 if(tree == workspace_tree && node != null && !node.isLeaf()) { 581 String node_name = node.toString(); 582 FileNode root = (FileNode) tree.getModel().getRoot(); 583 if(!node_name.equals(get("Tree.World")) && !node_name.equals(get("Tree.Root")) && !node_name.equals(get("Tree.Public")) && !node_name.equals(get("Tree.Private"))) { 584 // You can unmap 1st level nodes. 585 if(root.getIndex(node) != -1) { 586 unmap = new JMenuItem(get("MappingPrompt.Unmap"), KeyEvent.VK_U); 587 unmap.addActionListener(this); 588 add(unmap); 589 } 590 // Or map any other level directories. 591 else { 592 map = new JMenuItem(get("MappingPrompt.Map"), KeyEvent.VK_M); 593 map.addActionListener(this); 594 add(map); 595 } 588 596 } 589 // Or map any other level directories. 590 else { 591 map = new JMenuItem(get("MappingPrompt.Map"), KeyEvent.VK_M); 592 map.addActionListener(this); 593 add(map); 594 } 595 } 596 } 597 show(tree, event.getX(), event.getY()); 597 } 598 show(tree, event.getX(), event.getY()); 599 } 598 600 } 599 601 /** Called whenever one of the menu items is actioned apon, this method then causes the appropriate effect. */
Note:
See TracChangeset
for help on using the changeset viewer.