use of org.eclipse.ui.part.MultiPageEditorActionBarContributor in project webtools.sourceediting by eclipse.
the class XMLMultiPageEditorPart method createPages.
/**
* Creates the pages of this multi-page editor.
* <p>
* Subclasses of <code>MultiPageEditor</code> must implement this method.
* </p>
*/
protected void createPages() {
try {
// source page MUST be created before design page, now
createSourcePage();
createAndAddDesignPage();
addSourcePage();
connectDesignPage();
// set the active editor in the action bar contributor first
// before setactivepage calls action bar contributor's
// setactivepage (bug141013 - remove when bug151488 is fixed)
IEditorActionBarContributor contributor = getEditorSite().getActionBarContributor();
if (contributor instanceof MultiPageEditorActionBarContributor) {
((MultiPageEditorActionBarContributor) contributor).setActiveEditor(this);
}
// $NON-NLS-1$;
int activePageIndex = getPreferenceStore().getInt(getEditorSite().getId() + "." + IXMLPreferenceNames.LAST_ACTIVE_PAGE);
if ((activePageIndex >= 0) && (activePageIndex < getPageCount())) {
setActivePage(activePageIndex);
} else {
setActivePage(fSourcePageIndex);
}
} catch (PartInitException e) {
Logger.logException(e);
throw new RuntimeException(e);
}
}
Aggregations