use of org.netxms.ui.eclipse.tools.FilteringMenuManager 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.netxms.ui.eclipse.tools.FilteringMenuManager in project netxms by netxms.
the class AbstractNetworkMapView method createPopupMenu.
/**
* Create popup menu for map
*/
private void createPopupMenu() {
// Create menu manager.
MenuManager menuMgr = new FilteringMenuManager(Activator.PLUGIN_ID);
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager manager) {
int selType = analyzeSelection(currentSelection);
switch(selType) {
case SELECTION_EMPTY:
fillMapContextMenu(manager);
break;
case SELECTION_OBJECTS:
fillObjectContextMenu(manager);
break;
case SELECTION_ELEMENTS:
fillElementContextMenu(manager);
break;
case SELECTION_LINKS:
fillLinkContextMenu(manager);
break;
}
}
});
// Create menu.
Menu menu = menuMgr.createContextMenu(viewer.getControl());
viewer.getControl().setMenu(menu);
// Register menu for extension.
getSite().registerContextMenu(menuMgr, this);
}
use of org.netxms.ui.eclipse.tools.FilteringMenuManager in project netxms by netxms.
the class ObjectFinder method createResultsContextMenu.
/**
* Create context menu for results
*/
private void createResultsContextMenu() {
// Create menu manager.
MenuManager manager = new FilteringMenuManager(Activator.PLUGIN_ID);
manager.setRemoveAllWhenShown(true);
manager.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager mgr) {
ObjectContextMenu.fill(mgr, getSite(), results);
if (((IStructuredSelection) results.getSelection()).size() == 1) {
mgr.insertAfter(GroupMarkers.MB_PROPERTIES, actionShowObjectDetails);
}
}
});
// Create menu.
Menu menu = manager.createContextMenu(results.getTable());
results.getTable().setMenu(menu);
// Register menu for extension.
getSite().registerContextMenu(manager, results);
}
use of org.netxms.ui.eclipse.tools.FilteringMenuManager in project netxms by netxms.
the class ObjectBrowser method createPopupMenu.
/**
* Create popup menu for object browser
*/
private void createPopupMenu() {
// Create menu manager.
MenuManager manager = new FilteringMenuManager(Activator.PLUGIN_ID);
manager.setRemoveAllWhenShown(true);
manager.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager mgr) {
fillContextMenu(mgr);
}
});
// Create menu.
Menu menu = manager.createContextMenu(objectTree.getTreeControl());
objectTree.getTreeControl().setMenu(menu);
// Register menu for extension.
getSite().registerContextMenu(manager, objectTree.getTreeViewer());
}
Aggregations