Java 类org.eclipse.swt.events.MenuEvent 实例源码

项目:typescript.java    文件:RefactorActionGroup.java   
private void refactorMenuShown(IMenuManager refactorSubmenu) {
    // we know that we have an MenuManager since we created it in
    // addRefactorSubmenu.
    Menu menu = ((MenuManager) refactorSubmenu).getMenu();
    menu.addMenuListener(new MenuAdapter() {
        @Override
        public void menuHidden(MenuEvent e) {
            refactorMenuHidden();
        }
    });
    ITextSelection textSelection = (ITextSelection) fEditor.getSelectionProvider().getSelection();
    // JavaTextSelection javaSelection= new
    // JavaTextSelection(getEditorInput(), getDocument(),
    // textSelection.getOffset(), textSelection.getLength());

    for (Iterator<SelectionDispatchAction> iter = fActions.iterator(); iter.hasNext();) {
        SelectionDispatchAction action = iter.next();
        action.update(textSelection);
    }
    refactorSubmenu.removeAll();
    if (fillRefactorMenu(refactorSubmenu) == 0)
        refactorSubmenu.add(fNoActionAvailable);
}
项目:PDFReporter-Studio    文件:HandleDefaultsAction.java   
/**
 * Generate the contextual menu to manage the template set. The menu is empty and
 * it is initialized the first time it's opened
 */
@Override
public Menu getMenu(Menu parent) {
    MenuItem root = new MenuItem(parent, SWT.CASCADE);
    menu = new Menu (parent);
    root.setMenu (menu);
    root.setText(Messages.HandleDefaultsAction_menuTitle);

    //Menu listener to show the current adapter highlighted on show
    menu.addMenuListener(new MenuAdapter() {
        @Override
        public void menuShown(MenuEvent e) {
            if (refreshItemList || menu.getItemCount() == 0 || !DefaultManager.INSTANCE.getAvailableElements().equals(values)){
                for(MenuItem item : menu.getItems()){
                    item.dispose();
                }
                initilizeItems();
                refreshItemList = false;
            }
        }
    });
    return menu;
}
项目:mytourbook    文件:ActionAddTourTag.java   
public Menu getMenu(final Control parent) {

        _isAdvancedMenu = true;

        dispose();

        _menu = new Menu(parent);

        // Add listener to repopulate the menu each time
        _menu.addMenuListener(new MenuAdapter() {
            @Override
            public void menuShown(final MenuEvent e) {
                fillMenu((Menu) e.widget);
            }
        });

        return _menu;
    }
项目:mytourbook    文件:ActionAddTourTag.java   
public Menu getMenu(final Menu parent) {

        _isAdvancedMenu = false;
        _modifiedTags.clear();

        dispose();

        _menu = new Menu(parent);

        // Add listener to repopulate the menu each time
        _menu.addMenuListener(new MenuAdapter() {
            @Override
            public void menuShown(final MenuEvent e) {
                fillMenu((Menu) e.widget);
            }
        });

        return _menu;
    }
项目:mytourbook    文件:ActionDeleteTourMenu2.java   
public Menu getMenu(final Menu parent) {

        dispose();

        _menu = new Menu(parent);

        // Add listener to repopulate the menu each time
        _menu.addMenuListener(new MenuAdapter() {
            @Override
            public void menuShown(final MenuEvent e) {

                // dispose old menu items
                for (final MenuItem menuItem : ((Menu) e.widget).getItems()) {
                    menuItem.dispose();
                }

                fillMenu(_menu);
            }
        });

        return _menu;
    }
项目:mytourbook    文件:ActionDeleteTourMenu.java   
public Menu getMenu(final Menu parent) {

        dispose();

        _menu = new Menu(parent);

        // Add listener to repopulate the menu each time
        _menu.addMenuListener(new MenuAdapter() {
            @Override
            public void menuShown(final MenuEvent e) {

                // dispose old menu items
                for (final MenuItem menuItem : ((Menu) e.widget).getItems()) {
                    menuItem.dispose();
                }

                fillMenu(_menu);
            }
        });

        return _menu;
    }
项目:mytourbook    文件:ActionMergeIntoMenu.java   
public Menu getMenu(final Menu parent) {

        dispose();
        fMenu = new Menu(parent);

        // Add listener to repopulate the menu each time
        fMenu.addMenuListener(new MenuAdapter() {
            @Override
            public void menuShown(final MenuEvent e) {

                // dispose old menu items
                for (final MenuItem menuItem : ((Menu) e.widget).getItems()) {
                    menuItem.dispose();
                }

                fillMenu(fMenu);
            }
        });

        return fMenu;
    }
项目:mytourbook    文件:ActionReimportSubMenu.java   
@Override
public Menu getMenu(final Menu parent) {

    dispose();

    _menu = new Menu(parent);

    // Add listener to repopulate the menu each time
    _menu.addMenuListener(new MenuAdapter() {
        @Override
        public void menuShown(final MenuEvent e) {

            // dispose old menu items
            for (final MenuItem menuItem : ((Menu) e.widget).getItems()) {
                menuItem.dispose();
            }

            fillMenu(_menu);
        }
    });

    return _menu;
}
项目:mytourbook    文件:ActionSetMarkerLabelPositionMenu.java   
public Menu getMenu(final Menu parent) {

        dispose();

        _menu = new Menu(parent);

        // Add listener to repopulate the menu each time
        _menu.addMenuListener(new MenuAdapter() {
            @Override
            public void menuShown(final MenuEvent e) {

                // dispose old menu items
                for (final MenuItem menuItem : ((Menu) e.widget).getItems()) {
                    menuItem.dispose();
                }

                fillMenu(_menu);
            }
        });

        return _menu;
    }
项目:mytourbook    文件:ActionSetTourTypeMenu.java   
@Override
public Menu getMenu(final Menu parent) {

    dispose();

    _menu = new Menu(parent);

    // Add listener to repopulate the menu each time
    _menu.addMenuListener(new MenuAdapter() {
        @Override
        public void menuShown(final MenuEvent e) {

            // dispose old menu items
            for (final MenuItem menuItem : ((Menu) e.widget).getItems()) {
                menuItem.dispose();
            }

            fillMenu(_menu);
        }
    });

    return _menu;
}
项目:mytourbook    文件:ActionSetPerson.java   
public Menu getMenu(final Menu parent) {

        dispose();
        _menu = new Menu(parent);

        // Add listener to repopulate the menu each time
        _menu.addMenuListener(new MenuAdapter() {
            @Override
            public void menuShown(final MenuEvent e) {

                // dispose old menu items
                for (final MenuItem menuItem : ((Menu) e.widget).getItems()) {
                    menuItem.dispose();
                }

                fillMenu(_menu);
            }
        });

        return _menu;
    }
项目:mytourbook    文件:ActionCadenceSubMenu.java   
@Override
public Menu getMenu(final Menu parent) {

    dispose();

    _menu = new Menu(parent);

    // Add listener to repopulate the menu each time
    _menu.addMenuListener(new MenuAdapter() {
        @Override
        public void menuShown(final MenuEvent e) {

            // dispose old menu items
            for (final MenuItem menuItem : ((Menu) e.widget).getItems()) {
                menuItem.dispose();
            }

            fillMenu(_menu);

            enableActions();
        }
    });

    return _menu;
}
项目:mytourbook    文件:ColumnContextMenu.java   
@Override
public Menu getMenu(final Menu parent) {

    dispose();
    __categoryMenu = new Menu(parent);

    // Add listener to repopulate the menu each time
    __categoryMenu.addMenuListener(new MenuAdapter() {
        @Override
        public void menuShown(final MenuEvent e) {

            final Menu menu = (Menu) e.widget;

            // dispose old items
            final MenuItem[] items = menu.getItems();
            for (final MenuItem item : items) {
                item.dispose();
            }

            // add actions
            createColumnActions(__categoryMenu, __category);
        }
    });

    return __categoryMenu;
}
项目:Eclipse-Postfix-Code-Completion    文件:RefactorActionGroup.java   
private void refactorMenuShown(IMenuManager refactorSubmenu) {
    // we know that we have an MenuManager since we created it in
    // addRefactorSubmenu.
    Menu menu= ((MenuManager)refactorSubmenu).getMenu();
    menu.addMenuListener(new MenuAdapter() {
        @Override
        public void menuHidden(MenuEvent e) {
            refactorMenuHidden();
        }
    });
    ITextSelection textSelection= (ITextSelection)fEditor.getSelectionProvider().getSelection();
    JavaTextSelection javaSelection= new JavaTextSelection(getEditorInput(), getDocument(), textSelection.getOffset(), textSelection.getLength());

    for (Iterator<SelectionDispatchAction> iter= fActions.iterator(); iter.hasNext(); ) {
        SelectionDispatchAction action= iter.next();
        action.update(javaSelection);
    }
    refactorSubmenu.removeAll();
    if (fillRefactorMenu(refactorSubmenu) == 0)
        refactorSubmenu.add(fNoActionAvailable);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:RefactorActionGroup.java   
private void refactorMenuShown(IMenuManager refactorSubmenu) {
    // we know that we have an MenuManager since we created it in
    // addRefactorSubmenu.
    Menu menu= ((MenuManager)refactorSubmenu).getMenu();
    menu.addMenuListener(new MenuAdapter() {
        @Override
        public void menuHidden(MenuEvent e) {
            refactorMenuHidden();
        }
    });
    ITextSelection textSelection= (ITextSelection)fEditor.getSelectionProvider().getSelection();
    JavaTextSelection javaSelection= new JavaTextSelection(getEditorInput(), getDocument(), textSelection.getOffset(), textSelection.getLength());

    for (Iterator<SelectionDispatchAction> iter= fActions.iterator(); iter.hasNext(); ) {
        SelectionDispatchAction action= iter.next();
        action.update(javaSelection);
    }
    refactorSubmenu.removeAll();
    if (fillRefactorMenu(refactorSubmenu) == 0)
        refactorSubmenu.add(fNoActionAvailable);
}
项目:skin4eclipse    文件:SaveSessionsPulldownMenu.java   
protected void initMenu() {
    menu.addMenuListener(new MenuAdapter() {
        public void menuShown(MenuEvent e) {
            Menu m = (Menu) e.widget;
            MenuItem[] items = m.getItems();
            for (int i = 0; i < items.length; i++) {
                items[i].dispose();
            }
            fillMenu(m);
        }
    });
}
项目:skin4eclipse    文件:LoadSessionsPulldownMenu.java   
protected void initMenu() {
    menu.addMenuListener(new MenuAdapter() {
        public void menuShown(MenuEvent e) {
            Menu m = (Menu) e.widget;
            MenuItem[] items = m.getItems();
            for (int i = 0; i < items.length; i++) {
                items[i].dispose();
            }
            fillMenu(m);
        }
    });
}
项目:PDFReporter-Studio    文件:PreviewFormatDropDownAction.java   
/**
 * Generate the list of all the previews output format
 * 
 * @param parent
 */
private void createOutputMenu(Menu parent) {
    MenuItem root = new MenuItem(parent, SWT.CASCADE);
    menu = new Menu(parent);
    root.setMenu(menu);
    root.setText(Messages.ViewSettingsDropDownAction_previewFormatMenu);
    JrxmlEditor editor = getEditor();
    PreviewContainer preview = (PreviewContainer) editor.getEditor(JrxmlEditor.PAGE_PREVIEW);
    viewFactory = preview.getViewFactory();
    for (String key : viewFactory.getKeys()) {
        if (viewFactory.isSeparator(key)) {
            new MenuItem(menu, SWT.SEPARATOR);
        } else {
            creteItem(key, editor);
        }
    }

    menu.addMenuListener(new MenuAdapter() {
        @Override
        public void menuShown(MenuEvent e) {
            String actualPreview = getEditor().getDefaultViewerKey();
            for (MenuItem item : menu.getItems()) {
                item.setSelection(item.getText().equals(actualPreview));
            }
        }
    });
}
项目:mytourbook    文件:TourChartContextProvider.java   
@Override
public void onShowContextMenu(final MenuEvent menuEvent, final Control menuParentControl) {

    _tagMenuMgr.onShowMenu(//
            menuEvent,
            menuParentControl,
            Display.getCurrent().getCursorLocation(),
            null);
}
项目:mytourbook    文件:ActionMenuSetTagStructure.java   
public Menu getMenu(final Menu parent) {

        dispose();
        _menu = new Menu(parent);

        // Add listener to repopulate the menu each time
        _menu.addMenuListener(new MenuAdapter() {
            @Override
            public void menuShown(final MenuEvent e) {

                final Menu menu = (Menu) e.widget;

                // dispose old items
                for (final MenuItem menuItem : menu.getItems()) {
                    menuItem.dispose();
                }

                /*
                 * create all expand types
                 */
                final int selectedExpandType = getSelectedExpandType();
                int typeIndex = 0;
                for (final int expandType : TagManager.EXPAND_TYPES) {

                    final ActionSetTagStructure actionTagStructure = new ActionSetTagStructure(
                            expandType,
                            TagManager.EXPAND_TYPE_NAMES[typeIndex++]);

                    // check active expand type
                    actionTagStructure.setChecked(selectedExpandType == expandType);

                    addActionToMenu(actionTagStructure);
                }
            }
        });

        return _menu;
    }
项目:mytourbook    文件:ActionAddTourTag.java   
public Menu getMenu(final Menu parent) {

            dispose();
            __categoryMenu = new Menu(parent);

            // Add listener to repopulate the menu each time
            __categoryMenu.addMenuListener(new MenuAdapter() {
                @Override
                public void menuShown(final MenuEvent e) {

                    final Menu menu = (Menu) e.widget;

                    // dispose old items
                    final MenuItem[] items = menu.getItems();
                    for (final MenuItem item : items) {
                        item.dispose();
                    }

                    final TagCollection tagCollection = TourDatabase.getTagEntries(__tagCategory.getCategoryId());

                    // add actions
                    __actionAddTourTag.createCategoryActions(tagCollection, __categoryMenu);
                    __actionAddTourTag.createTagActions(tagCollection, __categoryMenu);
                }
            });

            return __categoryMenu;
        }
项目:mytourbook    文件:ActionRemoveTourTag.java   
public Menu getMenu(final Control parent) {

        dispose();
        _menu = new Menu(parent);

        // Add listener to repopulate the menu each time
        _menu.addMenuListener(new MenuAdapter() {
            @Override
            public void menuShown(final MenuEvent e) {
                onFillMenu((Menu) e.widget);
            }
        });

        return _menu;
    }
项目:mytourbook    文件:ActionRemoveTourTag.java   
public Menu getMenu(final Menu parent) {

        dispose();
        _menu = new Menu(parent);

        // Add listener to repopulate the menu each time
        _menu.addMenuListener(new MenuAdapter() {
            @Override
            public void menuShown(final MenuEvent e) {
                onFillMenu((Menu) e.widget);
            }
        });

        return _menu;
    }
项目:mytourbook    文件:ActionMenuSetAllTagStructures.java   
public Menu getMenu(final Menu parent) {

        dispose();
        _menu = new Menu(parent);

        // Add listener to repopulate the menu each time
        _menu.addMenuListener(new MenuAdapter() {
            @Override
            public void menuShown(final MenuEvent e) {

                final Menu menu = (Menu) e.widget;

                // dispose old items
                for (final MenuItem menuItem : menu.getItems()) {
                    menuItem.dispose();
                }

                /*
                 * create all expand types
                 */
                int typeIndex = 0;
                for (final int expandType : TagManager.EXPAND_TYPES) {

                    final ActionSetTagStructure actionTagStructure = new ActionSetTagStructure(
                            expandType,
                            TagManager.EXPAND_TYPE_NAMES[typeIndex++]);

                    addActionToMenu(actionTagStructure);
                }
            }
        });

        return _menu;
    }
项目:mytourbook    文件:TagMenuManager.java   
/**
 * This is called when the menu is displayed which contains the tag actions.
 * 
 * @param menuEvent
 * @param menuParentControl
 * @param menuPosition
 * @param toolTip
 */
public void onShowMenu( final MenuEvent menuEvent,
                        final Control menuParentControl,
                        final Point menuPosition,
                        final ToolTip toolTip) {

    _advancedMenuToAddTags.onShowParentMenu(//
            menuEvent,
            menuParentControl,
            _isTaggingAutoOpen,
            _isTaggingAnimation,
            _taggingAutoOpenDelay,
            menuPosition,
            toolTip);
}
项目:mytourbook    文件:CollatedToursView.java   
/**
 * create the views context menu
 */
private void createUI_20_ContextMenu() {

    final MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {
        @Override
        public void menuAboutToShow(final IMenuManager manager) {
            fillContextMenu(manager);
        }
    });

    final Tree tree = (Tree) _tourViewer.getControl();
    final Menu treeContextMenu = menuMgr.createContextMenu(tree);
    treeContextMenu.addMenuListener(new MenuAdapter() {
        @Override
        public void menuHidden(final MenuEvent e) {
            _tagMenuMgr.onHideMenu();
        }

        @Override
        public void menuShown(final MenuEvent menuEvent) {
            _tagMenuMgr.onShowMenu(menuEvent, tree, Display.getCurrent().getCursorLocation(), _tourInfoToolTip);
        }
    });

    _columnManager.createHeaderContextMenu(tree, treeContextMenu);
}
项目:mytourbook    文件:TourCompareResultView.java   
/**
 * create the views context menu
 */
private void createUI_20_ContextMenu() {

    final MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {
        @Override
        public void menuAboutToShow(final IMenuManager manager) {
            fillContextMenu(manager);
        }
    });

    final Tree tree = (Tree) _tourViewer.getControl();
    final Menu treeContextMenu = menuMgr.createContextMenu(tree);
    treeContextMenu.addMenuListener(new MenuAdapter() {
        @Override
        public void menuHidden(final MenuEvent e) {
            _tagMenuMgr.onHideMenu();
        }

        @Override
        public void menuShown(final MenuEvent menuEvent) {
            _tagMenuMgr.onShowMenu(menuEvent, tree, Display.getCurrent().getCursorLocation(), _tourInfoToolTip);
        }
    });

    _columnManager.createHeaderContextMenu(tree, treeContextMenu);
}
项目:mytourbook    文件:TourCatalogView.java   
/**
 * create the views context menu
 */
private void createUI_20_ContextMenu() {

    final Tree tree = (Tree) _tourViewer.getControl();

    final MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {
        @Override
        public void menuAboutToShow(final IMenuManager manager) {
            fillContextMenu(manager);
        }
    });

    final Menu treeContextMenu = menuMgr.createContextMenu(tree);
    treeContextMenu.addMenuListener(new MenuAdapter() {
        @Override
        public void menuHidden(final MenuEvent e) {
            _tagMenuMgr.onHideMenu();
        }

        @Override
        public void menuShown(final MenuEvent menuEvent) {
            _tagMenuMgr.onShowMenu(menuEvent, tree, Display.getCurrent().getCursorLocation(), _tourInfoToolTip);
        }
    });

    _columnManager.createHeaderContextMenu(tree, treeContextMenu);
}
项目:mytourbook    文件:TourBookView.java   
/**
 * create the views context menu
 */
private void createUI_20_ContextMenu() {

    final MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {
        @Override
        public void menuAboutToShow(final IMenuManager manager) {

            _tourInfoToolTip.hideToolTip();

            fillContextMenu(manager);
        }
    });

    final Tree tree = (Tree) _tourViewer.getControl();
    final Menu treeContextMenu = menuMgr.createContextMenu(tree);
    treeContextMenu.addMenuListener(new MenuAdapter() {
        @Override
        public void menuHidden(final MenuEvent e) {
            _tagMenuMgr.onHideMenu();
        }

        @Override
        public void menuShown(final MenuEvent menuEvent) {
            _tagMenuMgr.onShowMenu(menuEvent, tree, Display.getCurrent().getCursorLocation(), _tourInfoToolTip);
        }
    });

    _columnManager.createHeaderContextMenu(tree, treeContextMenu);
}
项目:mytourbook    文件:TaggingView.java   
/**
 * create the views context menu
 */
private void createUI_20_ContextMenu() {

    final Tree tree = (Tree) _tagViewer.getControl();

    final MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {
        @Override
        public void menuAboutToShow(final IMenuManager manager) {
            fillContextMenu(manager);
        }
    });

    // add the context menu to the tree viewer

    final Menu treeContextMenu = menuMgr.createContextMenu(tree);
    treeContextMenu.addMenuListener(new MenuAdapter() {
        @Override
        public void menuHidden(final MenuEvent e) {
            _tagMenuMgr.onHideMenu();
        }

        @Override
        public void menuShown(final MenuEvent menuEvent) {
            _tagMenuMgr.onShowMenu(menuEvent, tree, Display.getCurrent().getCursorLocation(), _tourInfoToolTip);
        }
    });

    _columnManager.createHeaderContextMenu(tree, treeContextMenu);
}
项目:mytourbook    文件:RawDataView.java   
/**
 * create the views context menu
 */
private void createUI_94_ContextMenu() {

    final Table table = (Table) _tourViewer.getControl();

    final MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {
        @Override
        public void menuAboutToShow(final IMenuManager manager) {
            fillContextMenu(manager);
        }
    });

    final Menu tableContextMenu = menuMgr.createContextMenu(table);
    tableContextMenu.addMenuListener(new MenuAdapter() {
        @Override
        public void menuHidden(final MenuEvent e) {
            _tagMenuMgr.onHideMenu();
        }

        @Override
        public void menuShown(final MenuEvent menuEvent) {
            _tagMenuMgr.onShowMenu(menuEvent, table, Display.getCurrent().getCursorLocation(), _tourInfoToolTip);
        }
    });

    getSite().registerContextMenu(menuMgr, _tourViewer);

    _columnManager.createHeaderContextMenu(table, tableContextMenu);
}
项目:mytourbook    文件:TourChartContextProvider.java   
@Override
public void onShowContextMenu(final MenuEvent menuEvent, final Control menuParentControl) {

    _tagMenuMgr.onShowMenu(//
            menuEvent,
            menuParentControl,
            Display.getCurrent().getCursorLocation(),
            null);
}
项目:mytourbook    文件:ColumnFormatSubMenu.java   
@Override
public Menu getMenu(final Menu parent) {

    dispose();

    __formatsMenu = new Menu(parent);

    // Add listener to repopulate the menu each time
    __formatsMenu.addMenuListener(new MenuAdapter() {
        @Override
        public void menuShown(final MenuEvent e) {

            final Menu menu = (Menu) e.widget;

            // dispose old items
            final MenuItem[] items = menu.getItems();
            for (final MenuItem item : items) {
                item.dispose();
            }

            // add actions
            createFormatActions(__formatsMenu, __isDetailFormat);
        }
    });

    return __formatsMenu;
}
项目:Eclipse-Postfix-Code-Completion    文件:OccurrencesSearchMenuAction.java   
protected void initMenu(Menu menu) {
    menu.addMenuListener(new MenuAdapter() {
        @Override
        public void menuShown(MenuEvent e) {
            Menu m= (Menu) e.widget;
            MenuItem[] items= m.getItems();
            for (int i= 0; i < items.length; i++) {
                items[i].dispose();
            }
            fillMenu(m);
        }
    });
}
项目:Eclipse-Postfix-Code-Completion    文件:SurroundWithTemplateMenuAction.java   
protected void initMenu() {
    fMenu.addMenuListener(new MenuAdapter() {
        @Override
        public void menuShown(MenuEvent e) {
            Menu m = (Menu)e.widget;
            MenuItem[] items = m.getItems();
            for (int i=0; i < items.length; i++) {
                items[i].dispose();
            }
            fillMenu(m);
        }
    });
}
项目:jplot2d    文件:MenuHandler.java   
public void menuShown(MenuEvent e) {
     /*
      * Update the internal status according to the point where the menu popup.
*/

     // undo/redo
     undoItem.setEnabled(env.canUndo());
     redoItem.setEnabled(env.canRedo());

 }
项目:gef-gwt    文件:PaletteStackEditPart.java   
/**
 * @see org.eclipse.swt.events.MenuListener#menuHidden(org.eclipse.swt.events.MenuEvent)
 */
public void menuHidden(MenuEvent e) {
    d.asyncExec(new Runnable() {
        public void run() {
            if (menu != null) {
                if (!menu.isDisposed())
                    menu.dispose();
                menu = null;
            }
        }
    });
}
项目:XPagesExtensionLibrary    文件:ToolbarAction.java   
private void initMenu(Menu fMenu) {     
    fMenu.addMenuListener(new MenuAdapter() {
        public void menuShown(MenuEvent e) {                
            Menu m = (Menu) e.widget;
            MenuItem[] items = m.getItems();
            for (int i = 0; i < items.length; i++) {
                items[i].dispose();
            }
            fillMenu(m);                
        }
    });
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:OccurrencesSearchMenuAction.java   
protected void initMenu(Menu menu) {
    menu.addMenuListener(new MenuAdapter() {
        @Override
        public void menuShown(MenuEvent e) {
            Menu m= (Menu) e.widget;
            MenuItem[] items= m.getItems();
            for (int i= 0; i < items.length; i++) {
                items[i].dispose();
            }
            fillMenu(m);
        }
    });
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:SurroundWithTemplateMenuAction.java   
protected void initMenu() {
    fMenu.addMenuListener(new MenuAdapter() {
        @Override
        public void menuShown(MenuEvent e) {
            Menu m = (Menu)e.widget;
            MenuItem[] items = m.getItems();
            for (int i=0; i < items.length; i++) {
                items[i].dispose();
            }
            fillMenu(m);
        }
    });
}