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

All Known Implementing Classes:
AbstractCompositeWizardStep, AbstractNavigationAwareWizardStep

public interface WizardStep

Defines the behavior of a wizard step.

Version:
$Id: WizardStep.java 28843 2010-05-12 12:46:22Z mflorea $

Method Summary
 com.google.gwt.user.client.ui.Widget display()
           
 java.lang.String getDirectionName(NavigationListener.NavigationDirection direction)
          Allows this step to overwrite the default printed for the navigation directions.
 java.lang.String getNextStep()
          Returns the key of the next step in the wizard.
 java.lang.Object getResult()
           
 java.lang.String getStepTitle()
           
 java.util.EnumSet<NavigationListener.NavigationDirection> getValidDirections()
           
 void init(java.lang.Object data, com.google.gwt.user.client.rpc.AsyncCallback<?> cb)
          Initializes the current wizard step, according to the passed data.
 void onCancel()
          Called before canceling the current wizard step.
 void onSubmit(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Boolean> async)
          Called before submitting the current wizard step.
 

Method Detail

init

void init(java.lang.Object data,
          com.google.gwt.user.client.rpc.AsyncCallback<?> cb)
Initializes the current wizard step, according to the passed data. The state of the current wizard step should be entirely computed from the passed input data. This function will be called always on showing the dialog for this wizard step (both when shown as next and when shown as previous), with the data obtained from the getResult() function of the previous step. The cb parameter should handle the asynchronous initialization of this wizard step, and should return normally through onSuccess() and error through onFailure().

Parameters:
data - an object to pass to the wizard step, which can contain configuration data, etc.
cb - callback to handle asynchronous loading of this wizard step

display

com.google.gwt.user.client.ui.Widget display()
Returns:
the UI representation of this wizard step

getStepTitle

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

getResult

java.lang.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 dialog in the 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<java.lang.Boolean> async)
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:
async - asynchronous callback to handle asynchronous nature of this function (in case of validation on the server side, for example).

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

java.lang.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

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

getDirectionName

java.lang.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


Copyright © 2004-2011 XWiki. All Rights Reserved.