use of org.eclipse.jface.action.Separator in project tdi-studio-se by Talend.
the class HeapHistogramPage method createContextMenu.
/**
* Creates the context menu.
*
* @param actionBars The action bars
*/
private void createContextMenu(IActionBars actionBars) {
final OpenDeclarationAction openAction = OpenDeclarationAction.createOpenDeclarationAction(actionBars);
final CopyAction copyAction = CopyAction.createCopyAction(actionBars);
configureColumnsAction = new ConfigureColumnsAction(this);
heapViewer.addSelectionChangedListener(openAction);
heapViewer.getControl().addFocusListener(new FocusListener() {
@Override
public void focusLost(FocusEvent e) {
heapViewer.removeSelectionChangedListener(copyAction);
}
@Override
public void focusGained(FocusEvent e) {
heapViewer.addSelectionChangedListener(copyAction);
}
});
heapViewer.addOpenListener(new IOpenListener() {
@Override
public void open(OpenEvent event) {
openAction.run();
}
});
//$NON-NLS-1$
MenuManager menuMgr = new MenuManager("#PopupMenu");
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
@Override
public void menuAboutToShow(IMenuManager manager) {
manager.add(openAction);
manager.add(copyAction);
manager.add(new Separator());
manager.add(configureColumnsAction);
}
});
Menu menu = menuMgr.createContextMenu(heapViewer.getControl());
heapViewer.getControl().setMenu(menu);
}
use of org.eclipse.jface.action.Separator in project tdi-studio-se by Talend.
the class ApplicationActionBarAdvisor method fillMenuBar.
protected void fillMenuBar(IMenuManager menuBar) {
MenuManager fileMenu = new MenuManager(Messages.getString("ApplicationActionBarAdvisor.fileMenu"), //$NON-NLS-1$
IWorkbenchActionConstants.M_FILE);
MenuManager windowMenu = new MenuManager(Messages.getString("ApplicationActionBarAdvisor.windowMenu"), //$NON-NLS-1$
IWorkbenchActionConstants.M_WINDOW);
MenuManager helpMenu = new MenuManager(Messages.getString("ApplicationActionBarAdvisor.helpMenu"), //$NON-NLS-1$
IWorkbenchActionConstants.M_HELP);
menuBar.add(fileMenu);
menuBar.add(windowMenu);
// Add a group marker indicating where action set menus will appear.
menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
menuBar.add(helpMenu);
// File
fileMenu.add(new Separator());
fileMenu.add(ActionFactory.SAVE.create(window));
fileMenu.add(exitAction);
// Window
windowMenu.add(preferenceAction);
windowMenu.add(new ShowViewAction());
// Help
helpMenu.add(aboutAction);
}
use of org.eclipse.jface.action.Separator in project tdi-studio-se by Talend.
the class NotificationFilteredTree method createContextMenu.
/**
* Creates the context menu.
*
* @param actionBars The action bars
*/
private void createContextMenu(IActionBars actionBars) {
final CopyAction copyAction = CopyAction.createCopyAction(actionBars);
clearAction = new Action(Messages.clearLabel) {
@Override
public void run() {
notificationsTab.clear();
}
};
detailsAction = new NotificationDetailsDialogAction(this);
configureColumnsAction = new ConfigureColumnsAction(this);
getViewer().addSelectionChangedListener(copyAction);
getViewer().addSelectionChangedListener(detailsAction);
//$NON-NLS-1$
MenuManager menuMgr = new MenuManager("#PopupMenu");
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
@Override
public void menuAboutToShow(IMenuManager manager) {
manager.add(copyAction);
manager.add(new Separator());
manager.add(clearAction);
manager.add(new Separator());
manager.add(configureColumnsAction);
manager.add(new Separator());
manager.add(detailsAction);
}
});
Menu menu = menuMgr.createContextMenu(getViewer().getControl());
getViewer().getControl().setMenu(menu);
}
use of org.eclipse.jface.action.Separator in project tdi-studio-se by Talend.
the class CallTreeTabPage method createCallTreeViewer.
/**
* Creates the call tree viewer.
*
* @param composite The parent composite
* @param propertySheet The property sheet
*/
private void createCallTreeViewer(Composite composite, PropertySheet propertySheet) {
filteredTree = new CallTreeFilteredTree(composite, propertySheet.getViewSite().getActionBars()) {
@Override
protected void addMenus(IMenuManager manager) {
super.addMenus(manager);
manager.add(new Separator());
manager.add(new ConfigureCpuProfilerAction(cpuSection));
}
};
TreeViewer callTreeViewer = filteredTree.getViewer();
callTreeViewer.setContentProvider(new CallTreeContentProvider());
callTreeViewer.setLabelProvider(new CallTreeLabelProvider(callTreeViewer));
callTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
filteredTree.updateStatusLine((IStructuredSelection) event.getSelection());
}
});
}
use of org.eclipse.jface.action.Separator in project tdi-studio-se by Talend.
the class CallerCalleeTabPage method createCallerViewer.
/**
* Creates the caller viewer.
*
* @param parent The parent composite
* @param propertySheet The property sheet
*/
private void createCallerViewer(Composite parent, PropertySheet propertySheet) {
callerFilteredTree = new HotSpotsFilteredTree(parent, propertySheet.getViewSite().getActionBars()) {
@Override
protected void addMenus(IMenuManager manager) {
manager.add(new Separator());
manager.add(new ConfigureCpuProfilerAction(cpuSection));
}
@Override
public ViewerType getViewerType() {
return ViewerType.Caller;
}
@Override
protected String getMethodColumnName() {
return Messages.callerColumnLabel;
}
@Override
protected String getMethodColumnToolTip() {
return Messages.calleeColumnToolTip;
}
};
TreeViewer callerViewer = callerFilteredTree.getViewer();
callerViewer.setContentProvider(new AbstractContentProvider() {
@Override
public Object[] getElements(Object inputElement) {
if (inputElement instanceof ICpuModel) {
return ((ICpuModel) inputElement).getCallers();
}
return new Object[0];
}
});
callerViewer.setLabelProvider(new HotSpotsLabelProvider(callerFilteredTree));
callerViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
callerFilteredTree.updateStatusLine((IStructuredSelection) event.getSelection());
}
});
callerFilteredTree.sortColumn(callerViewer.getTree().getColumn(1));
}
Aggregations