org.opa.action
Class OPADefaultActionManager

java.lang.Object
  extended byorg.opa.action.OPADefaultActionManager
All Implemented Interfaces:
java.util.EventListener, OPAActionManager, OPAManager, java.beans.PropertyChangeListener

public class OPADefaultActionManager
extends java.lang.Object
implements OPAActionManager, java.beans.PropertyChangeListener

This class provides default implementation of the OPAActionManager interface.


Constructor Summary
OPADefaultActionManager()
          Creates a new instance of OPADefaultActionManager
 
Method Summary
 void doAction(OPAAction action)
          Performs a context-sensitive action based on the focussed GUI component.
 void load()
          Loads the OPAManager.
 void propertyChange(java.beans.PropertyChangeEvent evt)
          Listens for changes in GUI focus.
 void registerAction(OPAAction action)
          Used by OPA modules to register an OPAAction with OPA.
 void registerBundle(OPAActionBundle bundle)
          This accepts an OPAActionBundle and registers all the OPAActions it contains.
 void start()
          Starts the OPAXXXManager service.
 void stop()
          Stops the OPAXXXManager service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OPADefaultActionManager

public OPADefaultActionManager()
Creates a new instance of OPADefaultActionManager

Method Detail

doAction

public void doAction(OPAAction action)
Performs a context-sensitive action based on the focussed GUI component. This action would have been enabled by OPAActionManager based on a change in GUI focus. If it is activated, by a using pressing a button for example, OPAADefaultActionManager gets an OPACommand from the focuessed GUI component and executes that OPACommand. The OPACommand contain the actual Java code that produces the desired result.

Specified by:
doAction in interface OPAActionManager
Parameters:
action - The OPAAction used as the key to choose which OPACookies OPACommand to execute.

registerAction

public void registerAction(OPAAction action)
Used by OPA modules to register an OPAAction with OPA. THIS METHOD SHOULD NOT BE USED. Instead registerBundle should be used instead.

Specified by:
registerAction in interface OPAActionManager
Parameters:
action - The OPAAction to add.

start

public void start()
Description copied from interface: OPAManager
Starts the OPAXXXManager service. This should be used to restore any state (if necessary).

Specified by:
start in interface OPAManager

stop

public void stop()
Description copied from interface: OPAManager
Stops the OPAXXXManager service. This should be used to save any state (if necessary).

Specified by:
stop in interface OPAManager

registerBundle

public void registerBundle(OPAActionBundle bundle)
Description copied from interface: OPAActionManager
This accepts an OPAActionBundle and registers all the OPAActions it contains.

Specified by:
registerBundle in interface OPAActionManager

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Listens for changes in GUI focus. When a change evt is received, the newly focussed GUI component is queried. If it is an OPACookieJar, it is asked for its OPACookies. These OPACookies determine which OPAActions should be enabled or disabled. OPADefaultActionManager then updates all context-sensitive OPAActions. This SHOULD NOT BE USED BY OPA MODULES.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
evt - A PropertyChangeEvent from the JVM KeyboardFocuManager

load

public void load()
Description copied from interface: OPAManager
Loads the OPAManager. This should be used to set-up and install any OPA services needed. For example, OPAOption panels needed by this OPAManager should be added to OPA here. This method is called before start().

Specified by:
load in interface OPAManager