use of org.talend.designer.runtime.visualization.internal.actions.OpenDeclarationAction 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.talend.designer.runtime.visualization.internal.actions.OpenDeclarationAction in project tdi-studio-se by Talend.
the class CpuDumpEditor method contributeToActionBars.
/**
* Contributes to action bars.
*/
private void contributeToActionBars() {
IActionBars actionBars = getEditorSite().getActionBars();
actionBars.setGlobalActionHandler(JdtActionConstants.OPEN, new OpenDeclarationAction());
actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), new FindAction());
actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), new CopyAction());
}
Aggregations