Package org.eclipse.jface.wizard
Class WizardPage
- java.lang.Object
-
- org.eclipse.jface.dialogs.DialogPage
-
- org.eclipse.jface.wizard.WizardPage
-
- All Implemented Interfaces:
IDialogPage
,IMessageProvider
,IWizardPage
- Direct Known Subclasses:
AcceptLicensesWizardPage
,RefactoringWizardPage
,WizardDataTransferPage
,WizardExternalProjectImportPage
,WizardNewFileCreationPage
,WizardNewFolderMainPage
,WizardNewLinkPage
,WizardNewProjectCreationPage
,WizardNewProjectReferencePage
,WizardSelectionPage
public abstract class WizardPage extends DialogPage implements IWizardPage
An abstract base implementation of a wizard page.Subclasses must implement the
createControl
method to create the specific controls for the wizard page.Subclasses may call the following methods to configure the wizard page:
setDescription
setErrorMessage
setImageDescriptor
setMessage
setPageComplete
setPreviousPage
setTitle
Subclasses may override these methods if required:
performHelp
- may be reimplemented to display help for the pagecanFlipToNextPage
- may be extended or reimplementedisPageComplete
- may be extendedsetDescription
- may be extendedsetTitle
- may be extendeddispose
- may be extended to dispose additional allocated SWT resources
Note that clients are free to implement
IWizardPage
from scratch instead of subclassingWizardPage
. Correct implementations ofIWizardPage
will work with any correct implementation ofIWizard
.
-
-
Field Summary
-
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
WizardPage(String pageName)
Creates a new wizard page with the given name, and with no title or image.protected
WizardPage(String pageName, String title, ImageDescriptor titleImage)
Creates a new wizard page with the given name, title, and image.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canFlipToNextPage()
TheWizardPage
implementation of thisIWizardPage
method returnstrue
if this page is complete (isPageComplete
) and there is a next page to flip to.protected IWizardContainer
getContainer()
Returns the wizard container for this wizard page.protected IDialogSettings
getDialogSettings()
Returns the dialog settings for this wizard page.Image
getImage()
Returns this dialog page's image.String
getName()
Returns this page's name.IWizardPage
getNextPage()
Returns the wizard page that would to be shown if the user was to press the Next button.IWizardPage
getPreviousPage()
Returns the wizard page that would to be shown if the user was to press the Back button.Shell
getShell()
TheWizardPage
implementation of this method declared onDialogPage
returns the shell of the container.IWizard
getWizard()
Returns the wizard that hosts this wizard page.protected boolean
isCurrentPage()
Returns whether this page is the current one in the wizard's container.boolean
isPageComplete()
TheWizardPage
implementation of thisIWizard
method returns the value of an internal state variable set bysetPageComplete
.void
setDescription(String description)
TheWizardPage
implementation of thisIDialogPage
method extends theDialogPage
implementation to update the wizard container title bar.void
setErrorMessage(String newMessage)
TheWizardPage
implementation of this method declared onDialogPage
updates the container if this is the current page.void
setImageDescriptor(ImageDescriptor image)
TheWizardPage
implementation of this method declared onDialogPage
updates the container if this page is the current page.void
setMessage(String newMessage, int newType)
TheWizardPage
implementation of this method declared onDialogPage
updates the container if this is the current page.void
setPageComplete(boolean complete)
Sets whether this page is complete.void
setPreviousPage(IWizardPage page)
Sets the wizard page that would typically be shown if the user was to press the Back button.void
setTitle(String title)
TheWizardPage
implementation of thisIDialogPage
method extends theDialogPage
implementation to update the wizard container title bar.void
setWizard(IWizard newWizard)
Sets the wizard that hosts this wizard page.String
toString()
Returns a printable representation of this wizard page suitable only for debug purposes.-
Methods inherited from class org.eclipse.jface.dialogs.DialogPage
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, dispose, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getMessage, getMessageType, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, performHelp, setButtonLayoutData, setControl, setMessage, setVisible
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
createControl, dispose, getControl, getDescription, getErrorMessage, getMessage, getTitle, performHelp, setVisible
-
-
-
-
Constructor Detail
-
WizardPage
protected WizardPage(String pageName)
Creates a new wizard page with the given name, and with no title or image.- Parameters:
pageName
- the name of the page
-
WizardPage
protected WizardPage(String pageName, String title, ImageDescriptor titleImage)
Creates a new wizard page with the given name, title, and image.- Parameters:
pageName
- the name of the pagetitle
- the title for this wizard page, ornull
if nonetitleImage
- the image descriptor for the title of this wizard page, ornull
if none
-
-
Method Detail
-
canFlipToNextPage
public boolean canFlipToNextPage()
TheWizardPage
implementation of thisIWizardPage
method returnstrue
if this page is complete (isPageComplete
) and there is a next page to flip to. Subclasses may override (extend or reimplement).- Specified by:
canFlipToNextPage
in interfaceIWizardPage
- Returns:
true
if the next page could be displayed, andfalse
otherwise- See Also:
getNextPage()
,isPageComplete()
-
getContainer
protected IWizardContainer getContainer()
Returns the wizard container for this wizard page.- Returns:
- the wizard container, or
null
if this wizard page has yet to be added to a wizard, or the wizard has yet to be added to a container
-
getDialogSettings
protected IDialogSettings getDialogSettings()
Returns the dialog settings for this wizard page.- Returns:
- the dialog settings, or
null
if none
-
getImage
public Image getImage()
Description copied from interface:IDialogPage
Returns this dialog page's image.- Specified by:
getImage
in interfaceIDialogPage
- Overrides:
getImage
in classDialogPage
- Returns:
- the image for this dialog page, or
null
if none
-
getName
public String getName()
Description copied from interface:IWizardPage
Returns this page's name.- Specified by:
getName
in interfaceIWizardPage
- Returns:
- the name of this page
-
getNextPage
public IWizardPage getNextPage()
Description copied from interface:IWizardPage
Returns the wizard page that would to be shown if the user was to press the Next button.- Specified by:
getNextPage
in interfaceIWizardPage
- Returns:
- the next wizard page, or
null
if none
-
getPreviousPage
public IWizardPage getPreviousPage()
Description copied from interface:IWizardPage
Returns the wizard page that would to be shown if the user was to press the Back button.- Specified by:
getPreviousPage
in interfaceIWizardPage
- Returns:
- the previous wizard page, or
null
if none
-
getShell
public Shell getShell()
TheWizardPage
implementation of this method declared onDialogPage
returns the shell of the container. The advantage of this implementation is that the shell is accessable once the container is created even though this page's control may not yet be created.- Overrides:
getShell
in classDialogPage
- Returns:
- the shell
-
getWizard
public IWizard getWizard()
Description copied from interface:IWizardPage
Returns the wizard that hosts this wizard page.- Specified by:
getWizard
in interfaceIWizardPage
- Returns:
- the wizard, or
null
if this page has not been added to any wizard - See Also:
IWizardPage.setWizard(org.eclipse.jface.wizard.IWizard)
-
isCurrentPage
protected boolean isCurrentPage()
Returns whether this page is the current one in the wizard's container.- Returns:
true
if the page is active, andfalse
otherwise
-
isPageComplete
public boolean isPageComplete()
TheWizardPage
implementation of thisIWizard
method returns the value of an internal state variable set bysetPageComplete
. Subclasses may extend.- Specified by:
isPageComplete
in interfaceIWizardPage
- Returns:
true
if this page is complete, andfalse
otherwise
-
setDescription
public void setDescription(String description)
TheWizardPage
implementation of thisIDialogPage
method extends theDialogPage
implementation to update the wizard container title bar. Subclasses may extend.- Specified by:
setDescription
in interfaceIDialogPage
- Overrides:
setDescription
in classDialogPage
- Parameters:
description
- the description text for this dialog page, ornull
if none
-
setErrorMessage
public void setErrorMessage(String newMessage)
TheWizardPage
implementation of this method declared onDialogPage
updates the container if this is the current page.- Overrides:
setErrorMessage
in classDialogPage
- Parameters:
newMessage
- the message, ornull
to clear the error message
-
setImageDescriptor
public void setImageDescriptor(ImageDescriptor image)
TheWizardPage
implementation of this method declared onDialogPage
updates the container if this page is the current page.- Specified by:
setImageDescriptor
in interfaceIDialogPage
- Overrides:
setImageDescriptor
in classDialogPage
- Parameters:
image
- the image for this dialog page, ornull
if none
-
setMessage
public void setMessage(String newMessage, int newType)
TheWizardPage
implementation of this method declared onDialogPage
updates the container if this is the current page.- Overrides:
setMessage
in classDialogPage
- Parameters:
newMessage
- the message, ornull
to clear the messagenewType
- the message type
-
setPageComplete
public void setPageComplete(boolean complete)
Sets whether this page is complete.This information is typically used by the wizard to decide when it is okay to move on to the next page or finish up.
- Parameters:
complete
-true
if this page is complete, and andfalse
otherwise- See Also:
isPageComplete()
-
setPreviousPage
public void setPreviousPage(IWizardPage page)
Description copied from interface:IWizardPage
Sets the wizard page that would typically be shown if the user was to press the Back button.This method is called by the container.
- Specified by:
setPreviousPage
in interfaceIWizardPage
- Parameters:
page
- the previous wizard page
-
setTitle
public void setTitle(String title)
TheWizardPage
implementation of thisIDialogPage
method extends theDialogPage
implementation to update the wizard container title bar. Subclasses may extend.- Specified by:
setTitle
in interfaceIDialogPage
- Overrides:
setTitle
in classDialogPage
- Parameters:
title
- the title of this dialog page, ornull
if none
-
setWizard
public void setWizard(IWizard newWizard)
Description copied from interface:IWizardPage
Sets the wizard that hosts this wizard page. Once established, a page's wizard cannot be changed to a different wizard.- Specified by:
setWizard
in interfaceIWizardPage
- Parameters:
newWizard
- the wizard- See Also:
IWizardPage.getWizard()
-
-