Changeset 11315 for trunk


Ignore:
Timestamp:
2006-03-08T17:18:07+13:00 (18 years ago)
Author:
kjdon
Message:

added in replace option to collection tree menu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/gui/GatherPane.java

    r11246 r11315  
    122122
    123123    /** The tree showing the available source workspace. */
    124     private WorkspaceTree workspace_tree = null;
     124    public WorkspaceTree workspace_tree = null;
    125125
    126126
     
    485485    private JMenuItem open_externally = null;
    486486    private JMenuItem rename = null;
     487    private JMenuItem replace = null;
    487488
    488489
     
    588589        add(delete);
    589590
    590         // Rename option (single selections only)
    591         if (selection_paths.length == 1) {
    592             rename = new JMenuItem(Dictionary.get("CollectionPopupMenu.Rename"), KeyEvent.VK_R);
    593             rename.addActionListener(this);
    594             add(rename);
    595         }
    596591        }
    597592
     
    601596        }
    602597
     598        // collection tree gets rename option
     599        if (tree == collection_tree) {
     600        rename = new JMenuItem(Dictionary.get("CollectionPopupMenu.Rename"), KeyEvent.VK_R);
     601        rename.addActionListener(this);
     602        add(rename);
     603        }
     604
    603605        TreePath path = selection_paths[0];
    604606        node = (FileNode) path.getLastPathComponent();
     
    606608        // ---- Options for file nodes ----
    607609        if (node.isLeaf()) {
    608         // Explode metadata databases, for collection tree only, and for explodable files only
    609         if (tree == collection_tree && ((CollectionTreeNode) node).isExplodable()) {
    610             explode_metadata_database = new JMenuItem(Dictionary.get("Menu.Explode_Metadata_Database"), KeyEvent.VK_E);
    611             explode_metadata_database.addActionListener(this);
    612             explode_metadata_database.setEnabled(!Gatherer.isGsdlRemote);
    613             add(explode_metadata_database);
    614         }
    615 
     610        if (tree == collection_tree) {
     611            // Explode metadata databases, for explodable files only
     612            if (((CollectionTreeNode) node).isExplodable()) {
     613            explode_metadata_database = new JMenuItem(Dictionary.get("Menu.Explode_Metadata_Database"), KeyEvent.VK_E);
     614            explode_metadata_database.addActionListener(this);
     615            explode_metadata_database.setEnabled(!Gatherer.isGsdlRemote);
     616            add(explode_metadata_database);
     617            }
     618            // replace file
     619            replace = new JMenuItem(Dictionary.get("CollectionPopupMenu.Replace"), KeyEvent.VK_P);
     620            replace.addActionListener(this);
     621            add(replace);
     622        }
     623       
    616624        // Open the file in an external program
    617625        open_externally = new JMenuItem(Dictionary.get("Menu.Open_Externally"), KeyEvent.VK_O);
     
    736744        else if (source == rename) {
    737745        Gatherer.f_man.renameCollectionFile(collection_tree, (CollectionTreeNode) node);
     746        }
     747
     748        // Replace
     749        else if (source == replace) {
     750        Gatherer.f_man.replaceCollectionFile(collection_tree, (CollectionTreeNode) node);
    738751        }
    739752    }
Note: See TracChangeset for help on using the changeset viewer.