use of org.eclipse.ui.IActionBars 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.eclipse.ui.IActionBars in project tdi-studio-se by Talend.
the class MultiPageEditorContributor method setActivePage.
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.part.MultiPageEditorActionBarContributor#setActivePage(org.eclipse.ui.IEditorPart)
*/
@Override
public void setActivePage(final IEditorPart activeEditor) {
if ((activeEditorPart == activeEditor) || (activeEditor == null)) {
return;
}
activeEditorPart = activeEditor;
if (activeEditor instanceof TalendEditor) {
RootEditPart editPart = ((TalendEditor) activeEditor).getViewer().getRootEditPart();
if (editPart != null && editPart instanceof TalendScalableFreeformRootEditPart) {
ZoomManager manager = ((TalendScalableFreeformRootEditPart) ((TalendEditor) activeEditor).getViewer().getRootEditPart()).getZoomManager();
item.setZoomManager(manager);
}
} else {
item.setZoomManager(null);
}
IActionBars actionBars = getActionBars();
if (actionBars != null) {
actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), getAction(activeEditor, ActionFactory.DELETE.getId()));
actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), getAction(activeEditor, ActionFactory.UNDO.getId()));
actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), getAction(activeEditor, ActionFactory.REDO.getId()));
actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), getAction(activeEditor, ActionFactory.CUT.getId()));
actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), getAction(activeEditor, ActionFactory.COPY.getId()));
actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), getAction(activeEditor, ActionFactory.PASTE.getId()));
actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), getAction(activeEditor, ActionFactory.SELECT_ALL.getId()));
actionBars.setGlobalActionHandler(ToggleSubjobsAction.ID, getAction(activeEditor, ToggleSubjobsAction.ID));
// see bug 0003656: Actions in the main menu "View" are always disabled.
activateActionsInViewMenu(activeEditor, actionBars, VIEW_MENU_ACTIONS_ID);
// MOD mzhao bug 8710
if (showAndRunProcessAction != null) {
actionBars.setGlobalActionHandler(showAndRunProcessAction.getActionDefinitionId(), showAndRunProcessAction);
}
actionBars.updateActionBars();
}
}
use of org.eclipse.ui.IActionBars in project tdi-studio-se by Talend.
the class CpuSection method contributeToActionBars.
/**
* Contributes to action bars.
*/
private void contributeToActionBars() {
IActionBars actionBars = getActionBars();
OpenDeclarationAction.createOpenDeclarationAction(actionBars);
actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), new FindAction());
CopyAction.createCopyAction(actionBars);
}
use of org.eclipse.ui.IActionBars in project cubrid-manager by CUBRID.
the class QueryEditorPart method hookRetragetActions.
protected void hookRetragetActions() {
ActionManager actionManager = ActionManager.getInstance();
IActionBars bar = this.getEditorSite().getActionBars();
bar.setGlobalActionHandler(UndoAction.ID, actionManager.getAction(UndoAction.ID));
bar.setGlobalActionHandler(RedoAction.ID, actionManager.getAction(RedoAction.ID));
IAction action = actionManager.getAction(CutAction.ID);
action.setEnabled(true);
bar.setGlobalActionHandler(CutAction.ID, action);
IAction copyAction = actionManager.getAction(CopyAction.ID);
bar.setGlobalActionHandler(CopyAction.ID, copyAction);
copyAction.setEnabled(true);
IAction pasteAction = actionManager.getAction(PasteAction.ID);
bar.setGlobalActionHandler(PasteAction.ID, pasteAction);
pasteAction.setEnabled(true);
bar.setGlobalActionHandler(FindReplaceAction.ID, actionManager.getAction(FindReplaceAction.ID));
bar.setGlobalActionHandler(QueryOpenAction.ID, actionManager.getAction(QueryOpenAction.ID));
bar.updateActionBars();
}
use of org.eclipse.ui.IActionBars in project cubrid-manager by CUBRID.
the class DatabaseDashboardViewPart method makeActions.
/**
* This method is to create actions at tool bar
*
*/
private void makeActions() {
Action settingAction = new Action() {
public void run() {
fireChartSetting();
}
};
settingAction.setText(Messages.chartSettingTxt);
settingAction.setToolTipText(Messages.chartSettingTxt);
settingAction.setImageDescriptor(CubridManagerUIPlugin.getImageDescriptor("icons/action/setting-small.png"));
final IActionBars bars = getViewSite().getActionBars();
IToolBarManager manager = bars.getToolBarManager();
manager.add(settingAction);
RecordAction recordAction = new RecordAction();
recordAction.setRecorder(this);
recordAction.setPrepareTooltip(Messages.dbDashboardMonitorStartRecordTooltip);
recordAction.setRecordTooltip(Messages.dbDashboardRecordingTooltip);
recordAction.setImageDescriptor(CubridManagerUIPlugin.getImageDescriptor("icons/monitor/prepare_record.png"));
recordAction.setToolTipText(Messages.dbDashboardMonitorStartRecordTooltip);
manager.add(recordAction);
}
Aggregations