org.springframework.richclient.command.support
Class AbstractActionCommandExecutor

Show UML class diagram
java.lang.Object
  extended by org.springframework.richclient.command.support.AbstractActionCommandExecutor
All Implemented Interfaces:
ActionCommandExecutor, GuardedActionCommandExecutor, ParameterizableActionCommandExecutor, Authorizable, Guarded, SecurityControllable

public class AbstractActionCommandExecutor
extends Object
implements ParameterizableActionCommandExecutor, GuardedActionCommandExecutor, SecurityControllable

Author:
Keith Donald

Field Summary
 
Fields inherited from interface org.springframework.richclient.core.Authorizable
AUTHORIZED_PROPERTY
 
Constructor Summary
AbstractActionCommandExecutor()
           
 
Method Summary
 void addEnabledListener(PropertyChangeListener listener)
          Adds the given listener to the collection of listeners that will be notified when the command executor's enabled state changes.
 void execute()
          Performs the action.
 void execute(Map parameters)
          Invoke the specified command, passing in the set of arbitrary execution parameters.
 String getSecurityControllerId()
          Get the id (bean name) of the security controller that should manage this object.
protected  void internalSetEnabled(boolean enabled)
          Internal method to set the enabled state.
 boolean isAuthorized()
          Get the authorized state.
 boolean isEnabled()
          Indicates if the object is in an enabled state.
 void removeEnabledListener(PropertyChangeListener listener)
          Removes the given listener from the collection of listeners that will be notified when the command executor's enabled state changes.
 void setAuthorized(boolean authorized)
          Set the authorized state.
 void setEnabled(boolean enabled)
          Set the enabled state of this command.
 void setSecurityControllerId(String controllerId)
          Set the Id of the security controller that should manage this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractActionCommandExecutor

public AbstractActionCommandExecutor()
Method Detail

setSecurityControllerId

public void setSecurityControllerId(String controllerId)
Set the Id of the security controller that should manage this object.

Specified by:
setSecurityControllerId in interface SecurityControllable
Parameters:
controllerId - Id (bean name) of the security controller

getSecurityControllerId

public String getSecurityControllerId()
Get the id (bean name) of the security controller that should manage this object.

Specified by:
getSecurityControllerId in interface SecurityControllable
Returns:
controller id

setAuthorized

public void setAuthorized(boolean authorized)
Set the authorized state. Setting authorized to false will override any call to setEnabled(boolean). As long as this object is unauthorized, it can not be enabled.

Specified by:
setAuthorized in interface Authorizable
Parameters:
authorized - Pass true if the object is to be authorized

isAuthorized

public boolean isAuthorized()
Get the authorized state.

Specified by:
isAuthorized in interface Authorizable
Returns:
authorized

isEnabled

public boolean isEnabled()
Description copied from interface: Guarded
Indicates if the object is in an enabled state.

Specified by:
isEnabled in interface Guarded
Returns:
if the object is in an enabled state, otherwise.

setEnabled

public void setEnabled(boolean enabled)
Set the enabled state of this command. Note that if we are currently not authorized, then the new value will just be recorded and no change in the current enabled state will be made.

Specified by:
setEnabled in interface Guarded
Parameters:
enabled - state

internalSetEnabled

protected void internalSetEnabled(boolean enabled)
Internal method to set the enabled state. This is needed so that calls made to the public setEnabled and this method can be handled differently.

Parameters:
enabled - state
See Also:
setAuthorized(boolean)

addEnabledListener

public void addEnabledListener(PropertyChangeListener listener)
Description copied from interface: GuardedActionCommandExecutor
Adds the given listener to the collection of listeners that will be notified when the command executor's enabled state changes.

Specified by:
addEnabledListener in interface GuardedActionCommandExecutor
Parameters:
listener - The listener to be added.

removeEnabledListener

public void removeEnabledListener(PropertyChangeListener listener)
Description copied from interface: GuardedActionCommandExecutor
Removes the given listener from the collection of listeners that will be notified when the command executor's enabled state changes.

Specified by:
removeEnabledListener in interface GuardedActionCommandExecutor
Parameters:
listener - The listener to be removed.

execute

public void execute(Map parameters)
Description copied from interface: ParameterizableActionCommandExecutor
Invoke the specified command, passing in the set of arbitrary execution parameters.

Specified by:
execute in interface ParameterizableActionCommandExecutor
Parameters:
parameters - the parameter map, consisting of name-value pairs.

execute

public void execute()
Description copied from interface: ActionCommandExecutor
Performs the action.

Specified by:
execute in interface ActionCommandExecutor


Copyright © 2004-2009 The Spring Framework. All Rights Reserved.