Changeset 8287


Ignore:
Timestamp:
12/24/04 19:16:52 (17 years ago)
Author:
piso
Message:

Moved populateMenu() call from Menu.setPopupMenuVisible() to MenuListener?.menuSelected().

Location:
trunk/j/src/org/armedbear/j
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/j/Menu.java

    r2339 r8287  
    22 * Menu.java
    33 *
    4  * Copyright (C) 1998-2003 Peter Graves
    5  * $Id: Menu.java,v 1.6 2003-06-13 00:56:55 piso Exp $
     4 * Copyright (C) 1998-2004 Peter Graves
     5 * $Id: Menu.java,v 1.7 2004-12-24 19:16:52 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    4242    public void setPopupMenuVisible(boolean b)
    4343    {
    44         if (b) {
    45             final Editor editor = Editor.currentEditor();
    46             editor.getMode().populateMenu(editor, this);
    47         }
     44//         Log.debug("setPopupMenuVisible " + b);
    4845        super.setPopupMenuVisible(b);
    49         if (!b)
    50             removeAll();
     46//         if (b) {
     47//             final Editor editor = Editor.currentEditor();
     48//             editor.getMode().populateMenu(editor, this);
     49//         }
     50//         super.setPopupMenuVisible(b);
     51//         if (!b)
     52//             removeAll();
    5153    }
    5254
  • trunk/j/src/org/armedbear/j/MenuListener.java

    r2 r8287  
    22 * MenuListener.java
    33 *
    4  * Copyright (C) 1998-2002 Peter Graves
    5  * $Id: MenuListener.java,v 1.1.1.1 2002-09-24 16:08:40 piso Exp $
     4 * Copyright (C) 1998-2004 Peter Graves
     5 * $Id: MenuListener.java,v 1.2 2004-12-24 19:16:43 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2626public final class MenuListener implements javax.swing.event.MenuListener
    2727{
    28     public void menuCanceled(MenuEvent e) {}
     28    public void menuCanceled(MenuEvent e)
     29    {
     30//         Log.debug("menuCanceled " + e.toString());
     31    }
    2932
    3033    public void menuDeselected(MenuEvent e)
    3134    {
     35//         Log.debug("menuDeselected " + e.toString());
     36        if (e.getSource() instanceof org.armedbear.j.Menu) {
     37//             Log.debug("menuSelected calling removeAll...");
     38//             final Editor editor = Editor.currentEditor();
     39//             editor.getMode().populateMenu(editor, (Menu) e.getSource());
     40            ((Menu)e.getSource()).removeAll();
     41        }
    3242        Editor.isMenuSelected = false;
    3343    }
     
    3545    public void menuSelected(MenuEvent e)
    3646    {
     47//         Log.debug("menuSelected " + e.toString());
     48        if (e.getSource() instanceof org.armedbear.j.Menu) {
     49//             Log.debug("menuSelected calling populateMenu...");
     50            final Editor editor = Editor.currentEditor();
     51            editor.getMode().populateMenu(editor, (Menu) e.getSource());
     52        }
    3753        Editor.isMenuSelected = true;
    3854    }
Note: See TracChangeset for help on using the changeset viewer.