use of org.talend.designer.runtime.visualization.internal.actions.CopyAction in project tdi-studio-se by Talend.
the class AttributesTab method createViewer.
/**
* Creates the viewer.
*
* @param propertySheet The property sheet
*/
private void createViewer(PropertySheet propertySheet) {
filteredTree = new PropertiesFilteredTree(this, propertySheet.getViewSite().getActionBars()) {
private ShowInTimelineAction showInTimelineAction;
@Override
protected List<Action> createActions(IActionBars actionBars) {
List<Action> actions = new ArrayList<Action>();
CopyAction copyAction = CopyAction.createCopyAction(actionBars);
actions.add(copyAction);
showInTimelineAction = new MyShowInTimelineAction(section);
actions.add(showInTimelineAction);
return actions;
}
@Override
public void menuAboutToshow() {
// do nothing
}
};
viewer = filteredTree.getViewer();
filteredTree.setEditingSupport(new MyEditingSupport(viewer));
contentProvider = new AttributeContentProvider();
viewer.setContentProvider(contentProvider);
viewer.setLabelProvider(new AttributeLabelProvider(viewer));
viewer.setInput(new Object());
}
use of org.talend.designer.runtime.visualization.internal.actions.CopyAction in project tdi-studio-se by Talend.
the class SWTResourceFilteredTree method createContextMenu.
/**
* Creates the context menu.
*/
private void createContextMenu() {
final CopyAction copyAction = CopyAction.createCopyAction(actionBars);
getViewer().getControl().addFocusListener(new FocusListener() {
@Override
public void focusLost(FocusEvent e) {
getViewer().removeSelectionChangedListener(copyAction);
}
@Override
public void focusGained(FocusEvent e) {
getViewer().addSelectionChangedListener(copyAction);
}
});
//$NON-NLS-1$
MenuManager menuMgr = new MenuManager("#PopupMenu");
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
@Override
public void menuAboutToShow(IMenuManager manager) {
manager.add(copyAction);
}
});
Menu menu = menuMgr.createContextMenu(getViewer().getControl());
getViewer().getControl().setMenu(menu);
}
use of org.talend.designer.runtime.visualization.internal.actions.CopyAction 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.CopyAction 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());
}
use of org.talend.designer.runtime.visualization.internal.actions.CopyAction 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);
}
Aggregations