Search in sources :

Example 51 with GroupMarker

use of org.eclipse.jface.action.GroupMarker in project netxms by netxms.

the class WirelessStations method fillContextMenu.

/**
 * Fill context menu
 * @param mgr Menu manager
 */
protected void fillContextMenu(IMenuManager manager) {
    manager.add(actionExportToCsv);
    manager.add(new Separator());
    manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}
Also used : GroupMarker(org.eclipse.jface.action.GroupMarker) Separator(org.eclipse.jface.action.Separator)

Example 52 with GroupMarker

use of org.eclipse.jface.action.GroupMarker in project netxms by netxms.

the class RoutingTableView method fillContextMenu.

/**
 * Fill context menu
 * @param mgr Menu manager
 */
protected void fillContextMenu(IMenuManager manager) {
    manager.add(actionExportToCsv);
    manager.add(new Separator());
    manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}
Also used : GroupMarker(org.eclipse.jface.action.GroupMarker) Separator(org.eclipse.jface.action.Separator)

Example 53 with GroupMarker

use of org.eclipse.jface.action.GroupMarker in project netxms by netxms.

the class RadioInterfaces method fillContextMenu.

/**
 * Fill context menu
 * @param mgr Menu manager
 */
protected void fillContextMenu(IMenuManager manager) {
    manager.add(actionExportToCsv);
    manager.add(new Separator());
    manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}
Also used : GroupMarker(org.eclipse.jface.action.GroupMarker) Separator(org.eclipse.jface.action.Separator)

Example 54 with GroupMarker

use of org.eclipse.jface.action.GroupMarker in project netxms by netxms.

the class VlanView method fillContextMenu.

/**
 * Fill context menu
 * @param mgr Menu manager
 */
protected void fillContextMenu(IMenuManager manager) {
    manager.add(actionShowVlanMap);
    manager.add(actionExportToCsv);
    manager.add(new Separator());
    manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}
Also used : GroupMarker(org.eclipse.jface.action.GroupMarker) Separator(org.eclipse.jface.action.Separator)

Example 55 with GroupMarker

use of org.eclipse.jface.action.GroupMarker in project webtools.sourceediting by eclipse.

the class JsMenuListener method menuAboutToShow.

// private IWorkbenchSite getWorkbenchSite() {
// return InternalHandlerUtil.getActiveSite(fTreeViewer);
// }
public void menuAboutToShow(IMenuManager manager) {
    ISelection selection = fTreeViewer.getSelection();
    if (selection instanceof TreeSelection) {
        TreeSelection tselect = (TreeSelection) selection;
        Object[] elements = tselect.toArray();
        int javaCount = 0;
        for (int i = 0; i < elements.length; i++) {
            if (elements[i] instanceof IJavaWebNode) {
                javaCount++;
            }
        }
        // menu.add(new Separator(IContextMenuConstants.GROUP_PROPERTIES));
        if (javaCount == elements.length && javaCount != 0) {
            // see plugin.xml for object contributions that populate these
            // menus
            /*
				 * Menu for:
				 * 
				 * Open Type Hierarchy Open Call Hierarchy Show In--> Script
				 * Explorer Navigator
				 */
            manager.add(new Separator(IContextMenuConstants.GROUP_SHOW));
            manager.add(new GroupMarker(IContextMenuConstants.GROUP_SHOW));
            /*
				 * Menu for: Cut Copy Paste Delete
				 */
            manager.add(new Separator(JsMenuListener.EDIT_GROUP_ID));
            manager.add(new GroupMarker(JsMenuListener.EDIT_GROUP_ID));
            /*
				 * Menu for:
				 * 
				 * Source--> Generate Element Comment
				 * 
				 * 
				 * Refactor--> Rename Move Change Function Signature Inline
				 * Introduce Indirection Infer Generic Type Arguments
				 */
            manager.add(new Separator(IContextMenuConstants.GROUP_SOURCE));
            manager.add(new GroupMarker(IContextMenuConstants.GROUP_SOURCE));
            /*
				 * Menu for:
				 * 
				 * Refrences--> Workspace Project Hierarchy Working Set
				 * 
				 * Declerations--> Workspace Project Hierarchy Working Set
				 * 
				 */
            manager.add(new Separator(IContextMenuConstants.GROUP_SEARCH));
            manager.add(new GroupMarker(IContextMenuConstants.GROUP_SEARCH));
        /* all Java Elements */
        // 
        // 
        // 
        // JavaScriptPlugin.createStandardGroups(manager);
        // String[] actionSets = JSDTActionSetUtil.getAllActionSets();
        // 
        // IAction[] actions = JSDTActionSetUtil.getActionsFromSet(actionSets);
        // for(int i = 0;i<actions.length;i++) {
        // manager.add(actions[i]);
        // }
        // fActionGroups.setContext(new ActionContext(selection));
        // fActionGroups.fillContextMenu(manager);
        // 
        } else if (javaCount == 0) {
            fillContextMenu(manager, selection);
        }
    }
}
Also used : TreeSelection(org.eclipse.jface.viewers.TreeSelection) ISelection(org.eclipse.jface.viewers.ISelection) GroupMarker(org.eclipse.jface.action.GroupMarker) IJavaWebNode(org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode) Separator(org.eclipse.jface.action.Separator)

Aggregations

GroupMarker (org.eclipse.jface.action.GroupMarker)117 Separator (org.eclipse.jface.action.Separator)93 IMenuManager (org.eclipse.jface.action.IMenuManager)44 MenuManager (org.eclipse.jface.action.MenuManager)42 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)17 IToolBarManager (org.eclipse.jface.action.IToolBarManager)12 IAction (org.eclipse.jface.action.IAction)10 IMenuListener (org.eclipse.jface.action.IMenuListener)10 Menu (org.eclipse.swt.widgets.Menu)8 Action (org.eclipse.jface.action.Action)7 ISelection (org.eclipse.jface.viewers.ISelection)5 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)5 ActionContributionItem (org.eclipse.jface.action.ActionContributionItem)4 ToolBarContributionItem (org.eclipse.jface.action.ToolBarContributionItem)4 ToolBarManager (org.eclipse.jface.action.ToolBarManager)4 Iterator (java.util.Iterator)2 AddPVAction (org.csstudio.trends.databrowser3.ui.AddPVAction)2 IFindReplaceTarget (org.eclipse.jface.text.IFindReplaceTarget)2 Point (org.eclipse.swt.graphics.Point)2 Shell (org.eclipse.swt.widgets.Shell)2