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:
addPagesetHelpAvailablesetDefaultPageImageDescriptorsetDialogSettingssetNeedsProgressMonitorsetTitleBarColorsetWindowTitle
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
FieldsModifier and TypeFieldDescriptionstatic final StringImage registry key of the default image for wizard pages (value"org.eclipse.jface.wizard.Wizard.pageImage"). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPage(IWizardPage page) Adds a new page to this wizard.voidaddPages()TheWizardimplementation of thisIWizardmethod does nothing.booleanReturns whether this wizard could be finished without further user interaction.voidcreatePageControls(Composite pageContainer) TheWizardimplementation of thisIWizardmethod creates all the pages controls usingIDialogPage.createControl.voiddispose()TheWizardimplementation of thisIWizardmethod 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.intReturns 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.booleanReturns whether help is available for this wizard.booleanReturns whether this wizard needs Previous and Next buttons.booleanReturns whether this wizard needs a progress monitor.booleanTheWizardimplementation of thisIWizardmethod does nothing and returnstrue.abstract booleanSubclasses must implement thisIWizardmethod to perform any special finish processing for their wizard.voidsetContainer(IWizardContainer wizardContainer) Sets or clears the container of this wizard.voidsetDefaultPageImageDescriptor(ImageDescriptor imageDescriptor) Sets the default page image descriptor for this wizard.voidsetDialogSettings(IDialogSettings settings) Sets the dialog settings for this wizard.voidsetForcePreviousAndNextButtons(boolean b) Controls whether the wizard needs Previous and Next buttons even if it currently contains only one page.voidsetHelpAvailable(boolean b) Sets whether help is available for this wizard.voidsetNeedsProgressMonitor(boolean b) Sets whether this wizard needs a progress monitor.voidsetTitleBarColor(RGB color) Sets the title bar color for this wizard.voidsetWindowTitle(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()TheWizardimplementation of thisIWizardmethod 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:IWizardReturns 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
TheWizardimplementation of thisIWizardmethod 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:
createPageControlsin interfaceIWizard- Parameters:
pageContainer- the parent control
-
dispose
public void dispose()TheWizardimplementation of thisIWizardmethod 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:IWizardReturns the container of this wizard.- Specified by:
getContainerin interfaceIWizard- Returns:
- the wizard container, or
nullif this wizard has yet to be added to a container
-
getDefaultPageImage
Description copied from interface:IWizardReturns the default page image for this wizard.This image can be used for pages which do not supply their own image.
- Specified by:
getDefaultPageImagein interfaceIWizard- Returns:
- the default page image
-
getDialogSettings
Description copied from interface:IWizardReturns 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:
getDialogSettingsin interfaceIWizard- Returns:
- the dialog settings, or
nullif none
-
getNextPage
Description copied from interface:IWizardReturns the successor of the given page.This method is typically called by a wizard page
- Specified by:
getNextPagein interfaceIWizard- Parameters:
page- the page- Returns:
- the next page, or
nullif none
-
getPage
Description copied from interface:IWizardReturns the wizard page with the given name belonging to this wizard. -
getPageCount
public int getPageCount()Description copied from interface:IWizardReturns the number of pages in this wizard.- Specified by:
getPageCountin interfaceIWizard- Returns:
- the number of wizard pages
-
getPages
Description copied from interface:IWizardReturns all the pages in this wizard. -
getPreviousPage
Description copied from interface:IWizardReturns the predecessor of the given page.This method is typically called by a wizard page
- Specified by:
getPreviousPagein interfaceIWizard- Parameters:
page- the page- Returns:
- the previous page, or
nullif none
-
getShell
Returns the wizard's shell if the wizard is visible. Otherwisenullis returned.- Specified by:
getShellin interfaceIShellProvider- Returns:
- Shell
-
getStartingPage
Description copied from interface:IWizardReturns the first page to be shown in this wizard.- Specified by:
getStartingPagein interfaceIWizard- Returns:
- the first wizard page
-
getTitleBarColor
Description copied from interface:IWizardReturns the title bar color for this wizard.- Specified by:
getTitleBarColorin interfaceIWizard- Returns:
- the title bar color
-
getWindowTitle
Description copied from interface:IWizardReturns the window title string for this wizard.- Specified by:
getWindowTitlein interfaceIWizard- Returns:
- the window title string, or
nullfor no title
-
getMinimumWizardSize
Description copied from interface:IWizardReturns the minimum size of this wizard. The minimum size is calculated using the minimum page sizes of all wizard pages. May returnnullif none of the wizard pages specify a minimum size.- Specified by:
getMinimumWizardSizein interfaceIWizard- Returns:
- the minimum size encoded as
new Point(width,height) - See Also:
-
isHelpAvailable
public boolean isHelpAvailable()Description copied from interface:IWizardReturns 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
TrayDialogwhich provides its own help support that is independent of this property.Note 2: In the default
WizardDialogimplementation, the "Help" button only works whenIDialogPage.performHelp()is implemented.- Specified by:
isHelpAvailablein interfaceIWizard- Returns:
trueif help is available,falseotherwise- See Also:
-
needsPreviousAndNextButtons
public boolean needsPreviousAndNextButtons()Description copied from interface:IWizardReturns whether this wizard needs Previous and Next buttons.The result of this method is typically used by the container.
- Specified by:
needsPreviousAndNextButtonsin interfaceIWizard- Returns:
trueif Previous and Next buttons are required, andfalseif none are needed
-
needsProgressMonitor
public boolean needsProgressMonitor()Description copied from interface:IWizardReturns whether this wizard needs a progress monitor.The result of this method is typically used by the container.
- Specified by:
needsProgressMonitorin interfaceIWizard- Returns:
trueif a progress monitor is required, andfalseif none is needed
-
performCancel
public boolean performCancel()TheWizardimplementation of thisIWizardmethod does nothing and returnstrue. Subclasses should reimplement this method if they need to perform any special cancel processing for their wizard.- Specified by:
performCancelin interfaceIWizard- Returns:
trueto indicate the cancel request was accepted, andfalseto indicate that the cancel request was refused
-
performFinish
public abstract boolean performFinish()Subclasses must implement thisIWizardmethod to perform any special finish processing for their wizard.- Specified by:
performFinishin interfaceIWizard- Returns:
trueto indicate the finish request was accepted, andfalseto indicate that the finish request was refused
-
setContainer
Description copied from interface:IWizardSets or clears the container of this wizard.- Specified by:
setContainerin 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, ornullif 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-trueto always show Next and Previous buttons, andfalseto 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
TrayDialogwhich provides its own help support that is independent of this property.Note 2: In the default
WizardDialogimplementation, the "Help" button only works whenIDialogPage.performHelp()is implemented.- Parameters:
b-trueif help is available,falseotherwise- See Also:
-
setNeedsProgressMonitor
public void setNeedsProgressMonitor(boolean b) Sets whether this wizard needs a progress monitor.- Parameters:
b-trueif a progress monitor is required, andfalseif 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
-