use of org.eclipse.jface.action.IMenuListener in project netxms by netxms.
the class PackageManager method createPopupMenu.
/**
* Create pop-up menu
*/
private void createPopupMenu() {
// Create menu manager.
MenuManager menuMgr = new MenuManager();
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager mgr) {
fillContextMenu(mgr);
}
});
// Create menu.
Menu menu = menuMgr.createContextMenu(viewer.getControl());
viewer.getControl().setMenu(menu);
// Register menu for extension.
getSite().registerContextMenu(menuMgr, viewer);
}
use of org.eclipse.jface.action.IMenuListener in project netxms by netxms.
the class ServerStoredAgentConfigEditorView method createPopupMenu.
/**
* Create pop-up menu for user list
*/
private void createPopupMenu() {
// Create menu manager
MenuManager menuMgr = new MenuManager();
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager mgr) {
mgr.add(actionMoveUp);
mgr.add(actionMoveDown);
mgr.add(new Separator());
mgr.add(actionDelete);
}
});
// Create menu
Menu menu = menuMgr.createContextMenu(configList.getControl());
configList.getControl().setMenu(menu);
// Register menu for extension.
getSite().registerContextMenu(menuMgr, configList);
}
use of org.eclipse.jface.action.IMenuListener in project netxms by netxms.
the class AlarmList method createPopupMenu.
/**
* Create pop-up menu for alarm list
*/
private void createPopupMenu() {
// Create menu manager.
MenuManager menuMgr = new FilteringMenuManager(Activator.PLUGIN_ID);
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager mgr) {
fillContextMenu(mgr);
}
});
// Create menu.
Menu menu = menuMgr.createContextMenu(alarmViewer.getControl());
alarmViewer.getControl().setMenu(menu);
// Register menu for extension.
if (viewPart != null)
viewPart.getSite().registerContextMenu(menuMgr, alarmViewer);
}
use of org.eclipse.jface.action.IMenuListener in project netxms by netxms.
the class ScriptingConsole method createPopupMenu.
/**
* Create pop-up menu
*/
private void createPopupMenu() {
// Create menu manager
MenuManager menuMgr = new MenuManager();
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager mgr) {
fillContextMenu(mgr);
}
});
// Create menu
Menu menu = menuMgr.createContextMenu(viewer.getControl());
viewer.getControl().setMenu(menu);
}
use of org.eclipse.jface.action.IMenuListener in project netxms by netxms.
the class RackDiagramElement method createPopupMenu.
/**
* Create pop-up menu
*/
private void createPopupMenu() {
// Create menu manager.
MenuManager menuMgr = new MenuManager();
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager mgr) {
fillContextMenu(mgr);
}
});
// Create menu.
if (rackFrontWidget != null) {
Menu menu = menuMgr.createContextMenu(rackFrontWidget);
rackFrontWidget.setMenu(menu);
}
if (rackRearWidget != null) {
Menu menu = menuMgr.createContextMenu(rackRearWidget);
rackRearWidget.setMenu(menu);
}
// Register menu for extension.
viewPart.getSite().registerContextMenu(menuMgr, this);
}
Aggregations