net.sf.doolin.gui.action
Class TaskDialogAction<T,R>

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>
              extended by net.sf.doolin.gui.action.TaskDialogAction<T,R>
Type Parameters:
T - Type of the input to the task
R - Type of the return from the task
All Implemented Interfaces:
GUIAction, org.springframework.beans.factory.BeanNameAware

public class TaskDialogAction<T,R>
extends DialogAction<T>

This action executes a GUITask after a dialog has been displayed and validated.

Author:
Damien Coraboeuf

Constructor Summary
TaskDialogAction()
           
 
Method Summary
 GUITask<T,R> getTask()
          Gets the task to executed
 GUITaskExecutor<T,R> getTaskExecutor()
          Gets the task executor
protected  void onOK(ActionContext actionContext, T bean)
          Executes the task
 void setTask(GUITask<T,R> task)
          Sets the task to execute
 void setTaskExecutor(GUITaskExecutor<T,R> taskExecutor)
          Sets the task executor
 
Methods inherited from class net.sf.doolin.gui.action.DialogAction
doExecute, getDialog, getModelFactory, onCancelled, setDialog, setModelFactory, setUseContext
 
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

TaskDialogAction

public TaskDialogAction()
Method Detail

getTask

public GUITask<T,R> getTask()
Gets the task to executed

Returns:
Task to execute

getTaskExecutor

public GUITaskExecutor<T,R> getTaskExecutor()
Gets the task executor

Returns:
Task executor

onOK

protected void onOK(ActionContext actionContext,
                    T bean)
             throws Exception
Executes the task

Specified by:
onOK in class DialogAction<T>
Parameters:
actionContext - Action context
bean - Edited bean
Throws:
Exception - If an error occurs while validating the dialog
See Also:
GUITaskExecutor.execute(ActionContext, Object, GUITask)

setTask

public void setTask(GUITask<T,R> task)
Sets the task to execute

Parameters:
task - Task to execute

setTaskExecutor

public void setTaskExecutor(GUITaskExecutor<T,R> taskExecutor)
Sets the task executor

Parameters:
taskExecutor - Task executor


Copyright © 2011. All Rights Reserved.