Search in sources :

Example 81 with Separator

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

the class StackTraceViewer method createContextMenu.

/**
     * Creates the context menu.
     * 
     * @param actionBars The action bars
     */
private void createContextMenu(IActionBars actionBars) {
    // create actions
    openAction = OpenDeclarationAction.createOpenDeclarationAction(actionBars);
    copyAction = CopyAction.createCopyAction(actionBars);
    // 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(openAction);
            manager.add(new Separator());
            manager.add(copyAction);
        }
    });
    // create context menu
    Menu menu = menuMgr.createContextMenu(getControl());
    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) Separator(org.eclipse.jface.action.Separator)

Example 82 with Separator

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

the class MultiPageEditorContributor method contributeToMenu.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToMenu(org.eclipse.jface.action.IMenuManager)
     */
@Override
public void contributeToMenu(final IMenuManager menubar) {
    super.contributeToMenu(menubar);
    //$NON-NLS-1$
    MenuManager viewMenu = new MenuManager(Messages.getString("MultiPageEditorContributor.View"));
    viewMenu.add(getAction(GEFActionConstants.ZOOM_IN));
    viewMenu.add(getAction(GEFActionConstants.ZOOM_OUT));
    viewMenu.add(new Separator());
    viewMenu.add(getAction(GEFActionConstants.TOGGLE_GRID_VISIBILITY));
    viewMenu.add(getAction(GEFActionConstants.TOGGLE_SNAP_TO_GEOMETRY));
    menubar.insertAfter(IWorkbenchActionConstants.M_EDIT, viewMenu);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) Separator(org.eclipse.jface.action.Separator)

Example 83 with Separator

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

the class HL7OutputUI method fillContextMenu.

/**
     * Comment method "fillContextMenu".
     *
     * @param manager
     */
protected void fillContextMenu(IMenuManager manager) {
    if (!xmlViewer.getSelection().isEmpty()) {
        manager.add(createAction);
        createAction.init();
        manager.add(new Separator());
        manager.add(deleteAction);
        deleteAction.init();
        manager.add(disconnectAction);
        disconnectAction.init();
        manager.add(fixValueAction);
        fixValueAction.init();
        manager.add(new Separator());
        manager.add(setRepetableAction);
        setRepetableAction.init();
        manager.add(importAction);
        importAction.init();
    }
}
Also used : Separator(org.eclipse.jface.action.Separator)

Example 84 with Separator

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

the class JvmTreeViewer method configureMenus.

/**
     * Configures the menus.
     * 
     * @param manager The menu manager
     */
void configureMenus(IMenuManager manager) {
    if (startMonitoringAction.getVisible()) {
        manager.add(startMonitoringAction);
    }
    if (stopMonitoringAction.getVisible()) {
        manager.add(stopMonitoringAction);
        manager.add(new Separator());
    }
    if (openSnapshotAction.getVisible()) {
        manager.add(openSnapshotAction);
        manager.add(new Separator());
    }
    manager.add(copyAction);
    manager.add(deleteAction);
    manager.add(renameAction);
}
Also used : Separator(org.eclipse.jface.action.Separator)

Example 85 with Separator

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

the class DataSetTableActionGroup method fillContextMenu.

/**
     * Fill the context menu with all the correct actions.
     * @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager)
     */
public void fillContextMenu(IMenuManager menu) {
    IExtensionRegistry registry = Platform.getExtensionRegistry();
    //$NON-NLS-1$ //$NON-NLS-2$
    IExtensionPoint point = registry.getExtensionPoint("net.sourceforge.sqlexplorer", "dataSetTableContextAction");
    IExtension[] extensions = point.getExtensions();
    for (int i = 0; i < extensions.length; i++) {
        IExtension e = extensions[i];
        IConfigurationElement[] ces = e.getConfigurationElements();
        for (int j = 0; j < ces.length; j++) {
            try {
                //$NON-NLS-1$
                String group = ces[j].getAttribute("group");
                if (group == null || !group.equalsIgnoreCase("export")) {
                    //$NON-NLS-1$
                    // check if the action thinks it is suitable..
                    AbstractDataSetTableContextAction action = (AbstractDataSetTableContextAction) ces[j].createExecutableExtension(//$NON-NLS-1$
                    "class");
                    action.setTable(ptable);
                    action.setTableCursor(pcursor);
                    if (action.isAvailable()) {
                        menu.add(action);
                    }
                }
            } catch (Throwable ex) {
                //$NON-NLS-1$
                SqlBuilderPlugin.log(Messages.getString("DataSetTableActionGroup.logMessage1"), ex);
            }
        }
    }
    menu.add(new Separator());
    // add export options
    //$NON-NLS-1$
    MenuManager subMenu = new MenuManager(Messages.getString("DataSetTable.Actions.ExportSubMenu"));
    for (int i = 0; i < extensions.length; i++) {
        IExtension e = extensions[i];
        IConfigurationElement[] ces = e.getConfigurationElements();
        for (int j = 0; j < ces.length; j++) {
            try {
                //$NON-NLS-1$
                String group = ces[j].getAttribute("group");
                if (group != null && group.equalsIgnoreCase("export")) {
                    //$NON-NLS-1$
                    // check if the action thinks it is suitable..
                    AbstractDataSetTableContextAction action = (AbstractDataSetTableContextAction) ces[j].createExecutableExtension(//$NON-NLS-1$
                    "class");
                    action.setTable(ptable);
                    action.setTableCursor(pcursor);
                    if (action.isAvailable()) {
                        subMenu.add(action);
                    }
                }
            } catch (Throwable ex) {
                //$NON-NLS-1$
                SqlBuilderPlugin.log(Messages.getString("DataSetTableActionGroup.logMessage1"), ex);
            }
        }
    }
    menu.add(subMenu);
    menu.add(new Separator());
    menu.add(pcopyTableAction);
}
Also used : IExtensionPoint(org.eclipse.core.runtime.IExtensionPoint) IExtension(org.eclipse.core.runtime.IExtension) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) AbstractDataSetTableContextAction(org.talend.sqlbuilder.dataset.actions.AbstractDataSetTableContextAction) IConfigurationElement(org.eclipse.core.runtime.IConfigurationElement) IExtensionPoint(org.eclipse.core.runtime.IExtensionPoint) Separator(org.eclipse.jface.action.Separator) IExtensionRegistry(org.eclipse.core.runtime.IExtensionRegistry)

Aggregations

Separator (org.eclipse.jface.action.Separator)89 MenuManager (org.eclipse.jface.action.MenuManager)39 IMenuManager (org.eclipse.jface.action.IMenuManager)37 IAction (org.eclipse.jface.action.IAction)14 Menu (org.eclipse.swt.widgets.Menu)10 Action (org.eclipse.jface.action.Action)9 IMenuListener (org.eclipse.jface.action.IMenuListener)9 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)9 ActionManager (com.cubrid.common.ui.spi.action.ActionManager)7 IToolBarManager (org.eclipse.jface.action.IToolBarManager)7 ActionContributionItem (org.eclipse.jface.action.ActionContributionItem)6 GroupMarker (org.eclipse.jface.action.GroupMarker)6 IContributionManager (org.eclipse.jface.action.IContributionManager)5 TreeViewer (org.eclipse.jface.viewers.TreeViewer)5 IActionBars (org.eclipse.ui.IActionBars)5 DBAServerSession (org.jkiss.dbeaver.model.admin.sessions.DBAServerSession)5 DBAServerSessionManager (org.jkiss.dbeaver.model.admin.sessions.DBAServerSessionManager)5 SessionManagerViewer (org.jkiss.dbeaver.ui.views.session.SessionManagerViewer)5 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)4 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)4