Search in sources :

Example 1 with MultiPageEditorActionBarContributor

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);
    }
}
Also used : MultiPageEditorActionBarContributor(org.eclipse.ui.part.MultiPageEditorActionBarContributor) IEditorActionBarContributor(org.eclipse.ui.IEditorActionBarContributor) PartInitException(org.eclipse.ui.PartInitException) Point(org.eclipse.swt.graphics.Point)

Aggregations

Point (org.eclipse.swt.graphics.Point)1 IEditorActionBarContributor (org.eclipse.ui.IEditorActionBarContributor)1 PartInitException (org.eclipse.ui.PartInitException)1 MultiPageEditorActionBarContributor (org.eclipse.ui.part.MultiPageEditorActionBarContributor)1