Search in sources :

Example 91 with GroupMarker

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

the class UserManagementView method fillContextMenu.

/**
 * Fill context menu
 *
 * @param mgr Menu manager
 */
protected void fillContextMenu(final IMenuManager mgr) {
    final IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
    mgr.add(actionAddUser);
    mgr.add(actionAddGroup);
    mgr.add(new Separator());
    boolean containDisabled = false;
    boolean containEnabled = false;
    boolean containLDAP = false;
    for (Object object : selection.toList()) {
        if (((AbstractUserObject) object).isDisabled())
            containDisabled = true;
        if (!((AbstractUserObject) object).isDisabled())
            containEnabled = true;
        if ((((AbstractUserObject) object).getFlags() & AbstractUserObject.LDAP_USER) != 0)
            containLDAP = true;
    }
    if (containDisabled)
        mgr.add(actionEnable);
    if (containEnabled)
        mgr.add(actionDisable);
    if (containLDAP)
        mgr.add(actionDetachUserFromLDAP);
    final Object firstElement = selection.getFirstElement();
    if (firstElement instanceof User && !containLDAP) {
        mgr.add(actionChangePassword);
    }
    mgr.add(actionDeleteUser);
    mgr.add(new Separator());
    mgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    mgr.add(new Separator());
    mgr.add(actionEditUser);
}
Also used : User(org.netxms.client.users.User) AbstractUserObject(org.netxms.client.users.AbstractUserObject) AbstractUserObject(org.netxms.client.users.AbstractUserObject) GroupMarker(org.eclipse.jface.action.GroupMarker) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) Separator(org.eclipse.jface.action.Separator)

Example 92 with GroupMarker

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

the class ApplicationActionBarAdvisor method fillMenuBar.

/* (non-Javadoc)
	 * @see org.eclipse.ui.application.ActionBarAdvisor#fillMenuBar(org.eclipse.jface.action.IMenuManager)
	 */
@Override
protected void fillMenuBar(IMenuManager menuBar) {
    MenuManager fileMenu = new MenuManager(Messages.get().ApplicationActionBarAdvisor_File, IWorkbenchActionConstants.M_FILE);
    MenuManager viewMenu = new MenuManager(Messages.get().ApplicationActionBarAdvisor_View, GroupMarkers.M_VIEW);
    MenuManager monitorMenu = new MenuManager(Messages.get().ApplicationActionBarAdvisor_Monitor, GroupMarkers.M_MONITOR);
    MenuManager configMenu = new MenuManager(Messages.get().ApplicationActionBarAdvisor_Configuration, GroupMarkers.M_CONFIG);
    MenuManager toolsMenu = new MenuManager(Messages.get().ApplicationActionBarAdvisor_Tools, GroupMarkers.M_TOOLS);
    MenuManager windowMenu = new MenuManager(Messages.get().ApplicationActionBarAdvisor_Window, IWorkbenchActionConstants.M_WINDOW);
    MenuManager helpMenu = new MenuManager(Messages.get().ApplicationActionBarAdvisor_Help, IWorkbenchActionConstants.M_HELP);
    menuBar.add(fileMenu);
    menuBar.add(viewMenu);
    menuBar.add(monitorMenu);
    menuBar.add(configMenu);
    menuBar.add(toolsMenu);
    // Add a group marker indicating where action set menus will appear.
    menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    if (// $NON-NLS-1$
    !Activator.getDefault().getPreferenceStore().getBoolean("HIDE_WINDOW_MENU"))
        menuBar.add(windowMenu);
    menuBar.add(helpMenu);
    // File
    fileMenu.add(actionShowPreferences);
    fileMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    fileMenu.add(new Separator());
    fileMenu.add(actionExit);
    // View
    viewMenu.add(new GroupMarker(GroupMarkers.M_PRODUCT_VIEW));
    viewMenu.add(new Separator());
    viewMenu.add(new GroupMarker(GroupMarkers.M_PRIMARY_VIEW));
    viewMenu.add(new Separator());
    viewMenu.add(new GroupMarker(GroupMarkers.M_LOGS_VIEW));
    viewMenu.add(new Separator());
    viewMenu.add(actionOpenProgressView);
    viewMenu.add(new GroupMarker(GroupMarkers.M_TOOL_VIEW));
    // Monitor
    monitorMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    // Tools
    toolsMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    // Window
    // $NON-NLS-1$
    MenuManager openPerspectiveMenuMgr = new MenuManager(Messages.get().ApplicationActionBarAdvisor_OpenPerspective, "openPerspective");
    openPerspectiveMenuMgr.add(contribItemOpenPerspective);
    windowMenu.add(openPerspectiveMenuMgr);
    // $NON-NLS-1$
    final MenuManager showViewMenuMgr = new MenuManager(Messages.get().ApplicationActionBarAdvisor_ShowView, "showView");
    showViewMenuMgr.add(contribItemShowView);
    windowMenu.add(showViewMenuMgr);
    windowMenu.add(new Separator());
    windowMenu.add(actionCustomizePerspective);
    windowMenu.add(actionSavePerspective);
    windowMenu.add(actionResetPerspective);
    windowMenu.add(actionClosePerspective);
    windowMenu.add(actionCloseAllPerspectives);
    windowMenu.add(new Separator());
    final MenuManager navMenu = new MenuManager(Messages.get().ApplicationActionBarAdvisor_Navigation, IWorkbenchActionConstants.M_NAVIGATE);
    windowMenu.add(navMenu);
    navMenu.add(actionShowViewMenu);
    navMenu.add(new Separator());
    navMenu.add(actionMaximize);
    navMenu.add(actionMinimize);
    navMenu.add(actionClose);
    navMenu.add(new Separator());
    navMenu.add(actionNextView);
    navMenu.add(actionPrevView);
    // Help
    helpMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    helpMenu.add(actionAbout);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) GroupMarker(org.eclipse.jface.action.GroupMarker) Separator(org.eclipse.jface.action.Separator)

Example 93 with GroupMarker

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

the class ActionManager method fillContextMenu.

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

Example 94 with GroupMarker

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

the class AlarmList method fillContextMenu.

/**
 * Fill context menu
 *
 * @param mgr Menu manager
 */
protected void fillContextMenu(IMenuManager manager) {
    IStructuredSelection selection = (IStructuredSelection) alarmViewer.getSelection();
    if (selection.size() == 0)
        return;
    int states = getSelectionType(selection.toArray());
    if (states == 2) {
        manager.add(actionAcknowledge);
        manager.add(actionStickyAcknowledge);
        if (session.isTimedAlarmAckEnabled()) {
            initializeTimeAcknowledge();
            // $NON-NLS-1$
            timeAcknowledgeMenu = new MenuManager(Messages.get().AlarmList_StickyAckMenutTitle, "timeAcknowledge");
            for (Action act : timeAcknowledge) {
                timeAcknowledgeMenu.add(act);
            }
            timeAcknowledgeMenu.add(new Separator());
            timeAcknowledgeMenu.add(timeAcknowledgeOther);
            manager.add(timeAcknowledgeMenu);
        }
    }
    if (states < 4)
        manager.add(actionResolve);
    if (states == 4 || !session.isStrictAlarmStatusFlow())
        manager.add(actionTerminate);
    manager.add(new Separator());
    manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    manager.add(new Separator());
    if (selection.size() == 1) {
        manager.add(new GroupMarker(GroupMarkers.MB_OBJECT_TOOLS));
        manager.add(new Separator());
        manager.add(actionShowObjectDetails);
        manager.add(new Separator());
    }
    manager.add(actionExportToCsv);
    if (selection.size() == 1) {
        manager.add(new Separator());
        manager.add(actionShowAlarmDetails);
        manager.add(actionComments);
        if (session.isHelpdeskLinkActive()) {
            manager.add(new Separator());
            if (((Alarm) selection.getFirstElement()).getHelpdeskState() == Alarm.HELPDESK_STATE_IGNORED) {
                manager.add(actionCreateIssue);
            } else {
                manager.add(actionShowIssue);
                if ((session.getUserSystemRights() & UserAccessRights.SYSTEM_ACCESS_UNLINK_ISSUES) != 0)
                    manager.add(actionUnlinkIssue);
            }
        }
    }
}
Also used : IAction(org.eclipse.jface.action.IAction) ExportToCsvAction(org.netxms.ui.eclipse.actions.ExportToCsvAction) Action(org.eclipse.jface.action.Action) MenuManager(org.eclipse.jface.action.MenuManager) FilteringMenuManager(org.netxms.ui.eclipse.tools.FilteringMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) GroupMarker(org.eclipse.jface.action.GroupMarker) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) Separator(org.eclipse.jface.action.Separator)

Example 95 with GroupMarker

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

the class PackageManager method fillContextMenu.

/**
 * Fill context menu
 * @param manager Menu manager
 */
protected void fillContextMenu(IMenuManager manager) {
    manager.add(actionDeploy);
    manager.add(actionRemove);
    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)

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