use of org.eclipse.jface.action.MenuManager in project tdi-studio-se by Talend.
the class ProblemsView method initMenu.
/**
* initialize the Menu of problem view.
*
* @param menuManager
*/
private void initMenu(IMenuManager menu) {
// MenuManager groupByMenu = new MenuManager(MarkerMessages.ProblemView_GroupByMenu);
//$NON-NLS-1$
MenuManager groupByMenu = new MenuManager(Messages.getString("MarkerMessages.ProblemView_GroupByMenu"));
// groupByMenu.add(new GroupingAction(MarkerMessages.ProblemView_Type, Group.TYPE, this));
//$NON-NLS-1$
groupByMenu.add(new GroupingAction(Messages.getString("MarkerMessages.ProblemView_Type"), Group.TYPE, this));
//$NON-NLS-1$
groupByMenu.add(new GroupingAction(Messages.getString("ProblemsView.severity"), Group.SEVERITY, this));
// groupByMenu.add(new GroupingAction(MarkerMessages.ProblemView_None, Group.NONE, this));
//$NON-NLS-1$
groupByMenu.add(new GroupingAction(Messages.getString("MarkerMessages.ProblemView_None"), Group.NONE, this));
menu.add(groupByMenu);
}
use of org.eclipse.jface.action.MenuManager in project tdi-studio-se by Talend.
the class AbstractFilteredTree method createContextMenu.
/**
* Creates the context menu.
*/
protected void createContextMenu() {
// create actions
openAction = OpenDeclarationAction.createOpenDeclarationAction(actionBars);
copyAction = (CopyAction) actionBars.getGlobalActionHandler(ActionFactory.COPY.getId());
findAction = (FindAction) actionBars.getGlobalActionHandler(ActionFactory.FIND.getId());
focusOnFrameAction = new FocusOnAction(this);
showCallersCalleesAction = new ShowCallersCalleesAction(getViewer());
configureColumnsAction = new ConfigureColumnsAction(this);
// create menu manager
//$NON-NLS-1$
MenuManager menuMgr = new MenuManager("#PopupMenu");
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
@Override
public void menuAboutToShow(IMenuManager manager) {
focusOnFrameAction.aboutToShow();
manager.add(openAction);
manager.add(new Separator());
manager.add(copyAction);
manager.add(findAction);
manager.add(focusOnFrameAction);
manager.add(showCallersCalleesAction);
manager.add(new Separator());
manager.add(configureColumnsAction);
addMenus(manager);
}
});
// create context menu
Menu menu = menuMgr.createContextMenu(getViewer().getControl());
getViewer().getControl().setMenu(menu);
}
use of org.eclipse.jface.action.MenuManager in project tdi-studio-se by Talend.
the class OperationsTab method createContextMenu.
/**
* Creates the context menu.
*/
private void createContextMenu() {
// create actions
invokeAction = new InvokeAction(tableViewer, section);
tableViewer.addSelectionChangedListener(invokeAction);
// create menu manager
//$NON-NLS-1$
MenuManager menuMgr = new MenuManager("#PopupMenu");
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
@Override
public void menuAboutToShow(IMenuManager manager) {
manager.add(invokeAction);
}
});
// create context menu
Menu menu = menuMgr.createContextMenu(tableViewer.getControl());
tableViewer.getControl().setMenu(menu);
}
use of org.eclipse.jface.action.MenuManager in project tdi-studio-se by Talend.
the class JobHierarchyViewer method initContextMenu.
/**
* Attaches a contextmenu listener to the tree
*
* @param menuListener the menu listener
* @param popupId the popup id
* @param viewSite the view site
*/
public void initContextMenu(IMenuListener menuListener, IWorkbenchPartSite viewSite) {
//$NON-NLS-1$
String popupId = "JobHierarchyViewer_ContextMenu";
MenuManager menuMgr = new MenuManager();
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(menuListener);
Menu menu = menuMgr.createContextMenu(getTree());
getTree().setMenu(menu);
viewSite.registerContextMenu(popupId, menuMgr, this);
}
use of org.eclipse.jface.action.MenuManager in project tdi-studio-se by Talend.
the class JobHierarchyViewPart method createMethodViewerControl.
private Control createMethodViewerControl(Composite parent) {
dependencyViewer = new TableViewer(parent);
DependencyViewerProvider provider = new DependencyViewerProvider(this.fHierarchyLifeCycle);
dependencyViewer.setContentProvider(provider);
dependencyViewer.setLabelProvider(provider);
Control control = dependencyViewer.getTable();
//$NON-NLS-1$
String popupId = "DependencyViewer_ContextMenu";
MenuManager menuMgr = new MenuManager();
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager menu) {
fillDependencyViewerContextMenu(menu);
}
});
Menu menu = menuMgr.createContextMenu(control);
control.setMenu(menu);
getSite().registerContextMenu(popupId, menuMgr, dependencyViewer);
return control;
}
Aggregations