Search in sources :

Example 1 with FocusOnAction

use of org.talend.designer.runtime.visualization.internal.ui.properties.cpu.actions.FocusOnAction in project tdi-studio-se by Talend.

the class AbstractFilteredTree method createContextMenu.

/**
     * Creates the context menu.
     */
protected void createContextMenu() {
    // create actions
    openAction = OpenDeclarationAction.createOpenDeclarationAction(actionBars);
    copyAction = (CopyAction) actionBars.getGlobalActionHandler(ActionFactory.COPY.getId());
    findAction = (FindAction) actionBars.getGlobalActionHandler(ActionFactory.FIND.getId());
    focusOnFrameAction = new FocusOnAction(this);
    showCallersCalleesAction = new ShowCallersCalleesAction(getViewer());
    configureColumnsAction = new ConfigureColumnsAction(this);
    // create menu manager
    //$NON-NLS-1$
    MenuManager menuMgr = new MenuManager("#PopupMenu");
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        @Override
        public void menuAboutToShow(IMenuManager manager) {
            focusOnFrameAction.aboutToShow();
            manager.add(openAction);
            manager.add(new Separator());
            manager.add(copyAction);
            manager.add(findAction);
            manager.add(focusOnFrameAction);
            manager.add(showCallersCalleesAction);
            manager.add(new Separator());
            manager.add(configureColumnsAction);
            addMenus(manager);
        }
    });
    // create context menu
    Menu menu = menuMgr.createContextMenu(getViewer().getControl());
    getViewer().getControl().setMenu(menu);
}
Also used : FocusOnAction(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.actions.FocusOnAction) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) ShowCallersCalleesAction(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.actions.ShowCallersCalleesAction) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) ConfigureColumnsAction(org.talend.designer.runtime.visualization.internal.actions.ConfigureColumnsAction) IMenuListener(org.eclipse.jface.action.IMenuListener) Separator(org.eclipse.jface.action.Separator)

Aggregations

IMenuListener (org.eclipse.jface.action.IMenuListener)1 IMenuManager (org.eclipse.jface.action.IMenuManager)1 MenuManager (org.eclipse.jface.action.MenuManager)1 Separator (org.eclipse.jface.action.Separator)1 Menu (org.eclipse.swt.widgets.Menu)1 ConfigureColumnsAction (org.talend.designer.runtime.visualization.internal.actions.ConfigureColumnsAction)1 FocusOnAction (org.talend.designer.runtime.visualization.internal.ui.properties.cpu.actions.FocusOnAction)1 ShowCallersCalleesAction (org.talend.designer.runtime.visualization.internal.ui.properties.cpu.actions.ShowCallersCalleesAction)1