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);
}
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);
}
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);
}
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);
}
}
}
}
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));
}
Aggregations