org.xwiki.gwt.user.client.ui.wizard
Class WizardDialog

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by org.xwiki.gwt.user.client.ui.CompositeDialogBox
                  extended by org.xwiki.gwt.user.client.ui.ComplexDialogBox
                      extended by org.xwiki.gwt.user.client.ui.wizard.WizardDialog
All Implemented Interfaces:
com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel>, com.google.gwt.event.logical.shared.HasCloseHandlers<CompositeDialogBox>, com.google.gwt.event.shared.EventHandler, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, SourcesNavigationEvents

public class WizardDialog
extends ComplexDialogBox
implements SourcesNavigationEvents

Wizard dialog class, used to display the current wizard step.

Version:
$Id: WizardDialog.java 27017 2010-02-14 18:47:53Z mflorea $

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
WizardDialog(java.lang.String title, com.google.gwt.user.client.ui.Image icon)
          Builds a wizard dialog with the passed title and icon.
 
Method Summary
protected  void addButton(WizardStep step, NavigationListener.NavigationDirection direction, com.google.gwt.user.client.ui.Panel container, java.lang.String defaultLabel)
          Adds the button for the specified direction for the step in the passed container.
 void addNavigationListener(NavigationListener listener)
          Adds the listener to the list of listeners for the navigation events launched by this source.
 void displayStep(WizardStep step, boolean hasPrevious)
          Displays the passed wizard step in this dialog.
protected  void fillButtonsContainers(WizardStep step, boolean hasPrevious)
          Fill the buttons containers according to the passed wizard step valid directions.
 void removeNavigationListener(NavigationListener listener)
          Removes the listener from the list of listeners for the navigation events launched by this source.
 void setCanceled(boolean canceled)
          Sets the canceled state of this dialog.
 void setLoading(boolean loading)
          Toggles the loading state on the current dialog (busy icon and disabled buttons).
 void showError(java.lang.Throwable caught)
          If an error occurred on the server while fulfilling the request then this method can be used to display the error message to the user.
 
Methods inherited from class org.xwiki.gwt.user.client.ui.ComplexDialogBox
center, getBody, getFooter, getHeader, isCanceled, isLoading
 
Methods inherited from class org.xwiki.gwt.user.client.ui.CompositeDialogBox
addCloseHandler, getDialog, hide, initWidget, isShowing, onClose
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getWidget, isAttached, onAttach, onBrowserEvent, onDetach, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addDomHandler, addHandler, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

WizardDialog

public WizardDialog(java.lang.String title,
                    com.google.gwt.user.client.ui.Image icon)
Builds a wizard dialog with the passed title and icon.

Parameters:
title - the title of this wizard dialog
icon - the icon of this wizard dialog
Method Detail

displayStep

public void displayStep(WizardStep step,
                        boolean hasPrevious)
Displays the passed wizard step in this dialog.

Parameters:
step - the step to display in this dialog
hasPrevious - true if the currently displayed step has a previous step in the wizard, false otherwise.

setLoading

public void setLoading(boolean loading)
Toggles the loading state on the current dialog (busy icon and disabled buttons).

Overrides:
setLoading in class ComplexDialogBox
Parameters:
loading - true if the dialog should enter the loading state, false if it should exit.

showError

public void showError(java.lang.Throwable caught)
If an error occurred on the server while fulfilling the request then this method can be used to display the error message to the user.

Expose the protected ComplexDialogBox.showError(Throwable) method.

Overrides:
showError in class ComplexDialogBox
Parameters:
caught - the exception that has been caught
See Also:
ComplexDialogBox.showError(Throwable)

fillButtonsContainers

protected void fillButtonsContainers(WizardStep step,
                                     boolean hasPrevious)
Fill the buttons containers according to the passed wizard step valid directions. The second parameter specifies whether there exists a previous dialog on the current navigation stack. The previous button will be shown only if such exists and NavigationListener.NavigationDirection.PREVIOUS is valid for the current step.

Parameters:
step - the current wizard step
hasPrevious - true if the previous button can be displayed (i.e. there is a previous step in the displayed wizard), false otherwise.

addButton

protected void addButton(WizardStep step,
                         NavigationListener.NavigationDirection direction,
                         com.google.gwt.user.client.ui.Panel container,
                         java.lang.String defaultLabel)
Adds the button for the specified direction for the step in the passed container.

Parameters:
step - the step to process (add buttons for)
direction - the direction of the button to add
container - the UI container in which the button needs to be added
defaultLabel - the default label of the button, if the step does not specify any.

addNavigationListener

public void addNavigationListener(NavigationListener listener)
Adds the listener to the list of listeners for the navigation events launched by this source.

Specified by:
addNavigationListener in interface SourcesNavigationEvents
Parameters:
listener - the listener to add
See Also:
SourcesNavigationEvents.addNavigationListener(NavigationListener)

removeNavigationListener

public void removeNavigationListener(NavigationListener listener)
Removes the listener from the list of listeners for the navigation events launched by this source.

Specified by:
removeNavigationListener in interface SourcesNavigationEvents
Parameters:
listener - the listener to remove
See Also:
SourcesNavigationEvents.removeNavigationListener(NavigationListener)

setCanceled

public void setCanceled(boolean canceled)
Sets the canceled state of this dialog.

Expose the protected ComplexDialogBox.setCanceled(boolean) method.

Overrides:
setCanceled in class ComplexDialogBox
Parameters:
canceled - true if the dialog was canceled, false otherwise
See Also:
ComplexDialogBox.setCanceled(boolean)


Copyright © 2004-2011 XWiki. All Rights Reserved.