sk.uniba.euromath.editor.wizards
Class WizardDialog

java.lang.Object
  extended by org.eclipse.jface.window.Window
      extended by org.eclipse.jface.dialogs.Dialog
          extended by org.eclipse.jface.dialogs.TrayDialog
              extended by org.eclipse.jface.dialogs.TitleAreaDialog
                  extended by sk.uniba.euromath.editor.wizards.WizardDialog
All Implemented Interfaces:
IPageChangeProvider, IShellProvider

public final class WizardDialog
extends TitleAreaDialog
implements IPageChangeProvider

A dialog to show a wizard to the end user.

In typical usage, the client instantiates this class with a particular wizard. The dialog serves as the wizard container and orchestrates the presentation of its pages.

The standard layout is roughly as follows: it has an area at the top containing both the wizard's title, description, and image; the actual wizard page appears in the middle; below that is a progress indicator (which is made visible if needed); and at the bottom of the page is message line and a button bar containing Help, Next, Back, Finish, and Cancel buttons (or some subset).

Wizard is not disposed when the dialog exits.


Nested Class Summary
protected  class WizardDialog.PageContainerFillLayout
          A layout for a container which includes several pages, like a notebook, wizard, or preference dialog.
 
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
Window.IExceptionHandler
 
Field Summary
static String WIZ_IMG_ERROR
          Image registry key for error message image (value "dialog_title_error_image").
 
Fields inherited from class org.eclipse.jface.dialogs.TitleAreaDialog
DLG_IMG_TITLE_BANNER, DLG_IMG_TITLE_ERROR, INFO_MESSAGE, WARNING_MESSAGE
 
Fields inherited from class org.eclipse.jface.dialogs.Dialog
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS
 
Fields inherited from class org.eclipse.jface.window.Window
CANCEL, OK
 
Constructor Summary
WizardDialog(Shell parentShell, IWizard newWizard, String processName)
          Creates a new wizard dialog for the given wizard.
 
Method Summary
 void addPageChangedListener(IPageChangedListener listener)
           
protected  void backPressed()
          The Back button has been pressed.
protected  void buttonPressed(int buttonId)
           
protected  void cancelPressed()
           
 boolean close()
           
protected  void configureShell(Shell newShell)
           
protected  Control createButtonBar(Composite parent)
          Creates and returns the contents of this dialog's button bar.
protected  void createButtonsForButtonBar(Composite parent)
           
protected  Control createContents(Composite parent)
          The WizardDialog implementation of this Window method calls super.createContents to create the controls.
protected  Control createDialogArea(Composite parent)
           
protected  void finishPressed()
          The Finish button has been pressed.
protected  void firePageChanged()
          Notifies any selection changed listeners that the selected page has changed.
protected  Button getButton(int id)
          Return the cancel button if the id is a the cancel id.
 BaseWizardPage getCurrentPage()
          Returns page, currently shown on screen.
 String getErrorMessage()
          Returns current error message.
 String getMessage()
          Returns current message.
 int getMessageType()
          Returns current message's level.
 Object getSelectedPage()
           
protected  IWizard getWizard()
          Returns the wizard this dialog is currently displaying.
protected  void nextPressed()
          The Next button has been pressed.
 void removePageChangedListener(IPageChangedListener listener)
           
 void setErrorMessage(String newErrorMessage)
           
 void setMessage(String newMessage, int newType)
           
 void setMinimumPageSize(int minWidth, int minHeight)
          Sets the minimum page size used for the pages.
 void setMinimumPageSize(Point size)
          Sets the minimum page size used for the pages.
 void setPageSize(int width, int height)
          Sets the size of all pages.
 void setPageSize(Point size)
          Sets the size of all pages.
protected  void update()
          Updates this dialog's controls to reflect the current page.
 void updateSize()
          Updates size of the window.
protected  void updateSize(Composite tile)
          Computes the correct dialog size for the current page and resizes its shell if nessessary.
 
Methods inherited from class org.eclipse.jface.dialogs.TitleAreaDialog
getInitialSize, getTitleArea, getTitleImageLabel, setMessage, setTitle, setTitleAreaColor, setTitleImage
 
Methods inherited from class org.eclipse.jface.dialogs.TrayDialog
closeTray, createHelpControl, getLayout, getTray, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailable
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, dialogFontIsDefault, getBlockedHandler, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getOKButton, initializeBounds, initializeDialogUnits, okPressed, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WIZ_IMG_ERROR

public static final String WIZ_IMG_ERROR
Image registry key for error message image (value "dialog_title_error_image").

See Also:
Constant Field Values
Constructor Detail

WizardDialog

public WizardDialog(Shell parentShell,
                    IWizard newWizard,
                    String processName)
Creates a new wizard dialog for the given wizard.

Parameters:
parentShell - the parent shell
newWizard - the wizard this dialog is working on
processName - the name of the functionality that the wizard provides. Shown in the window caption.
Method Detail

configureShell

protected void configureShell(Shell newShell)
Overrides:
configureShell in class Window

backPressed

protected void backPressed()
The Back button has been pressed.


buttonPressed

protected void buttonPressed(int buttonId)
Overrides:
buttonPressed in class Dialog

cancelPressed

protected void cancelPressed()
Overrides:
cancelPressed in class Dialog

close

public boolean close()
Overrides:
close in class TrayDialog

createButtonBar

protected Control createButtonBar(Composite parent)
Creates and returns the contents of this dialog's button bar.

The WizardDialog implementation of this framework method prevents the composite's columns from being made equal width in order to remove the margin between the Back and Next buttons.

Overrides:
createButtonBar in class TrayDialog
Parameters:
parent - the parent composite to contain the button bar
Returns:
the button bar control

createButtonsForButtonBar

protected void createButtonsForButtonBar(Composite parent)
Overrides:
createButtonsForButtonBar in class Dialog

getButton

protected Button getButton(int id)
Return the cancel button if the id is a the cancel id.

Overrides:
getButton in class Dialog
Parameters:
id - the button id
Returns:
the button corresponding to the button id

createContents

protected Control createContents(Composite parent)
The WizardDialog implementation of this Window method calls super.createContents to create the controls. Then it shows the first page.

Overrides:
createContents in class TitleAreaDialog

createDialogArea

protected Control createDialogArea(Composite parent)
Overrides:
createDialogArea in class TitleAreaDialog

finishPressed

protected void finishPressed()
The Finish button has been pressed.


getCurrentPage

public BaseWizardPage getCurrentPage()
Returns page, currently shown on screen.

Returns:
currently shown page.

getWizard

protected IWizard getWizard()
Returns the wizard this dialog is currently displaying.

Returns:
the current wizard

nextPressed

protected void nextPressed()
The Next button has been pressed.


setMinimumPageSize

public void setMinimumPageSize(int minWidth,
                               int minHeight)
Sets the minimum page size used for the pages.

Parameters:
minWidth - the minimum page width
minHeight - the minimum page height
See Also:
setMinimumPageSize(Point)

setMinimumPageSize

public void setMinimumPageSize(Point size)
Sets the minimum page size used for the pages.

Parameters:
size - the page size encoded as new Point(width,height)
See Also:
setMinimumPageSize(int,int)

setPageSize

public void setPageSize(int width,
                        int height)
Sets the size of all pages. The given size takes precedence over computed sizes.

Parameters:
width - the page width
height - the page height
See Also:
setPageSize(Point)

setPageSize

public void setPageSize(Point size)
Sets the size of all pages. The given size takes precedence over computed sizes.

Parameters:
size - the page size encoded as new Point(width,height)
See Also:
setPageSize(int,int)

update

protected void update()
Updates this dialog's controls to reflect the current page.


setMessage

public void setMessage(String newMessage,
                       int newType)
Overrides:
setMessage in class TitleAreaDialog

setErrorMessage

public void setErrorMessage(String newErrorMessage)
Overrides:
setErrorMessage in class TitleAreaDialog

getErrorMessage

public String getErrorMessage()
Returns current error message.

Returns:
current error message.

getMessage

public String getMessage()
Returns current message.

Returns:
current message.

getMessageType

public int getMessageType()
Returns current message's level.

Returns:
current message's level.

updateSize

protected void updateSize(Composite tile)
Computes the correct dialog size for the current page and resizes its shell if nessessary. Also causes the container to refresh its layout.

Parameters:
tile - the composite where the wizard page is placed, to use to resize the dialog
Since:
2.0

updateSize

public void updateSize()
Updates size of the window.


getSelectedPage

public Object getSelectedPage()
Specified by:
getSelectedPage in interface IPageChangeProvider

addPageChangedListener

public void addPageChangedListener(IPageChangedListener listener)
Specified by:
addPageChangedListener in interface IPageChangeProvider

removePageChangedListener

public void removePageChangedListener(IPageChangedListener listener)
Specified by:
removePageChangedListener in interface IPageChangeProvider

firePageChanged

protected void firePageChanged()
Notifies any selection changed listeners that the selected page has changed. Only listeners registered at the time this method is called are notified.

See Also:
IPageChangedListener.pageChanged(org.eclipse.jface.dialogs.PageChangedEvent)


Copyright © 2003-2006 null. All Rights Reserved.