Changeset 5773


Ignore:
Timestamp:
2003-11-03T14:25:25+13:00 (20 years ago)
Author:
mdewsnip
Message:

Fixed bug 98: popup menu appears when right-clicking even when no file has been selected.

File:
1 edited

Legend:

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

    r5593 r5773  
    435435    }
    436436    /** Called whenever this pane gains focus, this method ensures that the various tree renderers are correctly colouring the tree (as these settings sometimes get lost).
    437       * @param event A <strong>FocusEvent</strong> containing details about the focus action performed.
    438       */
     437     * @param event A <strong>FocusEvent</strong> containing details about the focus action performed.
     438     */
    439439    public void focusGained(FocusEvent event) {
    440440    DefaultTreeCellRenderer def = new DefaultTreeCellRenderer();
     
    452452    }
    453453    /** Implementation side-effect, not used in any way.
    454       * @param event A <strong>FocusEvent</strong> containing details about the focus action performed.
    455       */
     454     * @param event A <strong>FocusEvent</strong> containing details about the focus action performed.
     455     */
    456456    public void focusLost(FocusEvent event) {
    457457    }
     
    567567            add(new JSeparator());
    568568        }
    569         if(node == null || (node != null && !node.isReadOnly())) {
     569        if(tree == collection_tree && tree.getSelectionCount() != 0 && node != null && !node.isReadOnly()) {
    570570            delete = new JMenuItem(Dictionary.get("CollectionPopupMenu.Delete"), KeyEvent.VK_D);
    571571            delete.addActionListener(this);
Note: See TracChangeset for help on using the changeset viewer.