Package org.eclipse.ui.internal.intro.impl.model

Examples of org.eclipse.ui.internal.intro.impl.model.IntroModelRoot


            if (embedTarget == null)
                return impl.getBrowser().setUrl(href);

            // embedded in Div case.
            IntroModelRoot model = IntroPlugin.getDefault().getIntroModelRoot();
            return handleEmbedURLInDiv(href, embedTarget, model
                .getCurrentPage());
        }

        // show href in Help window. SWT presentation is handled here.
        // WorkbenchHelp takes care of error handling.
View Full Code Here


    private boolean handleEmbedURLInDiv(String href, String embedTarget,
            AbstractIntroPage currentPage) {

        // re-use a runtime generated page, if found. Create the mangled id for
        // the page and check if page exists first. If not, create one.
        IntroModelRoot model = (IntroModelRoot) currentPage.getParentPage()
            .getParent();
        String currentPageId = null;
        if (currentPage.isIFramePage())
            currentPageId = currentPage.getUnmangledId();
        else
            currentPageId = currentPage.getId();
        String mangledPageId = currentPageId + "_" + "WITH_IFRAME"; //$NON-NLS-1$ //$NON-NLS-2$

        // get current standby state.
        boolean standby = IntroPlugin.isIntroStandby();
        String standbyAsString = standby ? IntroURL.VALUE_TRUE : "false"; //$NON-NLS-1$

        AbstractIntroPage pageWithIFrame = (AbstractIntroPage) model.findChild(
            mangledPageId, AbstractIntroElement.ABSTRACT_PAGE);
        if (pageWithIFrame != null) {
            pageWithIFrame.setIFrameURL(href);
            return introURL.showPage(mangledPageId, standbyAsString);
        }

        // Page never generated, clone and create.
        AbstractIntroPage clonedPage = null;
        try {
            clonedPage = (AbstractIntroPage) currentPage.clone();
        } catch (CloneNotSupportedException ex) {
            // should never be here.
            Log.error("Failed to clone Intro page: " + currentPage.getId(), ex); //$NON-NLS-1$
            return false;
        }

        // embed url as IFrame in target div. We need to find target div in
        // cloned page not in the original page.
        boolean canInjectFrame = clonedPage.injectIFrame(href, embedTarget);
        if (!canInjectFrame)
            // Called method handles error.
            return false;

        clonedPage.setId(mangledPageId);
        model.addChild(clonedPage);
        return introURL.showPage(clonedPage.getId(), standbyAsString);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.internal.intro.impl.model.IntroModelRoot

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.