org.beanfabrics.swing
Class BnAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by org.beanfabrics.swing.internal.OperationPMAction
          extended by org.beanfabrics.swing.BnAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action, ModelSubscriber, View<IOperationPM>
Direct Known Subclasses:
BnMouseClickAction

public class BnAction
extends OperationPMAction
implements ModelSubscriber

The BnAction is an Action that can subscribe to an IOperationPM.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
BnAction()
          Constructs a new instance of this class.
BnAction(IModelProvider provider)
          Constructs a BnAction and subscribes it for the model at the root level provided by the given provider.
BnAction(IModelProvider provider, Path path)
          Constructs a BnAction and subscribes it for the model at the specified Path provided by the given provider.
BnAction(IOperationPM pModel)
          Constructs a BnAction and binds it to the specified model.
 
Method Summary
 IModelProvider getModelProvider()
          Returns the provider.
 Path getPath()
          Returns the path.
 void setModelProvider(IModelProvider provider)
          Sets the provider.
 void setPath(Path path)
          Sets the path.
 
Methods inherited from class org.beanfabrics.swing.internal.OperationPMAction
actionPerformed, execute, getPresentationModel, refresh, setPresentationModel
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BnAction

public BnAction()
Constructs a new instance of this class.


BnAction

public BnAction(IOperationPM pModel)
Constructs a BnAction and binds it to the specified model.

Parameters:
pModel - the model

BnAction

public BnAction(IModelProvider provider,
                Path path)
Constructs a BnAction and subscribes it for the model at the specified Path provided by the given provider.

Parameters:
provider - the ModelProvider to set initially
path - the Path to set initially

BnAction

public BnAction(IModelProvider provider)
Constructs a BnAction and subscribes it for the model at the root level provided by the given provider.

Parameters:
provider - the ModelProvider to set initially
Method Detail

getModelProvider

public IModelProvider getModelProvider()
Returns the provider.

Specified by:
getModelProvider in interface ModelSubscriber
Returns:
the ModelProvider

setModelProvider

public void setModelProvider(IModelProvider provider)
Sets the provider.

Specified by:
setModelProvider in interface ModelSubscriber
Parameters:
provider - the provider

getPath

public Path getPath()
Returns the path.

Specified by:
getPath in interface ModelSubscriber
Returns:
the path

setPath

public void setPath(Path path)
Sets the path. The Path is used to locate the model inside the provider.

Specified by:
setPath in interface ModelSubscriber
Parameters:
path - the path relative to the provider's root model