use of org.eclipse.jface.action.IMenuListener in project netxms by netxms.
the class SwitchForwardingDatabaseView 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 WirelessStations 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 eclipse-integration-commons by spring-projects.
the class QuickSearchDialog method createPopupMenu.
private void createPopupMenu() {
// removeHistoryItemAction = new RemoveHistoryItemAction();
// removeHistoryActionContributionItem = new ActionContributionItem(
// removeHistoryItemAction);
contextMenuManager = new MenuManager();
contextMenuManager.setRemoveAllWhenShown(true);
contextMenuManager.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager manager) {
fillContextMenu(manager);
}
});
final Table table = list.getTable();
Menu menu = contextMenuManager.createContextMenu(table);
table.setMenu(menu);
}
use of org.eclipse.jface.action.IMenuListener in project webtools.sourceediting by eclipse.
the class DTDContentOutlineConfiguration method getMenuListener.
/*
* (non-Javadoc)
*
* @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getMenuListener(org.eclipse.jface.viewers.TreeViewer)
*/
public IMenuListener getMenuListener(TreeViewer viewer) {
IMenuListener listener = null;
if (fMenuHelper == null && viewer.getInput() instanceof DTDModelImpl) {
fMenuHelper = new DTDContextMenuHelper((DTDModelImpl) viewer.getInput());
fMenuHelper.createMenuListenersFor(viewer);
}
if (fMenuHelper != null) {
listener = fMenuHelper.getMenuListener();
}
return listener;
}
use of org.eclipse.jface.action.IMenuListener in project azure-tools-for-java by Microsoft.
the class BlobExplorerFileEditor method createTablePopup.
private void createTablePopup(Composite composite) {
MenuManager menuMgr = new MenuManager("#PopupMenu");
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager manager) {
if (tableViewer.getSelection().isEmpty() || getFileSelection() == null) {
return;
}
if (tableViewer.getSelection() instanceof IStructuredSelection) {
manager.add(fileEditorVirtualNode.createPopupAction(COPY_URL));
manager.add(fileEditorVirtualNode.createPopupAction(SAVE_AS));
manager.add(fileEditorVirtualNode.createPopupAction(DELETE));
}
}
});
Menu menu = menuMgr.createContextMenu(tableViewer.getControl());
tableViewer.getControl().setMenu(menu);
}
Aggregations