net.sf.doolin.gui.wizard.descriptor
Class WizardDescriptor<B>

java.lang.Object
  extended by net.sf.doolin.gui.window.descriptor.AbstractGUIWindowDescriptor<B>
      extended by net.sf.doolin.gui.wizard.descriptor.WizardDescriptor<B>
Type Parameters:
B - Type of bean for the wizard
All Implemented Interfaces:
GUIWindowDescriptor<B>, org.springframework.beans.factory.BeanNameAware

public class WizardDescriptor<B>
extends AbstractGUIWindowDescriptor<B>

Window descriptor for a wizard.

Author:
Damien Coraboeuf

Constructor Summary
WizardDescriptor()
          Constructor that fixes the window factory to WizardWindowFactory.
WizardDescriptor(WizardWindowFactory wizardWindowFactory)
          Constructor that uses a custom version of WizardWindowFactory.
 
Method Summary
protected  void arrangeViews(GUIWindow<B> window)
          Arranges the views inside the window.
protected  void arrangeWindow(GUIWindow<B> window)
          Arranges the window.
 String getInitialView()
          Gets the initial view for this wizard
 IWindowFactory getIwindowFactory()
          Gets the factory for the wizard window implementation
protected  GUIViewDescriptor<B> getViewDescriptor(String viewId)
          Gets the actual view descriptor from a view name
 Map<String,GUIViewDescriptor<B>> getViewMap()
          Gets the mapping between view names and actual view descriptors.
 WizardRules<B> getWizardRules()
          Gets the navigation rules for this wizard
 boolean isModal()
          Checks if the wizard must be executed in modal mode or not.
<V> GUIView<V>
openView(GUIWindow<B> parentWindow, GUIViewDescriptor<V> viewDescriptor, V viewData)
          Always return null since a wizard cannot hold views.
 void setInitialView(String initialView)
          Sets the initial view name for this wizard.
 void setIwindowFactory(IWindowFactory iwindowFactory)
          Sets the window implementation factory for this wizard.
 void setModal(boolean modal)
          Sets the modal mode of the wizard
protected  void setViewId(GUIWindow<B> window, String viewId)
          Navigates to a new view.
 void setViewMap(Map<String,GUIViewDescriptor<B>> viewMap)
          Sets the mapping between view names and actual view descriptors.
 void setWindowFactory(GUIWindowFactory windowFactory)
          Sets the window factory for this wizard.
 void setWizardRules(WizardRules<B> wizardRules)
          Sets the navigation rules for this wizard.
 
Methods inherited from class net.sf.doolin.gui.window.descriptor.AbstractGUIWindowDescriptor
activateView, arrange, arrangeActionBars, createWindow, getActionFactory, getCloseAction, getIconId, getIconService, getMenuBar, getSize, getTitleExpression, getToolBars, getWindow, getWindowId, getWindowId, getWindowListeners, hideView, initViewComponent, onCloseWindow, onClosingWindow, onOpenedWindow, setActionFactory, setBeanName, setCloseAction, setIconId, setIconService, setMenuBar, setSize, setTitleExpression, setToolBars, setWindowId, setWindowListeners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WizardDescriptor

public WizardDescriptor()
Constructor that fixes the window factory to WizardWindowFactory.


WizardDescriptor

public WizardDescriptor(WizardWindowFactory wizardWindowFactory)
Constructor that uses a custom version of WizardWindowFactory.

Method Detail

arrangeViews

protected void arrangeViews(GUIWindow<B> window)
Description copied from class: AbstractGUIWindowDescriptor
Arranges the views inside the window.

Specified by:
arrangeViews in class AbstractGUIWindowDescriptor<B>
Parameters:
window - Window to arrange

arrangeWindow

protected void arrangeWindow(GUIWindow<B> window)
Description copied from class: AbstractGUIWindowDescriptor
Arranges the window.

Specified by:
arrangeWindow in class AbstractGUIWindowDescriptor<B>
Parameters:
window - Window

getInitialView

public String getInitialView()
Gets the initial view for this wizard

Returns:
Initial view name

getIwindowFactory

public IWindowFactory getIwindowFactory()
Gets the factory for the wizard window implementation

Returns:
Window implementation factory

getViewDescriptor

protected GUIViewDescriptor<B> getViewDescriptor(String viewId)
Gets the actual view descriptor from a view name

Parameters:
viewId - View name
Returns:
View descriptor

getViewMap

public Map<String,GUIViewDescriptor<B>> getViewMap()
Gets the mapping between view names and actual view descriptors.

Returns:
Mapping between view names and actual view descriptors

getWizardRules

public WizardRules<B> getWizardRules()
Gets the navigation rules for this wizard

Returns:
Navigation rules

isModal

public boolean isModal()
Checks if the wizard must be executed in modal mode or not.

Returns:
Modal mode

openView

public <V> GUIView<V> openView(GUIWindow<B> parentWindow,
                               GUIViewDescriptor<V> viewDescriptor,
                               V viewData)
Always return null since a wizard cannot hold views.

Type Parameters:
V - Type of data for the view
Parameters:
parentWindow - Parent window
viewDescriptor - Descriptor for the view to open
viewData - Data for the view
Returns:
Opened view

setInitialView

public void setInitialView(String initialView)
Sets the initial view name for this wizard.

Parameters:
initialView - Initial view name

setIwindowFactory

public void setIwindowFactory(IWindowFactory iwindowFactory)
Sets the window implementation factory for this wizard. It is set by default to DefaultIWindowFactory.

Parameters:
iwindowFactory - Window implementation factory

setModal

public void setModal(boolean modal)
Sets the modal mode of the wizard

Parameters:
modal - Modal mode

setViewId

protected void setViewId(GUIWindow<B> window,
                         String viewId)
Navigates to a new view. Any previous view is closed and the new view is created from scratch before being displayed in the wizard.

Parameters:
window - Wizard window
viewId - View to navigate to.

setViewMap

public void setViewMap(Map<String,GUIViewDescriptor<B>> viewMap)
Sets the mapping between view names and actual view descriptors.

Parameters:
viewMap - Mapping between view names and actual view descriptors

setWindowFactory

public void setWindowFactory(GUIWindowFactory windowFactory)
Sets the window factory for this wizard. It must be a sub-class of the WizardWindowFactory.

Overrides:
setWindowFactory in class AbstractGUIWindowDescriptor<B>
Parameters:
windowFactory - Factory for the window implementation

setWizardRules

public void setWizardRules(WizardRules<B> wizardRules)
Sets the navigation rules for this wizard.

Parameters:
wizardRules - Navigation rules


Copyright © 2011. All Rights Reserved.