Search in sources :

Example 6 with MenuManager

use of org.eclipse.jface.action.MenuManager in project tdi-studio-se by Talend.

the class ProblemsView method initMenu.

/**
     * initialize the Menu of problem view.
     * 
     * @param menuManager
     */
private void initMenu(IMenuManager menu) {
    // MenuManager groupByMenu = new MenuManager(MarkerMessages.ProblemView_GroupByMenu);
    //$NON-NLS-1$
    MenuManager groupByMenu = new MenuManager(Messages.getString("MarkerMessages.ProblemView_GroupByMenu"));
    // groupByMenu.add(new GroupingAction(MarkerMessages.ProblemView_Type, Group.TYPE, this));
    //$NON-NLS-1$
    groupByMenu.add(new GroupingAction(Messages.getString("MarkerMessages.ProblemView_Type"), Group.TYPE, this));
    //$NON-NLS-1$
    groupByMenu.add(new GroupingAction(Messages.getString("ProblemsView.severity"), Group.SEVERITY, this));
    // groupByMenu.add(new GroupingAction(MarkerMessages.ProblemView_None, Group.NONE, this));
    //$NON-NLS-1$
    groupByMenu.add(new GroupingAction(Messages.getString("MarkerMessages.ProblemView_None"), Group.NONE, this));
    menu.add(groupByMenu);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager)

Example 7 with MenuManager

use of org.eclipse.jface.action.MenuManager 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 8 with MenuManager

use of org.eclipse.jface.action.MenuManager in project tdi-studio-se by Talend.

the class OperationsTab method createContextMenu.

/**
     * Creates the context menu.
     */
private void createContextMenu() {
    // create actions
    invokeAction = new InvokeAction(tableViewer, section);
    tableViewer.addSelectionChangedListener(invokeAction);
    // create menu manager
    //$NON-NLS-1$
    MenuManager menuMgr = new MenuManager("#PopupMenu");
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        @Override
        public void menuAboutToShow(IMenuManager manager) {
            manager.add(invokeAction);
        }
    });
    // create context menu
    Menu menu = menuMgr.createContextMenu(tableViewer.getControl());
    tableViewer.getControl().setMenu(menu);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) IMenuListener(org.eclipse.jface.action.IMenuListener)

Example 9 with MenuManager

use of org.eclipse.jface.action.MenuManager in project tdi-studio-se by Talend.

the class JobHierarchyViewer method initContextMenu.

/**
     * Attaches a contextmenu listener to the tree
     * 
     * @param menuListener the menu listener
     * @param popupId the popup id
     * @param viewSite the view site
     */
public void initContextMenu(IMenuListener menuListener, IWorkbenchPartSite viewSite) {
    //$NON-NLS-1$
    String popupId = "JobHierarchyViewer_ContextMenu";
    MenuManager menuMgr = new MenuManager();
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(menuListener);
    Menu menu = menuMgr.createContextMenu(getTree());
    getTree().setMenu(menu);
    viewSite.registerContextMenu(popupId, menuMgr, this);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) Menu(org.eclipse.swt.widgets.Menu)

Example 10 with MenuManager

use of org.eclipse.jface.action.MenuManager in project tdi-studio-se by Talend.

the class JobHierarchyViewPart method createMethodViewerControl.

private Control createMethodViewerControl(Composite parent) {
    dependencyViewer = new TableViewer(parent);
    DependencyViewerProvider provider = new DependencyViewerProvider(this.fHierarchyLifeCycle);
    dependencyViewer.setContentProvider(provider);
    dependencyViewer.setLabelProvider(provider);
    Control control = dependencyViewer.getTable();
    //$NON-NLS-1$
    String popupId = "DependencyViewer_ContextMenu";
    MenuManager menuMgr = new MenuManager();
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        public void menuAboutToShow(IMenuManager menu) {
            fillDependencyViewerContextMenu(menu);
        }
    });
    Menu menu = menuMgr.createContextMenu(control);
    control.setMenu(menu);
    getSite().registerContextMenu(popupId, menuMgr, dependencyViewer);
    return control;
}
Also used : Control(org.eclipse.swt.widgets.Control) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) TableViewer(org.eclipse.jface.viewers.TableViewer) IMenuListener(org.eclipse.jface.action.IMenuListener)

Aggregations

MenuManager (org.eclipse.jface.action.MenuManager)657 IMenuManager (org.eclipse.jface.action.IMenuManager)498 Menu (org.eclipse.swt.widgets.Menu)303 IMenuListener (org.eclipse.jface.action.IMenuListener)246 Separator (org.eclipse.jface.action.Separator)220 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)65 Point (org.eclipse.swt.graphics.Point)63 Action (org.eclipse.jface.action.Action)55 Composite (org.eclipse.swt.widgets.Composite)49 IAction (org.eclipse.jface.action.IAction)48 SelectionEvent (org.eclipse.swt.events.SelectionEvent)44 GridData (org.eclipse.swt.layout.GridData)44 GroupMarker (org.eclipse.jface.action.GroupMarker)43 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)43 Transfer (org.eclipse.swt.dnd.Transfer)35 GridLayout (org.eclipse.swt.layout.GridLayout)32 List (java.util.List)30 EditingDomainViewerDropAdapter (org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter)30 LocalTransfer (org.eclipse.emf.edit.ui.dnd.LocalTransfer)30 ViewerDragAdapter (org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter)30