Class Wizard

    • Field Detail

      • DEFAULT_IMAGE

        public static final String DEFAULT_IMAGE
        Image registry key of the default image for wizard pages (value "org.eclipse.jface.wizard.Wizard.pageImage").
        See Also:
        Constant Field Values
    • Constructor Detail

      • Wizard

        protected Wizard()
        Creates a new empty wizard.
    • Method Detail

      • addPage

        public void addPage​(IWizardPage page)
        Adds a new page to this wizard. The page is inserted at the end of the page list.
        Parameters:
        page - the new page
      • addPages

        public void addPages()
        The Wizard implementation of this IWizard method does nothing. Subclasses should extend if extra pages need to be added before the wizard opens. New pages should be added by calling addPage.
        Specified by:
        addPages in interface IWizard
      • canFinish

        public boolean canFinish()
        Description copied from interface: IWizard
        Returns whether this wizard could be finished without further user interaction.

        The result of this method is typically used by the wizard container to enable or disable the Finish button.

        Specified by:
        canFinish in interface IWizard
        Returns:
        true if the wizard could be finished, and false otherwise
      • createPageControls

        public void createPageControls​(Composite pageContainer)
        The Wizard implementation of this IWizard method creates all the pages controls using IDialogPage.createControl. Subclasses should reimplement this method if they want to delay creating one or more of the pages lazily. The framework ensures that the contents of a page will be created before attempting to show it.
        Specified by:
        createPageControls in interface IWizard
        Parameters:
        pageContainer - the parent control
      • dispose

        public void dispose()
        The Wizard implementation of this IWizard method disposes all the pages controls using DialogPage.dispose. Subclasses should extend this method if the wizard instance maintains addition SWT resource that need to be disposed.
        Specified by:
        dispose in interface IWizard
      • getContainer

        public IWizardContainer getContainer()
        Description copied from interface: IWizard
        Returns the container of this wizard.
        Specified by:
        getContainer in interface IWizard
        Returns:
        the wizard container, or null if this wizard has yet to be added to a container
      • getDefaultPageImage

        public Image getDefaultPageImage()
        Description copied from interface: IWizard
        Returns the default page image for this wizard.

        This image can be used for pages which do not supply their own image.

        Specified by:
        getDefaultPageImage in interface IWizard
        Returns:
        the default page image
      • getDialogSettings

        public IDialogSettings getDialogSettings()
        Description copied from interface: IWizard
        Returns the dialog settings for this wizard.

        The dialog store is used to record state between wizard invocations (for example, radio button selections, last directory, etc.).

        Specified by:
        getDialogSettings in interface IWizard
        Returns:
        the dialog settings, or null if none
      • getNextPage

        public IWizardPage getNextPage​(IWizardPage page)
        Description copied from interface: IWizard
        Returns the successor of the given page.

        This method is typically called by a wizard page

        Specified by:
        getNextPage in interface IWizard
        Parameters:
        page - the page
        Returns:
        the next page, or null if none
      • getPage

        public IWizardPage getPage​(String name)
        Description copied from interface: IWizard
        Returns the wizard page with the given name belonging to this wizard.
        Specified by:
        getPage in interface IWizard
        Parameters:
        name - the name of the wizard page
        Returns:
        the wizard page with the given name, or null if none
      • getPageCount

        public int getPageCount()
        Description copied from interface: IWizard
        Returns the number of pages in this wizard.
        Specified by:
        getPageCount in interface IWizard
        Returns:
        the number of wizard pages
      • getPages

        public IWizardPage[] getPages()
        Description copied from interface: IWizard
        Returns all the pages in this wizard.
        Specified by:
        getPages in interface IWizard
        Returns:
        a list of pages
      • getPreviousPage

        public IWizardPage getPreviousPage​(IWizardPage page)
        Description copied from interface: IWizard
        Returns the predecessor of the given page.

        This method is typically called by a wizard page

        Specified by:
        getPreviousPage in interface IWizard
        Parameters:
        page - the page
        Returns:
        the previous page, or null if none
      • getShell

        public Shell getShell()
        Returns the wizard's shell if the wizard is visible. Otherwise null is returned.
        Specified by:
        getShell in interface IShellProvider
        Returns:
        Shell
      • getStartingPage

        public IWizardPage getStartingPage()
        Description copied from interface: IWizard
        Returns the first page to be shown in this wizard.
        Specified by:
        getStartingPage in interface IWizard
        Returns:
        the first wizard page
      • getTitleBarColor

        public RGB getTitleBarColor()
        Description copied from interface: IWizard
        Returns the title bar color for this wizard.
        Specified by:
        getTitleBarColor in interface IWizard
        Returns:
        the title bar color
      • getWindowTitle

        public String getWindowTitle()
        Description copied from interface: IWizard
        Returns the window title string for this wizard.
        Specified by:
        getWindowTitle in interface IWizard
        Returns:
        the window title string, or null for no title
      • needsPreviousAndNextButtons

        public boolean needsPreviousAndNextButtons()
        Description copied from interface: IWizard
        Returns whether this wizard needs Previous and Next buttons.

        The result of this method is typically used by the container.

        Specified by:
        needsPreviousAndNextButtons in interface IWizard
        Returns:
        true if Previous and Next buttons are required, and false if none are needed
      • needsProgressMonitor

        public boolean needsProgressMonitor()
        Description copied from interface: IWizard
        Returns whether this wizard needs a progress monitor.

        The result of this method is typically used by the container.

        Specified by:
        needsProgressMonitor in interface IWizard
        Returns:
        true if a progress monitor is required, and false if none is needed
      • performCancel

        public boolean performCancel()
        The Wizard implementation of this IWizard method does nothing and returns true. Subclasses should reimplement this method if they need to perform any special cancel processing for their wizard.
        Specified by:
        performCancel in interface IWizard
        Returns:
        true to indicate the cancel request was accepted, and false to indicate that the cancel request was refused
      • performFinish

        public abstract boolean performFinish()
        Subclasses must implement this IWizard method to perform any special finish processing for their wizard.
        Specified by:
        performFinish in interface IWizard
        Returns:
        true to indicate the finish request was accepted, and false to indicate that the finish request was refused
      • setContainer

        public void setContainer​(IWizardContainer wizardContainer)
        Description copied from interface: IWizard
        Sets or clears the container of this wizard.
        Specified by:
        setContainer in interface IWizard
        Parameters:
        wizardContainer - the wizard container, or null
      • setDefaultPageImageDescriptor

        public void setDefaultPageImageDescriptor​(ImageDescriptor imageDescriptor)
        Sets the default page image descriptor for this wizard.

        This image descriptor will be used to generate an image for a page with no image of its own; the image will be computed once and cached.

        Parameters:
        imageDescriptor - the default page image descriptor
      • setDialogSettings

        public void setDialogSettings​(IDialogSettings settings)
        Sets the dialog settings for this wizard.

        The dialog settings is used to record state between wizard invocations (for example, radio button selection, last import directory, etc.)

        Parameters:
        settings - the dialog settings, or null if none
        See Also:
        getDialogSettings()
      • setForcePreviousAndNextButtons

        public void setForcePreviousAndNextButtons​(boolean b)
        Controls whether the wizard needs Previous and Next buttons even if it currently contains only one page.

        This flag should be set on wizards where the first wizard page adds follow-on wizard pages based on user input.

        Parameters:
        b - true to always show Next and Previous buttons, and false to suppress Next and Previous buttons for single page wizards
      • setNeedsProgressMonitor

        public void setNeedsProgressMonitor​(boolean b)
        Sets whether this wizard needs a progress monitor.
        Parameters:
        b - true if a progress monitor is required, and false if none is needed
        See Also:
        needsProgressMonitor()
      • setTitleBarColor

        public void setTitleBarColor​(RGB color)
        Sets the title bar color for this wizard.
        Parameters:
        color - the title bar color
      • setWindowTitle

        public void setWindowTitle​(String newTitle)
        Sets the window title for the container that hosts this page to the given string.
        Parameters:
        newTitle - the window title for the container