Package org.eclipse.ui.forms.editor

Examples of org.eclipse.ui.forms.editor.IFormPage


    _dirty = true;
    firePropertyChange(IEditorPart.PROP_DIRTY);
    validateModel();
   
    // dynamic page handling
    IFormPage page = findPage(ShortcutsConfigurationPage.ID);
    if (_model.isFeatureSupported(WGADesignConfigurationModel.FEATURE_SHORTCUTS)) {
      if (page == null) {
        try {
          page =new ShortcutsConfigurationPage(this);
          ((ShortcutsConfigurationPage)page).setModel(_model);
          addPage(SHORTCUTS_PAGE_INDEX, page);         
        } catch (PartInitException e) {
        }
      }
    } else if (page != null) {     
      removePage(page.getIndex());
    }
   
    page = findPage(SchemaConfigurationPage.ID);
    if (_model.isFeatureSupported(WGASchemaDefinitionModel.FEATURE_SCHEMADEFINITION)) {     
            if (page == null) {
                try {
                    page = new SchemaConfigurationPage(this);
                      ((SchemaConfigurationPage)page).setModel(_model);
                      addPage(SCHEMADEFINITION_PAGE_INDEX, page);
                } catch (PartInitException e) {                   
                }
            }         
        } else if (page != null) {          
            removePage(page.getIndex());
        }
  }
View Full Code Here


    }

    @Override
    public void propertyChange(PropertyChangeEvent evt) {
        if (!committing) {
            IFormPage page = (IFormPage) getManagedForm().getContainer();
            if (page.isActive()) {
                refresh();
            } else {
                markStale();
            }
        }
View Full Code Here

                return true;
            }
        };

        IFormPage page = (IFormPage) getManagedForm().getContainer();
        IWorkbenchWindow window = page.getEditorSite().getWorkbenchWindow();

        // Prepare the package lister from the Java project
        IProject project = ResourceUtil.getResource(page.getEditorInput()).getProject();
        IJavaProject javaProject = JavaCore.create(project);

        IJavaSearchScope searchScope = SearchEngine.createJavaSearchScope(new IJavaElement[] {
            javaProject
        });
View Full Code Here

        // Remove pages no longer required and remember the rest in a map
        int i = 0;
        Map<String,IFormPage> pageCache = new HashMap<String,IFormPage>(requiredPageIds.size());
        while (i < getPageCount()) {
            IFormPage current = (IFormPage) pages.get(i);
            if (!requiredPageIds.contains(current.getId()))
                removePage(i);
            else {
                pageCache.put(current.getId(), current);
                i++;
            }
        }

        // Cache new pages
        for (String pageId : requiredPageIds) {
            if (!pageCache.containsKey(pageId)) {
                IFormPage page = SOURCE_PAGE.equals(pageId) ? sourcePage : pageFactories.get(pageId).createPage(this, model, pageId);
                pageCache.put(pageId, page);
            }
        }

        // Add pages back in
        int requiredPointer = 0;
        int existingPointer = 0;

        while (requiredPointer < requiredPageIds.size()) {
            try {
                String requiredId = requiredPageIds.get(requiredPointer);
                if (existingPointer >= getPageCount()) {
                    if (SOURCE_PAGE.equals(requiredId))
                        addPage(sourcePage, getEditorInput());
                    else
                        addPage(pageCache.get(requiredId));
                } else {
                    IFormPage existingPage = (IFormPage) pages.get(existingPointer);
                    if (!requiredId.equals(existingPage.getId())) {
                        if (SOURCE_PAGE.equals(requiredId))
                            addPage(existingPointer, sourcePage, getEditorInput());
                        else
                            addPage(existingPointer, pageCache.get(requiredId));
                    }
View Full Code Here

            this.saving.set(false);
        }
    }

    protected void ensurePageExists(String pageId, IFormPage page, int index) {
        IFormPage existingPage = findPage(pageId);
        if (existingPage != null)
            return;

        try {
            addPage(index, page);
View Full Code Here

            ErrorDialog.openError(getSite().getShell(), "Error", null, new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Error adding page to editor.", e));
        }
    }

    protected void removePage(String pageId) {
        IFormPage page = findPage(pageId);
        if (page != null) {
            removePage(page.getIndex());
        }
    }
View Full Code Here

            selected = SOURCE_PAGE;
            selectedPrio = 0;
        }

        for (Object pageObj : pages) {
            IFormPage page = (IFormPage) pageObj;
            int priority = 0;
            if (page instanceof IPriority)
                priority = ((IPriority) page).getPriority();
            if (priority > selectedPrio) {
                selected = page.getId();
                selectedPrio = priority;
            }
        }

        if (selected != null)
View Full Code Here

        this.model.addPropertyChangeListener(this);
    }

    public void propertyChange(PropertyChangeEvent evt) {
        if (editablePropertySet.contains(evt.getPropertyName())) {
            IFormPage page = (IFormPage) getManagedForm().getContainer();
            if (page.isActive()) {
                refresh();
            } else {
                markStale();
            }
        } else if (Constants.EXPORT_PACKAGE.equals(evt.getPropertyName()) || aQute.bnd.osgi.Constants.PRIVATE_PACKAGE.equals(evt.getPropertyName())) {
View Full Code Here

        if (this.model != null)
            this.model.removePropertyChangeListener(this);
    }

    IJavaProject getJavaProject() {
        IFormPage formPage = (IFormPage) getManagedForm().getContainer();
        IFile file = ResourceUtil.getFile(formPage.getEditorInput());
        return file != null ? JavaCore.create(file.getProject()) : null;
    }
View Full Code Here

            model.addPropertyChangeListener(propertyName, this);
        }
    }

    public void propertyChange(PropertyChangeEvent evt) {
        IFormPage page = (IFormPage) managedForm.getContainer();
        if (page.isActive())
            refresh();
        else
            markStale();
    }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.forms.editor.IFormPage

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.