Class Wizard
- All Implemented Interfaces:
IShellProvider
,IWizard
- Direct Known Subclasses:
BasicNewResourceWizard
,ExternalProjectImportWizard
,FileSystemExportWizard
,FileSystemImportWizard
,ParticipantSynchronizeWizard
,RefactoringHistoryWizard
,RefactoringWizard
,ZipFileExportWizard
,ZipFileImportWizard
Wizard
to implement a particular wizard.
Subclasses may call the following methods to configure the wizard:
addPage
setHelpAvailable
setDefaultPageImageDescriptor
setDialogSettings
setNeedsProgressMonitor
setTitleBarColor
setWindowTitle
Subclasses may override these methods if required:
- reimplement
createPageControls
- reimplement
performCancel
- extend
addPages
- reimplement
performFinish
- extend
dispose
Note that clients are free to implement IWizard
from scratch
instead of subclassing Wizard
. Correct implementations of
IWizard
will work with any correct implementation of
IWizardPage
.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Image registry key of the default image for wizard pages (value"org.eclipse.jface.wizard.Wizard.pageImage"
). -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPage
(IWizardPage page) Adds a new page to this wizard.void
addPages()
TheWizard
implementation of thisIWizard
method does nothing.boolean
Returns whether this wizard could be finished without further user interaction.void
createPageControls
(Composite pageContainer) TheWizard
implementation of thisIWizard
method creates all the pages controls usingIDialogPage.createControl
.void
dispose()
TheWizard
implementation of thisIWizard
method disposes all the pages controls usingDialogPage.dispose
.Returns the container of this wizard.Returns the default page image for this wizard.Returns the dialog settings for this wizard.Returns the minimum size of this wizard.getNextPage
(IWizardPage page) Returns the successor of the given page.Returns the wizard page with the given name belonging to this wizard.int
Returns the number of pages in this wizard.getPages()
Returns all the pages in this wizard.getPreviousPage
(IWizardPage page) Returns the predecessor of the given page.getShell()
Returns the wizard's shell if the wizard is visible.Returns the first page to be shown in this wizard.Returns the title bar color for this wizard.Returns the window title string for this wizard.boolean
Returns whether help is available for this wizard.boolean
Returns whether this wizard needs Previous and Next buttons.boolean
Returns whether this wizard needs a progress monitor.boolean
TheWizard
implementation of thisIWizard
method does nothing and returnstrue
.abstract boolean
Subclasses must implement thisIWizard
method to perform any special finish processing for their wizard.void
setContainer
(IWizardContainer wizardContainer) Sets or clears the container of this wizard.void
setDefaultPageImageDescriptor
(ImageDescriptor imageDescriptor) Sets the default page image descriptor for this wizard.void
setDialogSettings
(IDialogSettings settings) Sets the dialog settings for this wizard.void
setForcePreviousAndNextButtons
(boolean b) Controls whether the wizard needs Previous and Next buttons even if it currently contains only one page.void
setHelpAvailable
(boolean b) Sets whether help is available for this wizard.void
setNeedsProgressMonitor
(boolean b) Sets whether this wizard needs a progress monitor.void
setTitleBarColor
(RGB color) Sets the title bar color for this wizard.void
setWindowTitle
(String newTitle) Sets the window title for the container that hosts this page to the given string.
-
Field Details
-
DEFAULT_IMAGE
Image registry key of the default image for wizard pages (value"org.eclipse.jface.wizard.Wizard.pageImage"
).- See Also:
-
-
Constructor Details
-
Wizard
protected Wizard()Creates a new empty wizard.
-
-
Method Details
-
addPage
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()TheWizard
implementation of thisIWizard
method does nothing. Subclasses should extend if extra pages need to be added before the wizard opens. New pages should be added by callingaddPage
. -
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.
-
createPageControls
TheWizard
implementation of thisIWizard
method creates all the pages controls usingIDialogPage.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 interfaceIWizard
- Parameters:
pageContainer
- the parent control
-
dispose
public void dispose()TheWizard
implementation of thisIWizard
method disposes all the pages controls usingDialogPage.dispose
. Subclasses should extend this method if the wizard instance maintains addition SWT resource that need to be disposed. -
getContainer
Description copied from interface:IWizard
Returns the container of this wizard.- Specified by:
getContainer
in interfaceIWizard
- Returns:
- the wizard container, or
null
if this wizard has yet to be added to a container
-
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 interfaceIWizard
- Returns:
- the default page image
-
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 interfaceIWizard
- Returns:
- the dialog settings, or
null
if none
-
getNextPage
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 interfaceIWizard
- Parameters:
page
- the page- Returns:
- the next page, or
null
if none
-
getPage
Description copied from interface:IWizard
Returns the wizard page with the given name belonging to this wizard. -
getPageCount
public int getPageCount()Description copied from interface:IWizard
Returns the number of pages in this wizard.- Specified by:
getPageCount
in interfaceIWizard
- Returns:
- the number of wizard pages
-
getPages
Description copied from interface:IWizard
Returns all the pages in this wizard. -
getPreviousPage
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 interfaceIWizard
- Parameters:
page
- the page- Returns:
- the previous page, or
null
if none
-
getShell
Returns the wizard's shell if the wizard is visible. Otherwisenull
is returned.- Specified by:
getShell
in interfaceIShellProvider
- Returns:
- Shell
-
getStartingPage
Description copied from interface:IWizard
Returns the first page to be shown in this wizard.- Specified by:
getStartingPage
in interfaceIWizard
- Returns:
- the first wizard page
-
getTitleBarColor
Description copied from interface:IWizard
Returns the title bar color for this wizard.- Specified by:
getTitleBarColor
in interfaceIWizard
- Returns:
- the title bar color
-
getWindowTitle
Description copied from interface:IWizard
Returns the window title string for this wizard.- Specified by:
getWindowTitle
in interfaceIWizard
- Returns:
- the window title string, or
null
for no title
-
getMinimumWizardSize
Description copied from interface:IWizard
Returns the minimum size of this wizard. The minimum size is calculated using the minimum page sizes of all wizard pages. May returnnull
if none of the wizard pages specify a minimum size.- Specified by:
getMinimumWizardSize
in interfaceIWizard
- Returns:
- the minimum size encoded as
new Point(width,height)
- See Also:
-
isHelpAvailable
public boolean isHelpAvailable()Description copied from interface:IWizard
Returns whether help is available for this wizard.The result of this method is typically used by the container to show or hide a button labeled "Help".
Note: This wizard's container might be a
TrayDialog
which provides its own help support that is independent of this property.Note 2: In the default
WizardDialog
implementation, the "Help" button only works whenIDialogPage.performHelp()
is implemented.- Specified by:
isHelpAvailable
in interfaceIWizard
- Returns:
true
if help is available,false
otherwise- See Also:
-
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 interfaceIWizard
- Returns:
true
if Previous and Next buttons are required, andfalse
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 interfaceIWizard
- Returns:
true
if a progress monitor is required, andfalse
if none is needed
-
performCancel
public boolean performCancel()TheWizard
implementation of thisIWizard
method does nothing and returnstrue
. Subclasses should reimplement this method if they need to perform any special cancel processing for their wizard.- Specified by:
performCancel
in interfaceIWizard
- Returns:
true
to indicate the cancel request was accepted, andfalse
to indicate that the cancel request was refused
-
performFinish
public abstract boolean performFinish()Subclasses must implement thisIWizard
method to perform any special finish processing for their wizard.- Specified by:
performFinish
in interfaceIWizard
- Returns:
true
to indicate the finish request was accepted, andfalse
to indicate that the finish request was refused
-
setContainer
Description copied from interface:IWizard
Sets or clears the container of this wizard.- Specified by:
setContainer
in interfaceIWizard
- Parameters:
wizardContainer
- the wizard container, ornull
-
setDefaultPageImageDescriptor
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
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, ornull
if none- See Also:
-
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, andfalse
to suppress Next and Previous buttons for single page wizards
-
setHelpAvailable
public void setHelpAvailable(boolean b) Sets whether help is available for this wizard.The result of this method is typically used by the container to show or hide the button labeled "Help".
Note: This wizard's container might be a
TrayDialog
which provides its own help support that is independent of this property.Note 2: In the default
WizardDialog
implementation, the "Help" button only works whenIDialogPage.performHelp()
is implemented.- Parameters:
b
-true
if help is available,false
otherwise- See Also:
-
setNeedsProgressMonitor
public void setNeedsProgressMonitor(boolean b) Sets whether this wizard needs a progress monitor.- Parameters:
b
-true
if a progress monitor is required, andfalse
if none is needed- See Also:
-
setTitleBarColor
Sets the title bar color for this wizard.- Parameters:
color
- the title bar color
-
setWindowTitle
Sets the window title for the container that hosts this page to the given string.- Parameters:
newTitle
- the window title for the container
-