com.sdm.quasar.client.swing.states.adapters
Class ActionEnabledBooleanStateAdapter

java.lang.Object
  extended bycom.sdm.quasar.client.core.states.AbstractBooleanStateAdapter
      extended bycom.sdm.quasar.client.swing.states.adapters.AbstractSwingBooleanStateAdapter
          extended bycom.sdm.quasar.client.swing.states.adapters.ActionEnabledBooleanStateAdapter
All Implemented Interfaces:
BooleanStateAdapter, Disposable

public class ActionEnabledBooleanStateAdapter
extends AbstractSwingBooleanStateAdapter

Adapts the value of a BooleanState to the enabled state of a Action.

Version:
1.$Revision$
Author:
Thomas Wolf

Constructor Summary
ActionEnabledBooleanStateAdapter()
          Creates a new ActionEnabledBooleanStateAdapter.
ActionEnabledBooleanStateAdapter(java.lang.String name)
          Creates a new ActionEnabledBooleanStateAdapter.
 
Method Summary
 void addAction(javax.swing.Action action)
          Adds an Action, whos enablement should be adapted from the state.
 void addActionInverse(javax.swing.Action action)
          Adds an Action, whos enablement should be adapted inverse from the state.
 void removeAction(javax.swing.Action action)
          Removes a previously added Action from adapting its enablement.
protected  void setAdaptedValue(java.lang.Object target, boolean value)
          Sets the adapted value for the given target object (that was added before to this adapter).
 
Methods inherited from class com.sdm.quasar.client.swing.states.adapters.AbstractSwingBooleanStateAdapter
updateAdaptedValue
 
Methods inherited from class com.sdm.quasar.client.core.states.AbstractBooleanStateAdapter
addTarget, addTarget, addTargetInverse, dispose, getBooleanState, getName, removeTarget, setAdaptedValue, setBooleanState, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionEnabledBooleanStateAdapter

public ActionEnabledBooleanStateAdapter()
Creates a new ActionEnabledBooleanStateAdapter.


ActionEnabledBooleanStateAdapter

public ActionEnabledBooleanStateAdapter(java.lang.String name)
Creates a new ActionEnabledBooleanStateAdapter.

Parameters:
name -
Method Detail

addAction

public void addAction(javax.swing.Action action)
Adds an Action, whos enablement should be adapted from the state.

Parameters:
action - the Action to add

addActionInverse

public void addActionInverse(javax.swing.Action action)
Adds an Action, whos enablement should be adapted inverse from the state.

Parameters:
action - the Action to add

removeAction

public void removeAction(javax.swing.Action action)
Removes a previously added Action from adapting its enablement.

Parameters:
action - the Action to remove

setAdaptedValue

protected void setAdaptedValue(java.lang.Object target,
                               boolean value)
Description copied from class: AbstractBooleanStateAdapter
Sets the adapted value for the given target object (that was added before to this adapter).

Specified by:
setAdaptedValue in class AbstractBooleanStateAdapter
Parameters:
target - the target to adapt the value to
value - the value to adapt
See Also:
AbstractBooleanStateAdapter.setAdaptedValue(java.lang.Object, boolean)