use of org.eclipse.jface.action.IMenuListener in project netxms by netxms.
the class ServerJobManager 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 CertificateView 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 polymap4-core by Polymap4.
the class CommonNavigatorManager method initContextMenu.
/**
* <p>
* Initializes and registers the context menu.
* </p>
*/
protected void initContextMenu() {
MenuManager menuMgr = new MenuManager(contentService.getViewerDescriptor().getPopupMenuId());
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager manager) {
fillContextMenu(manager);
}
});
TreeViewer commonViewer = commonNavigator.getCommonViewer();
Menu menu = menuMgr.createContextMenu(commonViewer.getTree());
commonViewer.getTree().setMenu(menu);
actionService.prepareMenuForPlatformContributions(menuMgr, commonViewer, false);
}
use of org.eclipse.jface.action.IMenuListener in project netxms by netxms.
the class NodePollerView 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(textArea);
textArea.setMenu(menu);
}
use of org.eclipse.jface.action.IMenuListener in project netxms by netxms.
the class AbstractTraceWidget method createPopupMenu.
/**
* Create viewer's popup 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.
if (viewPart != null) {
viewPart.getSite().registerContextMenu(menuMgr, viewer);
}
}
Aggregations