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

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


                    && event.top == false) {
                // a new url navigation that is not in a top frame. It can
                // be a navigation url due to frames, it can be due to a true
                // single Frame navigation (when you click on a link inside a
                // Frame) or it is an embedded Help System topic navigation.
                AbstractIntroPage currentPage = model.getCurrentPage();
                if (currentPage.isIFramePage()) {
                    // it is an embedded Help System topic navigation. we are
                    // navigating to an injected iframe since event.top is
                    // false. Set the iframe url of the current iframe page, and
                    // add it
                    // to history.
                    currentPage.setIFrameURL(url);
                    implementation.updateHistory(currentPage);
                } else {
                    flagStartOfFrameNavigation();
                    flagStoredTempUrl();
                    implementation.updateHistory(url);
View Full Code Here


        String cachedPage = getCachedCurrentPage();
        if (cachedPage != null & !History.isURL(cachedPage))
            // this will create the page in the page form.
            model.setCurrentPageId(cachedPage);

        AbstractIntroPage pageToShow = getModel().getCurrentPage();
        // load style manager here to test for navigation.
        PageStyleManager styleManager = new PageStyleManager(pageToShow,
            sharedStyleManager.getProperties());
        boolean pageHasNavigation = styleManager.showHomePageNavigation();
        if (pageToShow != null) {
            if (pageBook.hasPage(pageToShow.getId()))
                // we are showing Home Page.
                pageBook.showPage(pageToShow.getId());
            else {
                if (pageHasNavigation) {
                    // page or Home Page with a page layout and navigation, set
                    // the page id to the static PageFormWithNavigation id.
                    // first create the correct content.
View Full Code Here

        if (isStandbyPartNeeded)
            // we have a standby part, nothing more to do in presentation.
            return;

        // try to show a cached page.
        AbstractIntroPage pageToShow = null;
        if (standby) {
            // we are in standby. Show standby page, in PageForm.
            pageToShow = getModel().getStandbyPage();
            if (pageToShow == null)
                pageToShow = getModel().getHomePage();
View Full Code Here

     *
     * @see org.eclipse.ui.intro.config.IIntroContentProviderSite#reflow(org.eclipse.ui.intro.config.IIntroContentProvider,
     *      boolean)
     */
    public void reflow(IIntroContentProvider provider, boolean incremental) {
        AbstractIntroPage page = ContentProviderManager.getInst()
            .getContentProviderParentPage(provider);
        if (incremental) {
            if (pageForm.hasPage(page.getId()))
                pageForm.reflow();
            else if (pageFormWithNav.hasPage(page.getId()))
                pageFormWithNav.reflow();
            else if (mainPageBook.hasPage(page.getId()))
                mainPageBook.reflow(true);         
        }
        else {
          removeCachedPage(page);
          showPage(model.getCurrentPage());
View Full Code Here

                } else {
                    // we need to regen HTML. We can not use setting current
                    // page to trigger regen for one case: navigating back from
                    // a url will not trigger regen since current page would be
                    // the same.
                    AbstractIntroPage page = history.getCurrentLocationAsPage();
                    getModel().setCurrentPageId(page.getId(), false);
                    success = generateDynamicContentForPage(page);
                }
            } else
                success = false;
            // update history only in dynamic case.
View Full Code Here

                // guard against unnecessary History updates.
                urlListener.flagStartOfNavigation();
                if (history.currentLocationIsUrl()) {
                    success = browser.setUrl(history.getCurrentLocationAsUrl());
                } else {
                    AbstractIntroPage page = history.getCurrentLocationAsPage();
                    getModel().setCurrentPageId(page.getId(), false);
                    success = generateDynamicContentForPage(page);
                }
            } else
                success = false;
            // update history only in dynamic case.
View Full Code Here

    }

    private void updateReturnLinkLabel() {
        String linkText = Messages.StandbyPart_returnToIntro;
        returnLink.setText(linkText);
        AbstractIntroPage page = model.getCurrentPage();
        if (page == null)
            // page will be null in static intro.
            return;

        String toolTip = Messages.StandbyPart_returnTo;
        if (page.getTitle() != null)
            toolTip += " " + page.getTitle(); //$NON-NLS-1$

        returnLink.setToolTipText(toolTip);
    }
View Full Code Here

     *
     * @param pageId
     * @return
     */
    private boolean includePageToShow(IntroModelRoot model, String pageId) {
        AbstractIntroPage page = findPageToShow(pageId);
        if (page == null) {
            Log.warning("Could not find an Intro page with id=" + pageId); //$NON-NLS-1$
            return false;
        }
        // now clone the target page because original model should be kept
        // intact. Resolve target page first to resolve its includes
        // properly. Insert presentation shared style at the top of the shared
        // styles list because once reparented, the shared style is lost.
        // Finally, add clone page to current model.
        page.getChildren();
        // current kind.
        String currentPresentationKind = model.getPresentation()
            .getImplementationKind();
        // load shared style corresponding to same presentation kind from target
        // model.
        IntroPartPresentation targetPresentation = ((IntroModelRoot) page
            .getParent()).getPresentation();
        String targetSharedStyle = targetPresentation
            .getSharedStyle(currentPresentationKind);
        // clone.
        AbstractIntroPage clonedPage = null;
        try {
            clonedPage = (AbstractIntroPage) page.clone();
        } catch (CloneNotSupportedException ex) {
            // should never be here.
            Log.error("Failed to clone Intro model node.", ex); //$NON-NLS-1$
            return false;
        }
        // reparent cloned target to current model.
        clonedPage.setParent(model);
        // REVISIT: SWT presentation does not support multiple shared
        // styles.
        if (targetSharedStyle != null)
            // add target model shared style.
            clonedPage.insertStyle(targetSharedStyle, 0);
        model.addChild(clonedPage);
        return model.setCurrentPageId(clonedPage.getId());
    }
View Full Code Here

        // get all cached models.
        Hashtable models = ExtensionPointManager.getInst().getIntroModels();
        Enumeration values = models.elements();
        while (values.hasMoreElements()) {
            IntroModelRoot model = (IntroModelRoot) values.nextElement();
            AbstractIntroPage page = (AbstractIntroPage) model.findChild(
                pageId, AbstractIntroElement.ABSTRACT_PAGE);
            if (page != null)
                return page;
        }
        // could not find page in any model.
View Full Code Here

        // 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.AbstractIntroPage

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.