use of org.eclipse.jface.action.IMenuListener in project netxms by netxms.
the class LogViewer 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) {
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 AgentFileViewer 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.getTextControl());
viewer.getTextControl().setMenu(menu);
}
use of org.eclipse.jface.action.IMenuListener 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.eclipse.jface.action.IMenuListener in project netxms by netxms.
the class ScriptLibrary 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.getTable());
viewer.getTable().setMenu(menu);
}
use of org.eclipse.jface.action.IMenuListener 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);
}
Aggregations