net.sf.doolin.gui.action
Class DialogAction<T>

java.lang.Object
  extended by net.sf.doolin.gui.action.AbstractGUIAction
      extended by net.sf.doolin.gui.action.AbstractSimpleGUIAction
          extended by net.sf.doolin.gui.action.DialogAction<T>
Type Parameters:
T - Type of the data for the dialog
All Implemented Interfaces:
GUIAction, org.springframework.beans.factory.BeanNameAware
Direct Known Subclasses:
DelegateDialogAction, NewItemAction, TaskDialogAction

public abstract class DialogAction<T>
extends AbstractSimpleGUIAction

This action opens a dialog.

Author:
Damien Coraboeuf (x74639)

Constructor Summary
DialogAction()
           
 
Method Summary
protected  void doExecute(ActionContext actionContext)
          Executes the action and throws any kind of error.
 ViewOpener<T> getDialog()
          Gets the dialog.
 DataFactory<T> getModelFactory()
          Gets the data factory.
protected  void onCancelled(ActionContext actionContext, T bean)
          This method is called when the dialog has been cancelled.
protected abstract  void onOK(ActionContext actionContext, T bean)
          This method is called when the dialog has been validated.
 void setDialog(ViewOpener<T> dialog)
          Sets the dialog.
 void setModelFactory(DataFactory<T> dataFactory)
          Sets the data factory.
 void setUseContext(boolean useContext)
          Deprecated. Use AbstractGUIAction.setActionContextDataExtractor(net.sf.doolin.gui.action.support.ActionContextDataExtractor)
 
Methods inherited from class net.sf.doolin.gui.action.AbstractSimpleGUIAction
getIconId, getIconIDExpression, getId, getShortcut, getShortcutExpression, getTextExpression, getTip, getTipExpression, getTitle, init, setBeanName, setIconId, setShortcut, setTip, setTitle, toString
 
Methods inherited from class net.sf.doolin.gui.action.AbstractGUIAction
execute, getActionContextData, getActionContextDataExtractor, getDisplayStateHandler, getIcon, getIconService, setActionContextDataExtractor, setDisplayStateHandler, setIconService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DialogAction

public DialogAction()
Method Detail

doExecute

protected void doExecute(ActionContext actionContext)
                  throws Exception
Description copied from class: AbstractGUIAction
Executes the action and throws any kind of error.

Specified by:
doExecute in class AbstractGUIAction
Parameters:
actionContext - the context
Throws:
Exception - the exception

getDialog

public ViewOpener<T> getDialog()
Gets the dialog.

Returns:
the dialog

getModelFactory

public DataFactory<T> getModelFactory()
Gets the data factory.

Returns:
the data factory

onCancelled

protected void onCancelled(ActionContext actionContext,
                           T bean)
                    throws Exception
This method is called when the dialog has been cancelled. By default, it does nothing.

Parameters:
actionContext - Action context
bean - Edited bean
Throws:
Exception - If an error occurs while cancelling the dialog

onOK

protected abstract void onOK(ActionContext actionContext,
                             T bean)
                      throws Exception
This method is called when the dialog has been validated.

Parameters:
actionContext - Action context
bean - Edited bean
Throws:
Exception - If an error occurs while validating the dialog

setDialog

public void setDialog(ViewOpener<T> dialog)
Sets the dialog.

Parameters:
dialog - the new dialog

setModelFactory

public void setModelFactory(DataFactory<T> dataFactory)
Sets the data factory.

Parameters:
dataFactory - the new data factory

setUseContext

@Deprecated
public void setUseContext(boolean useContext)
Deprecated. Use AbstractGUIAction.setActionContextDataExtractor(net.sf.doolin.gui.action.support.ActionContextDataExtractor)

Sets if the bean for the dialog is the contextual data of the action context or its data itself. It is set to false by default, meaning that the context data (and not the context contextual data) is used.

Parameters:
useContext - true if the bean for the dialog is the contextual data of the action context or its data itself.


Copyright © 2011. All Rights Reserved.