Class WizardPageSet

java.lang.Object
org.libreoffice.ide.eclipse.core.wizards.utils.WizardPageSet
Direct Known Subclasses:
ServiceWizardSet

public abstract class WizardPageSet extends Object
A wizard page set is a subset of a wizard which should be reused by several wizards.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
     
    protected IPageListener
    Listener to use to listen for any page change which impacts the wizard set contained pages.
    protected org.eclipse.jface.wizard.IWizard
    Reference to the wizard containing the pages.
  • Constructor Summary

    Constructors
    Constructor
    Description
    WizardPageSet(org.eclipse.jface.wizard.IWizard pWizard)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addPage(org.eclipse.jface.wizard.IWizardPage page)
    Add the pages into a list in order to store them.
    protected abstract void
    This method has to be called to ask the pages contained in the set to be updated with new external data.
    abstract void
    doFinish(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.ui.IWorkbenchPage activePage)
    Performs the actions to run at the end of the wizard for the wizard set.
    org.eclipse.jface.wizard.IWizardPage
    getNextPage(org.eclipse.jface.wizard.IWizardPage currentPage)
    Get the visible page to show after a page.
    org.eclipse.jface.wizard.IWizardPage
    Returns the page with the given name.
    org.eclipse.jface.wizard.IWizardPage[]
    Get an array of the contained pages.
    org.eclipse.jface.wizard.IWizardPage
    getPreviousPage(org.eclipse.jface.wizard.IWizardPage currentPage)
    Get the visible page to show before a page.
    abstract void
    Initializes the wizard pages with default data.
    void
    setHidden(org.eclipse.jface.wizard.IWizardPage page, boolean hidden)
    Set a page as hidden in the wizard.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • mChangingPages

      protected boolean mChangingPages
    • mPageListener

      protected IPageListener mPageListener
      Listener to use to listen for any page change which impacts the wizard set contained pages.
    • mWizard

      protected org.eclipse.jface.wizard.IWizard mWizard
      Reference to the wizard containing the pages. This reference has to be set before adding pages
  • Constructor Details

    • WizardPageSet

      public WizardPageSet(org.eclipse.jface.wizard.IWizard pWizard)
      Constructor.
      Parameters:
      pWizard - the wizard containing the wizard set.
  • Method Details

    • getPage

      public org.eclipse.jface.wizard.IWizardPage getPage(String name)
      Returns the page with the given name.
      Parameters:
      name - the name of the page to look for
      Returns:
      the page found or null if none has been found.
    • addPage

      public void addPage(org.eclipse.jface.wizard.IWizardPage page)
      Add the pages into a list in order to store them.

      The order in which they had been added will be the order in which they will be show in the wizard. By default all the added pages are visible.

      Note that the pages are not added into the wizard. This one has to add all the set pages using the getNextPage(IWizardPage) method.

      Parameters:
      page - the page to add.
    • getPages

      public org.eclipse.jface.wizard.IWizardPage[] getPages()
      Get an array of the contained pages.

      This method doesn't care whether the pages are visible or not.

      Returns:
      the contained pages
    • setHidden

      public void setHidden(org.eclipse.jface.wizard.IWizardPage page, boolean hidden)
      Set a page as hidden in the wizard.

      This method defines whether a page of the wizard set should be shown or not. Be aware that the page are created even if they aren't shown.

      This method has no effect if the page is not contained in the wizard set. Otherwise the page will simply not be taken into consideration in the wizard.

      Parameters:
      page - the page to hide
      hidden - true to hide the page, false otherwise
    • getNextPage

      public org.eclipse.jface.wizard.IWizardPage getNextPage(org.eclipse.jface.wizard.IWizardPage currentPage) throws NoSuchPageException
      Get the visible page to show after a page.

      The next page is determined by the order in which it has been added in the wizard set. The first non-hidden page added after the current page will be returned.

      The wizard should use this method to find the next page instead of the normal one.

      Here is a sample replacement of the normal method in the wizard:

       public IWizardPage getNextPage(IWizardPage page) {
           IWizardPage next = null;
           try {
               next = wizardSet.getNextPage(page);
           } catch (NoSuchPageException e) {
               // Return the default next page if the page is not in the wizard set.
               next = super.getNextPage(page);
           }
      
           return next;
       }
       
      Parameters:
      currentPage - the page after which is the next page
      Returns:
      the next page or null if the current page is the last one.
      Throws:
      NoSuchPageException - is thrown if the page isn't contained in the wizard set.
      See Also:
    • getPreviousPage

      public org.eclipse.jface.wizard.IWizardPage getPreviousPage(org.eclipse.jface.wizard.IWizardPage currentPage) throws NoSuchPageException
      Get the visible page to show before a page.

      The previous page is determined by the order in which it has been added in the wizard set. The last non-hidden page added before the current page will be returned.

      The wizard should use this method to find the previous page instead of the normal one.

      Here is a sample replacement of the normal method in the wizard:

       public IWizardPage getPreviousPage(IWizardPage page) {
           IWizardPage previous = null;
           try {
               previous = wizardSet.getPreviousPage(page);
           } catch (NoSuchPageException e) {
               // Return the default previous page if the page is not in the
               // wizard set.
               previous = super.getPreviousPage(page);
           }
      
           return previous;
       }
       
      Parameters:
      currentPage - the page before which is the previous page
      Returns:
      the previous page or null if the current page is the first one.
      Throws:
      NoSuchPageException - is thrown if the page isn't contained in the wizard set.
      See Also:
    • initialize

      public abstract void initialize(UnoFactoryData data)
      Initializes the wizard pages with default data.

      This method should set all the correct data in the pages supposing nothing has already been entered.

      This method should be overridden by the subclasses. The default method doesn't perform any action.

      Parameters:
      data - the data describing the default/initial values of the pages
    • doFinish

      public abstract void doFinish(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.ui.IWorkbenchPage activePage)
      Performs the actions to run at the end of the wizard for the wizard set.

      Performs the changes needed by the wizard set. This method has to be called in the IWizard.performFinish() method. For cleaner actions the actions performed by the wizard set finish should concern only the data defined by the wizard set pages.

      The active page is often needed by the UnoFactory to open a newly created file in the workbench.

      This method should be overridden by the subclasses. The default method doesn't perform any action.

      Parameters:
      monitor - the monitor used to follow the finish process.
      activePage - the page that was active before opening the wizard.
      See Also:
      • for more informations on actions performed when finishing a wizard.
    • dataChanged

      protected abstract void dataChanged(UnoFactoryData delta)
      This method has to be called to ask the pages contained in the set to be updated with new external data.

      This method should be overridden by the subclasses. The default method doesn't perform any action.

      Parameters:
      delta - the data delta of the changed page.