Search in sources :

Example 1 with ConfigureColumnsAction

use of org.talend.designer.runtime.visualization.internal.actions.ConfigureColumnsAction 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)

Example 2 with ConfigureColumnsAction

use of org.talend.designer.runtime.visualization.internal.actions.ConfigureColumnsAction in project tdi-studio-se by Talend.

the class ThreadFilteredTree method createContextMenu.

/**
     * Creates the context menu.
     * 
     * @param actionBars The action bars
     */
private void createContextMenu(IActionBars actionBars) {
    configureColumnsAction = new ConfigureColumnsAction(this);
    final CopyAction copyAction = CopyAction.createCopyAction(actionBars);
    getViewer().addSelectionChangedListener(copyAction);
    //$NON-NLS-1$
    MenuManager menuMgr = new MenuManager("#PopupMenu");
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        @Override
        public void menuAboutToShow(IMenuManager manager) {
            manager.add(copyAction);
            manager.add(new Separator());
            manager.add(configureColumnsAction);
        }
    });
    Menu menu = menuMgr.createContextMenu(getViewer().getControl());
    getViewer().getControl().setMenu(menu);
}
Also used : CopyAction(org.talend.designer.runtime.visualization.internal.actions.CopyAction) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) 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)

Example 3 with ConfigureColumnsAction

use of org.talend.designer.runtime.visualization.internal.actions.ConfigureColumnsAction in project tdi-studio-se by Talend.

the class NotificationFilteredTree method createContextMenu.

/**
     * Creates the context menu.
     * 
     * @param actionBars The action bars
     */
private void createContextMenu(IActionBars actionBars) {
    final CopyAction copyAction = CopyAction.createCopyAction(actionBars);
    clearAction = new Action(Messages.clearLabel) {

        @Override
        public void run() {
            notificationsTab.clear();
        }
    };
    detailsAction = new NotificationDetailsDialogAction(this);
    configureColumnsAction = new ConfigureColumnsAction(this);
    getViewer().addSelectionChangedListener(copyAction);
    getViewer().addSelectionChangedListener(detailsAction);
    //$NON-NLS-1$
    MenuManager menuMgr = new MenuManager("#PopupMenu");
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        @Override
        public void menuAboutToShow(IMenuManager manager) {
            manager.add(copyAction);
            manager.add(new Separator());
            manager.add(clearAction);
            manager.add(new Separator());
            manager.add(configureColumnsAction);
            manager.add(new Separator());
            manager.add(detailsAction);
        }
    });
    Menu menu = menuMgr.createContextMenu(getViewer().getControl());
    getViewer().getControl().setMenu(menu);
}
Also used : ConfigureColumnsAction(org.talend.designer.runtime.visualization.internal.actions.ConfigureColumnsAction) CopyAction(org.talend.designer.runtime.visualization.internal.actions.CopyAction) Action(org.eclipse.jface.action.Action) CopyAction(org.talend.designer.runtime.visualization.internal.actions.CopyAction) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) 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)

Example 4 with ConfigureColumnsAction

use of org.talend.designer.runtime.visualization.internal.actions.ConfigureColumnsAction in project tdi-studio-se by Talend.

the class HeapHistogramPage method createContextMenu.

/**
     * Creates the context menu.
     * 
     * @param actionBars The action bars
     */
private void createContextMenu(IActionBars actionBars) {
    final OpenDeclarationAction openAction = OpenDeclarationAction.createOpenDeclarationAction(actionBars);
    final CopyAction copyAction = CopyAction.createCopyAction(actionBars);
    configureColumnsAction = new ConfigureColumnsAction(this);
    heapViewer.addSelectionChangedListener(openAction);
    heapViewer.getControl().addFocusListener(new FocusListener() {

        @Override
        public void focusLost(FocusEvent e) {
            heapViewer.removeSelectionChangedListener(copyAction);
        }

        @Override
        public void focusGained(FocusEvent e) {
            heapViewer.addSelectionChangedListener(copyAction);
        }
    });
    heapViewer.addOpenListener(new IOpenListener() {

        @Override
        public void open(OpenEvent event) {
            openAction.run();
        }
    });
    //$NON-NLS-1$
    MenuManager menuMgr = new MenuManager("#PopupMenu");
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        @Override
        public void menuAboutToShow(IMenuManager manager) {
            manager.add(openAction);
            manager.add(copyAction);
            manager.add(new Separator());
            manager.add(configureColumnsAction);
        }
    });
    Menu menu = menuMgr.createContextMenu(heapViewer.getControl());
    heapViewer.getControl().setMenu(menu);
}
Also used : OpenDeclarationAction(org.talend.designer.runtime.visualization.internal.actions.OpenDeclarationAction) CopyAction(org.talend.designer.runtime.visualization.internal.actions.CopyAction) FocusEvent(org.eclipse.swt.events.FocusEvent) IMenuListener(org.eclipse.jface.action.IMenuListener) IOpenListener(org.eclipse.jface.viewers.IOpenListener) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) ConfigureColumnsAction(org.talend.designer.runtime.visualization.internal.actions.ConfigureColumnsAction) FocusListener(org.eclipse.swt.events.FocusListener) Separator(org.eclipse.jface.action.Separator) OpenEvent(org.eclipse.jface.viewers.OpenEvent)

Aggregations

IMenuListener (org.eclipse.jface.action.IMenuListener)4 IMenuManager (org.eclipse.jface.action.IMenuManager)4 MenuManager (org.eclipse.jface.action.MenuManager)4 Separator (org.eclipse.jface.action.Separator)4 Menu (org.eclipse.swt.widgets.Menu)4 ConfigureColumnsAction (org.talend.designer.runtime.visualization.internal.actions.ConfigureColumnsAction)4 CopyAction (org.talend.designer.runtime.visualization.internal.actions.CopyAction)3 Action (org.eclipse.jface.action.Action)1 IOpenListener (org.eclipse.jface.viewers.IOpenListener)1 OpenEvent (org.eclipse.jface.viewers.OpenEvent)1 FocusEvent (org.eclipse.swt.events.FocusEvent)1 FocusListener (org.eclipse.swt.events.FocusListener)1 OpenDeclarationAction (org.talend.designer.runtime.visualization.internal.actions.OpenDeclarationAction)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