use of org.talend.designer.core.ui.editor.TalendEditor 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();
}
}
Aggregations