sk.uniba.euromath.editor.wizards
Interface IWizard

All Known Implementing Classes:
CreateAttributeListWizard, InsertListChooserWizard, MultiWizard, OnePageWizard

public interface IWizard

Interface for a wizard. A wizard maintains a list of wizard pages, stacked on top of each other in card layout fashion.

The hasNext() will be queried only in case that the active wizard can finish - this is because next wizard may depend on the contents of active wizard.

Initially the object is be positioned over first wizard (current() returns first wizard). If the provider does not contain any wizards then it may return null.

When the WizardDialog closes, the pages are disposed automatically, but the wizard is not and must be disposed manually. Thus, undisposed wizard may contain disposed pages.

Author:
The Eclipse development team, Martin Vysny

Method Summary
 boolean canFinish()
          Returns whether this wizard could be finished without further user interaction.
 BaseWizardPage current()
          Fetches the current page.
 void dispose()
          Disposes of this wizard.
 String getName()
          Returns name of this wizard.
 RGB getTitleBarColor()
          Returns the title bar color for this wizard.
 boolean hasNext()
          Checks if there is next page.
 boolean hasPrevious()
          Checks if there is previous page.
 BaseWizardPage next()
          Fetches the next page.
 boolean performCancel()
          Performs any actions appropriate in response to the user having pressed the Cancel button, or refuse if canceling now is not permitted.
 boolean performFinish()
          Performs any actions appropriate in response to the user having pressed the Finish button, or refuse if finishing now is not permitted.
 BaseWizardPage previous()
          Fetches the previous page.
 

Method Detail

dispose

void dispose()
Disposes of this wizard. All SWT resources are freed automatically when this method finishes.


getTitleBarColor

RGB getTitleBarColor()
Returns the title bar color for this wizard.

Returns:
the title bar color, or null if default should be used.

performCancel

boolean performCancel()
Performs any actions appropriate in response to the user having pressed the Cancel button, or refuse if canceling now is not permitted.

Returns:
true to indicate the cancel request was accepted, and false to indicate that the cancel request was refused

performFinish

boolean performFinish()
Performs any actions appropriate in response to the user having pressed the Finish button, or refuse if finishing now is not permitted. Normally this method is only called on the container's current wizard. However if the current wizard is a nested wizard this method will also be called on all wizards in its parent chain. Such parents may use this notification to save state etc. However, the value the parents return from this method is ignored.

Returns:
true to indicate the finish request was accepted, and false to indicate that the finish request was refused

current

BaseWizardPage current()
Fetches the current page.

Returns:
current page. May return null only if the provider provides no pages.

next

BaseWizardPage next()
                    throws ProviderException
Fetches the next page. Function may fail even when hasNext() returned true - it may throw ProviderException.

Returns:
next page. The page does not have to be initialized - MultiWizard initializes it for you. Never null.
Throws:
NoSuchElementException - if there is no next page.
ProviderException - if next page instance cannot be constructed because of to some unexpected error. In such case, wizard stays at current page, exception is logged and an error dialog is shown.

previous

BaseWizardPage previous()
Fetches the previous page. Current page is automatically disposed.

Returns:
previous page.
Throws:
NoSuchElementException - if current page is the first wizard.

hasNext

boolean hasNext()
Checks if there is next page. This method must return false if current page contains errors.

Returns:
true if there is next wizard or false if next() will fail.

hasPrevious

boolean hasPrevious()
Checks if there is previous page.

Returns:
true if there is previous wizard or false if previous() will fail.

canFinish

boolean canFinish()
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.

Returns:
true if the wizard could be finished, and false otherwise

getName

String getName()
Returns name of this wizard. Describes this wizard. Shown in the dialog.

Returns:
displayable wizard name, like 'New element contents'.


Copyright © 2003-2006 null. All Rights Reserved.