fActiveEditorPart = part;
super.setActiveEditor(part);
if (fActiveEditorPart instanceof ITextEditorExtension) {
ITextEditorExtension extension= (ITextEditorExtension) fActiveEditorPart;
for (int i= 0; i < STATUS_FIELD_DEFS.length; i++)
extension.setStatusField(null, STATUS_FIELD_DEFS[i].category);
}
ITextEditor textEditor= null;
if (part instanceof ITextEditor)
textEditor= (ITextEditor)part;
IActionBars actionBars= getActionBars();
IStatusLineManager manager= actionBars.getStatusLineManager();
manager.setMessage(null);
manager.setErrorMessage(null);
/** The global actions to be connected with editor actions */
IAction action= getAction(textEditor, ITextEditorActionConstants.NEXT);
actionBars.setGlobalActionHandler(ITextEditorActionDefinitionIds.GOTO_NEXT_ANNOTATION, action);
actionBars.setGlobalActionHandler(ITextEditorActionConstants.NEXT, action);
action= getAction(textEditor, ITextEditorActionConstants.PREVIOUS);
actionBars.setGlobalActionHandler(ITextEditorActionDefinitionIds.GOTO_PREVIOUS_ANNOTATION, action);
actionBars.setGlobalActionHandler(ITextEditorActionConstants.PREVIOUS, action);
for (int i= 0; i < STATUS_FIELD_DEFS.length; i++) {
if (fActiveEditorPart instanceof ITextEditorExtension) {
StatusLineContributionItem statusField= (StatusLineContributionItem) fStatusFields.get(STATUS_FIELD_DEFS[i]);
statusField.setActionHandler(getAction(textEditor, STATUS_FIELD_DEFS[i].actionId));
ITextEditorExtension extension= (ITextEditorExtension) fActiveEditorPart;
extension.setStatusField(statusField, STATUS_FIELD_DEFS[i].category);
}
}
}