org.xwiki.gwt.user.client.ui.wizard
Interface WizardStep

All Known Implementing Classes:
AbstractAutoSubmitWizardStep, AbstractEntityListSelectorWizardStep, AbstractExplorerWizardStep, AbstractExternalLinkWizardStep, AbstractFileUploadWizardStep, AbstractInteractiveWizardStep, AbstractListSelectorWizardStep, AbstractMacroWizardStep, AbstractNavigationAwareWizardStep, AbstractPageListSelectorWizardStep, AbstractSelectorAggregatorWizardStep, AbstractSelectorWizardStep, AttachmentExplorerWizardStep, AttachmentSelectorAggregatorWizardStep, CreateNewPageWizardStep, CurrentPageAttachmentSelectorWizardStep, CurrentPageImageSelectorWizardStep, EditGadgetWizardStep, EditMacroWizardStep, EmailAddressLinkWizardStep, ImageConfigWizardStep, ImageDispatcherWizardStep, ImagesExplorerWizardStep, ImportOfficeFileWizardStep, ImportOfficePasteWizardStep, LinkConfigWizardStep, LinkDispatcherWizardStep, LinkUploadWizardStep, PageSelectorWizardStep, RecentChangesSelectorWizardStep, ResourceReferenceParserWizardStep, ResourceReferenceSerializerWizardStep, SearchSelectorWizardStep, SelectGadgetWizardStep, SelectMacroWizardStep, TableConfigWizardStep, URLImageSelectorWizardStep, WebPageLinkWizardStep, WikiPageExplorerWizardStep

public interface WizardStep

Defines the behavior of a wizard step.


Method Summary
 com.google.gwt.user.client.ui.Widget display()
          This method is called right after the wizard step has been successfully initialized.
 String getDirectionName(NavigationListener.NavigationDirection direction)
          Allows this step to overwrite the default printed for the navigation directions.
 String getNextStep()
          Returns the key of the next step in the wizard.
 Object getResult()
           
 String getStepTitle()
           
 EnumSet<NavigationListener.NavigationDirection> getValidDirections()
           
 void init(Object data, com.google.gwt.user.client.rpc.AsyncCallback<?> callback)
          Initializes the current wizard step, according to the passed data.
 boolean isAutoSubmit()
           
 void onCancel()
          Called before canceling the current wizard step.
 void onSubmit(com.google.gwt.user.client.rpc.AsyncCallback<Boolean> callback)
          Called before submitting the current wizard step.
 

Method Detail

init

void init(Object data,
          com.google.gwt.user.client.rpc.AsyncCallback<?> callback)
Initializes the current wizard step, according to the passed data. This method is called before the wizard step is displayed, on both navigation directions. The input data is either the data the wizard was started with or the data returned by the getResult() method of the previous step. The callback parameter should handle the asynchronous initialization of this wizard step.

Parameters:
data - an object to pass to the wizard step, which can contain configuration data
callback - the object to be notified when the wizard step has finished initializing

display

com.google.gwt.user.client.ui.Widget display()
This method is called right after the wizard step has been successfully initialized.

Returns:
the UI representation of this wizard step

getStepTitle

String getStepTitle()
Returns:
the title of the current step, as it should be displayed when the step is shown

getResult

Object getResult()
Returns:
the result of the current step, in its current state. The result of the current wizard step will be used as the input for the next step in the wizard chain, either the next (as returned by getNextStep()) or the previous in the navigation stack.

onSubmit

void onSubmit(com.google.gwt.user.client.rpc.AsyncCallback<Boolean> callback)
Called before submitting the current wizard step. Here is the point to do validation and to compute the current result of the dialog as well as the next step name. The asynchronous callback result (true or false) will be used to determine if the submit should continue or it should be prevented.

Parameters:
callback - the object to be notified when the submit is done; pass true to notify that the submit was successful and the wizard can move to the next step; pass false if the user needs to adjust the submitted data

isAutoSubmit

boolean isAutoSubmit()
Returns:
true if this step should be submitted automatically, false otherwise; the display() method should return null if the step is submitted automatically

onCancel

void onCancel()
Called before canceling the current wizard step. Here is the point to do all adjustments before the previous dialogs loaded, in the case of a chained wizard.


getNextStep

String getNextStep()
Returns the key of the next step in the wizard. Note that this function is called after onSubmit(AsyncCallback) has returned successfully, so the computing of the next step can be done safely at onSubmit(AsyncCallback) time.

Returns:
the key of the next step in the wizard

getValidDirections

EnumSet<NavigationListener.NavigationDirection> getValidDirections()
Returns:
the set of valid directions from this step

getDirectionName

String getDirectionName(NavigationListener.NavigationDirection direction)
Allows this step to overwrite the default printed for the navigation directions.

Parameters:
direction - the direction to get the name for
Returns:
the String with the direction name or null if the default should be kept