net.sf.doolin.gui.edit
Class GUIEditAction

java.lang.Object
  extended by net.sf.doolin.gui.action.AbstractGUIAction
      extended by net.sf.doolin.gui.edit.GUIEditAction
All Implemented Interfaces:
GUIAction, org.springframework.beans.factory.BeanNameAware
Direct Known Subclasses:
GUIRedoAction, GUIUndoAction

public abstract class GUIEditAction
extends AbstractGUIAction
implements org.springframework.beans.factory.BeanNameAware

This GUIAction is a support for the tasks that can be done and undone.

Author:
Damien Coraboeuf

Constructor Summary
GUIEditAction()
          Constructor.
 
Method Summary
protected  void doExecute(ActionContext context)
          Executes the action and throws any kind of error.
protected abstract  void execute(GUIEditManager editManager)
          Executes this action for its associated GUIEditManager.
protected abstract  DisplayState getActionState(GUIEditManager editManager)
          Gets the display state of this action according to the state of the task manager
protected abstract  String getActionText(GUIEditManager editManager)
          Gets the text of this action according to the state of the task manager
protected  GUIEditManager getEditManager(ActionContext actionContext)
          Gets the task manager from the action context
 String getEditManagerPropertyPath()
          Gets the path to the property that holds the task manager.
 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 setBeanName(String name)
           
 void setEditManagerPropertyPath(String undoManagerPropertyPath)
          Sets the path to the property that holds the task manager.
 void setId(String id)
          Sets the ID of this action
 
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

GUIEditAction

public GUIEditAction()
Constructor. It sets a default DisplayStateHandler that enables or disables this action according to the state of the task manager.

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

execute

protected abstract void execute(GUIEditManager editManager)
Executes this action for its associated GUIEditManager.

Parameters:
editManager - Task manager

getActionState

protected abstract DisplayState getActionState(GUIEditManager editManager)
Gets the display state of this action according to the state of the task manager

Parameters:
editManager - task manager
Returns:
Display state

getActionText

protected abstract String getActionText(GUIEditManager editManager)
Gets the text of this action according to the state of the task manager

Parameters:
editManager - Task manager
Returns:
Display text

getEditManager

protected GUIEditManager getEditManager(ActionContext actionContext)
Gets the task manager from the action context

Parameters:
actionContext - Action context
Returns:
Task manager
See Also:
ActionContext.getData(), setEditManagerPropertyPath(String)

getEditManagerPropertyPath

public String getEditManagerPropertyPath()
Gets the path to the property that holds the task manager.

Returns:
Property path

getIconIDExpression

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

Specified by:
getIconIDExpression in interface GUIAction
Parameters:
actionContext - Context for the action
Returns:
Icon model

getId

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

Specified by:
getId in interface GUIAction
Returns:
ID

getShortcutExpression

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

Specified by:
getShortcutExpression in interface GUIAction
Parameters:
actionContext - Context for the action
Returns:
Shortcut model

getTextExpression

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

Specified by:
getTextExpression in interface GUIAction
Parameters:
actionContext - Context for the action
Returns:
Text model

getTipExpression

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

Specified by:
getTipExpression in interface GUIAction
Parameters:
actionContext - Context for the action
Returns:
Tip model

setBeanName

public void setBeanName(String name)
Specified by:
setBeanName in interface org.springframework.beans.factory.BeanNameAware

setEditManagerPropertyPath

public void setEditManagerPropertyPath(String undoManagerPropertyPath)
Sets the path to the property that holds the task manager.

Parameters:
undoManagerPropertyPath - Property path

setId

public void setId(String id)
Sets the ID of this action

Parameters:
id - ID


Copyright © 2011. All Rights Reserved.