net.sf.doolin.gui.action
Class DelegateGUIAction

java.lang.Object
  extended by net.sf.doolin.gui.action.AbstractGUIAction
      extended by net.sf.doolin.gui.action.DelegateGUIAction
All Implemented Interfaces:
GUIAction

public class DelegateGUIAction
extends AbstractGUIAction

This action delegates the execution to another action, adapting the action context to a new value.

Author:
Damien Coraboeuf

Constructor Summary
DelegateGUIAction()
           
 
Method Summary
protected  void doExecute(ActionContext context)
          Executes the action and throws any kind of error.
 GUIAction getAction()
          Returns the target action
 com.google.common.base.Function<ActionContext,ActionContext> getActionContextConverter()
          Returns the action context converter
protected  ActionContext getDelegateContext(ActionContext context)
          Gets the delegated action context
 GUIExpression getIconIDExpression(ActionContext actionContext)
          Icon for the action
 String getId()
          ID for the action
 GUIExpression getShortcutExpression(ActionContext actionContext)
          Shortcut for the action
 GUIExpression getTextExpression(ActionContext actionContext)
          Text for the action
 GUIExpression getTipExpression(ActionContext actionContext)
          Tip for the action
 void setAction(GUIAction action)
          Sets the target action
 void setActionContextConverter(com.google.common.base.Function<ActionContext,ActionContext> actionContextConverter)
          Sets the action context converter
 
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, toString, wait, wait, wait
 

Constructor Detail

DelegateGUIAction

public DelegateGUIAction()
Method Detail

doExecute

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

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

getAction

public GUIAction getAction()
Returns the target action

Returns:
Action

getActionContextConverter

public com.google.common.base.Function<ActionContext,ActionContext> getActionContextConverter()
Returns the action context converter

Returns:
Action context converter

getDelegateContext

protected ActionContext getDelegateContext(ActionContext context)
Gets the delegated action context

Parameters:
context - Current action context
Returns:
Action context to use for the delegate

getIconIDExpression

public GUIExpression getIconIDExpression(ActionContext actionContext)
Description copied from interface: GUIAction
Icon for the action

Parameters:
actionContext - Context for the action
Returns:
Icon model

getId

public String getId()
Description copied from interface: GUIAction
ID for the action

Returns:
ID

getShortcutExpression

public GUIExpression getShortcutExpression(ActionContext actionContext)
Description copied from interface: GUIAction
Shortcut for the action

Parameters:
actionContext - Context for the action
Returns:
Shortcut model

getTextExpression

public GUIExpression getTextExpression(ActionContext actionContext)
Description copied from interface: GUIAction
Text for the action

Parameters:
actionContext - Context for the action
Returns:
Text model

getTipExpression

public GUIExpression getTipExpression(ActionContext actionContext)
Description copied from interface: GUIAction
Tip for the action

Parameters:
actionContext - Context for the action
Returns:
Tip model

setAction

public void setAction(GUIAction action)
Sets the target action

Parameters:
action - Action

setActionContextConverter

public void setActionContextConverter(com.google.common.base.Function<ActionContext,ActionContext> actionContextConverter)
Sets the action context converter

Parameters:
actionContextConverter - Action context converter


Copyright © 2011. All Rights Reserved.