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

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


        Browser browser = (Browser) event.getSource();
        if (browser.getData("navigation") != null //$NON-NLS-1$
                && browser.getData("navigation").equals("true")) //$NON-NLS-1$ //$NON-NLS-2$
            return;

        IntroModelRoot model = implementation.getModel();
        IntroURLParser parser = new IntroURLParser(url);
        if (!parser.hasProtocol() || parser.getHost() == null
                || parser.getHost().equals("")) //$NON-NLS-1$
            // This will filter out two navigation events fired by the browser
            // on a setText. (about:blank and
            // res://C:\WINDOWS\System32\shdoclc.dll/navcancl.htm on windows,
            // and file:/// on Linux)
            return;

        if (model.isDynamic()) {
            // Update the history even with real URLs. Note that if we have
            // multiple embedded URL navigations due to frames, the
            // frameNavigation flag filters them. This flag is set here, and is
            // cleared by a progress listener, when all the frame navigation is
            // completed. We need to update history only in dynamic case. In
            // static case, the browser keeps the history.
            if (browser.getData("frameNavigation") != null) { //$NON-NLS-1$
                // this is at least the second frame navigation, remove last
                // history since it was added just as a filler.
                if (event.top == false && browser.getData("tempUrl") != null //$NON-NLS-1$
                        && browser.getData("tempUrl").equals("true")) { //$NON-NLS-1$ //$NON-NLS-2$
                    implementation.getHistory().removeLastHistory();
                    flagRemovedTempUrl();
                }
            }

            if (event.top == true) {
                // we are navigating to a regular fully qualified URL. Event.top
                // is true.
                flagStartOfFrameNavigation();
                implementation.updateHistory(url);
            }

            if (browser.getData("frameNavigation") == null //$NON-NLS-1$
                    && 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
View Full Code Here


    public void changing(LocationEvent event) {
        String url = event.location;
        if (url == null)
            return;

        IntroModelRoot model = implementation.getModel();
        IntroURLParser parser = new IntroURLParser(url);
        if (parser.hasIntroUrl()) {
            // stop URL first.
            event.doit = false;
            // execute the action embedded in the IntroURL
            IntroURL introURL = parser.getIntroURL();
            introURL.execute();

            // In the case of dynamic Intro, guard against extra Frame
            // navigations. This can happen in the case of intro injected
            // IFrames or Frames included through intro xml content.
            // INTRO: user defined iframes in Intro pages are not properly
            // supported here, only Help system injected iframes.
            if (model.isDynamic()) {
                if ((introURL.getParameter(IntroURL.KEY_EMBED_TARGET) != null)
                        && introURL.getAction().equals(IntroURL.SHOW_PAGE))
                    flagStartOfNavigation();
            }
            return;
View Full Code Here

        // no-op
    }

    public void createPartControl(Composite container) {
        Text text = new Text(container, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
        IntroModelRoot model = IntroPlugin.getDefault().getIntroModelRoot();
        IntroModelSerializer serializer = new IntroModelSerializer(model);
        text.setText(serializer.toString());
        addToolBarActions();
    }
View Full Code Here

            content = generateXHTMLPage(page, this);
        else {
            HTMLElement html = getHTMLGenerator().generateHTMLforPage(page,
                this);
            if (html != null) {
              IntroModelRoot root = getModel();
              if (root!=null) {
                Map props = root.getTheme()!=null?root.getTheme().getProperties():null;
                if (props!=null) {
                  String value = (String)props.get("standardSupport"); //$NON-NLS-1$
                  String doctype=null;
                  if ("strict".equalsIgnoreCase(value)) //$NON-NLS-1$
                    doctype = generateDoctype(true);
View Full Code Here

            if (Log.logPerformance)
                Util.logPerformanceTime(
                    "BEGIN:  quering registry for configs took: ", start); //$NON-NLS-1$


            IntroModelRoot model = new IntroModelRoot(introConfig,
                introConfigExtensions);
            model.loadModel();
            // add the current model to the hash table of models, only if it is
            // not null. They key is the model id, which is the id of the
            // config that defined this model.
            addCachedModel(model.getId(), model);

            // now load all generic config extension. ie: standbyPart and
            // command contributions.
            loadSharedConfigExtensions();
View Full Code Here

     *
     * @param configId
     * @return
     */
    public IntroModelRoot getModel(String configId) {
        IntroModelRoot model = getCachedModel(configId);
        if (model == null) {
            // we never loaded this model before, or we tried before and we
            // failed. Load it. Get the correct config element based on
            // config id, and log any extra contributions.
            model = loadModel(ATT_ID, configId);
View Full Code Here

     * relative to another plugin. When the presentation is UI forms
     * presentation, this call behaves exactly as the openBrowser intro action.
     */

    private boolean openURL(String url, String pluginId) {
        IntroModelRoot model = IntroPlugin.getDefault().getIntroModelRoot();
        String presentationStyle = model.getPresentation()
            .getImplementationKind();

        if (presentationStyle.equals(IntroPartPresentation.BROWSER_IMPL_KIND)) {
            // HTML presentation
            url = ModelUtil.resolveURL(url, pluginId);
View Full Code Here

        // avoid flicker.
        CustomizableIntroPart currentIntroPart = (CustomizableIntroPart) IntroPlugin
            .getIntro();
        currentIntroPart.getControl().setRedraw(false);

        IntroModelRoot modelRoot = IntroPlugin.getDefault().getIntroModelRoot();
        boolean success = modelRoot.setCurrentPageId(pageId);
        if (!success)
            success = includePageToShow(modelRoot, pageId);

        // we turned drawing off. Turn it on again.
        currentIntroPart.getControl().setRedraw(true);

        if (success) {
            // found page. Set the history
            modelRoot.getPresentation().updateHistory(
                modelRoot.getCurrentPage());
            // ran action successfully. Now set intro intro standby if needed.
            if (standbyState == null)
                return true;
            return setStandbyState(standbyState);
        }
View Full Code Here

    private AbstractIntroPage findPageToShow(String pageId) {
        // 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

            .getIntro();
        if (intro == null)
            return false;

        CustomizableIntroPart cpart = (CustomizableIntroPart) intro;
        IntroModelRoot modelRoot = IntroPlugin.getDefault().getIntroModelRoot();
        String pageId = modelRoot.getCurrentPageId();
        IntroTheme theme = modelRoot.getTheme();
        Rectangle bounds = cpart.getControl().getBounds();
        Rectangle startBounds = Geometry.toDisplay(cpart.getControl()
            .getParent(), bounds);
        closeIntro();

        IWorkbenchWindow window = PlatformUI.getWorkbench()
            .getActiveWorkbenchWindow();
        IntroLaunchBarElement launchBarElement = modelRoot.getPresentation()
            .getLaunchBarElement();
        if (launchBarElement==null)
          return true;
        IntroLaunchBar launchBar = new IntroLaunchBar(launchBarElement
            .getOrientation(), pageId, launchBarElement, theme);
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.