|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--java.beans.beancontext.BeanContextChildSupport
|
+--java.beans.beancontext.BeanContextSupport
|
+--java.beans.beancontext.BeanContextServicesSupport
|
+--org.ejtools.beans.beancontext.CustomBeanContextServicesSupport
|
+--org.ejtools.adwt.action.CommandAction
BeanContext that wraps an Action and delegates to a Command object.
It supports the Command pattern by delegating the ActionEvent event to the execute method of the Command object.
It automatically handles the negotiation in ToolBar and MenuBar if these services are present.
It supports the following properties :
Command,
Serialized Form| Field Summary | |
protected javax.swing.AbstractAction |
action
The wrapped action |
protected Command |
command
The command to execute |
static java.lang.String |
ICON
Constant for ICON property |
static java.lang.String |
MENU
Constant for MENU property |
static java.lang.String |
MENU_ITEM
Constant for MENU_ITEM property |
static java.lang.String |
MENU_LAYOUT
Constant for MENU_LAYOUT property |
protected java.util.ResourceBundle |
resource
Resource Bundle |
static java.lang.String |
TOOLBAR
Constant for TOOLBAR property |
static java.lang.String |
TOOLTIP
Constant for TOOLTIP property |
| Fields inherited from class java.beans.beancontext.BeanContextServicesSupport |
bcsListeners, proxy, serializable, services |
| Fields inherited from class java.beans.beancontext.BeanContextSupport |
bcmListeners, children, designTime, locale, okToUseGui |
| Fields inherited from class java.beans.beancontext.BeanContextChildSupport |
beanContext, beanContextChildPeer, pcSupport, rejectedSetBCOnce, vcSupport |
| Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON |
| Fields inherited from interface java.beans.beancontext.BeanContext |
globalHierarchyLock |
| Fields inherited from interface java.beans.DesignMode |
PROPERTYNAME |
| Constructor Summary | |
protected |
CommandAction(Command command,
java.util.ResourceBundle res,
java.lang.String name)
Constructor used to fully define the CommandAction. |
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
This method is called whenever the action is acted upon. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener. |
protected Command |
getCommand()
Returns the wrapped command object |
java.lang.String |
getMenu()
Returns the menu property |
javax.swing.JMenuItem |
getMenuItem()
Getter for the menuItem attribute |
int |
getMenuLayout()
Returns the menu layout property |
java.util.ResourceBundle |
getResourceBundle()
Returns the Resource Bundle used by this object |
boolean |
getToolBar()
Returns the toolbar presence property |
java.lang.Object |
getValue(java.lang.String key)
Gets the value attribute of the CommandAction object |
protected void |
initializeBeanContextResources()
Called when the CommandAction is put in a BeanContext |
boolean |
isEnabled()
Gets the enabled attribute of the CommandAction object |
void |
putValue(java.lang.String key,
java.lang.Object value)
Description of the Method |
protected void |
register(java.beans.beancontext.BeanContextServices context)
Description of the Method |
protected void |
releaseBeanContextResources()
Called when the CommandAction is removed from a BeanContext |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener. |
void |
serviceAvailable(java.beans.beancontext.BeanContextServiceAvailableEvent bcsae)
Triggered when a service is made available. |
void |
serviceRevoked(java.beans.beancontext.BeanContextServiceRevokedEvent bcsre)
Triggered when a service is revoked. |
protected void |
setCommand(Command newValue)
This method sets the action's command object. |
void |
setEnabled(boolean b)
Enables the Action. |
void |
setIcon(java.lang.String icon)
Sets the icon attribute of the CommandAction object |
void |
setMenu(java.lang.String menu)
Constructor for the setMenu object |
void |
setMenuLayout(int menuLayout)
Sets the menuLayout attribute of the CommandAction object |
protected void |
setResourceBundle(java.util.ResourceBundle newValue)
Setter for the resourceBundle attribute |
void |
setSmallIcon(java.lang.String icon)
Constructor for the setIcon object |
void |
setToolBar(boolean inToolBar)
Sets the toolBar attribute of the CommandAction object |
protected void |
unregister(java.beans.beancontext.BeanContextServices context)
Description of the Method |
| Methods inherited from class org.ejtools.beans.beancontext.CustomBeanContextServicesSupport |
accept, clear, getService |
| Methods inherited from class java.beans.beancontext.BeanContextServicesSupport |
addBeanContextServicesListener, addService, addService, bcsPreDeserializationHook, bcsPreSerializationHook, childJustRemovedHook, createBCSChild, createBCSSServiceProvider, fireServiceAdded, fireServiceAdded, fireServiceRevoked, fireServiceRevoked, getBeanContextServicesPeer, getChildBeanContextServicesListener, getCurrentServiceClasses, getCurrentServiceSelectors, hasService, initialize, releaseService, removeBeanContextServicesListener, revokeService |
| Methods inherited from class java.beans.beancontext.BeanContextSupport |
add, addAll, addBeanContextMembershipListener, avoidingGui, bcsChildren, childDeserializedHook, childJustAddedHook, classEquals, contains, containsAll, containsKey, copyChildren, deserialize, dontUseGui, fireChildrenAdded, fireChildrenRemoved, getBeanContextPeer, getChildBeanContextChild, getChildBeanContextMembershipListener, getChildPropertyChangeListener, getChildSerializable, getChildVetoableChangeListener, getChildVisibility, getLocale, getResource, getResourceAsStream, instantiateChild, isDesignTime, isEmpty, isSerializing, iterator, needsGui, okToUseGui, propertyChange, readChildren, remove, remove, removeAll, removeBeanContextMembershipListener, retainAll, serialize, setDesignTime, setLocale, size, toArray, toArray, validatePendingAdd, validatePendingRemove, vetoableChange, writeChildren |
| Methods inherited from class java.beans.beancontext.BeanContextChildSupport |
addPropertyChangeListener, addVetoableChangeListener, firePropertyChange, fireVetoableChange, getBeanContext, getBeanContextChildPeer, isDelegated, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext, validatePendingSetBeanContext |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.beans.beancontext.BeanContext |
addBeanContextMembershipListener, getResource, getResourceAsStream, instantiateChild, removeBeanContextMembershipListener |
| Methods inherited from interface java.beans.beancontext.BeanContextChild |
addPropertyChangeListener, addVetoableChangeListener, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext |
| Methods inherited from interface java.util.Collection |
add, addAll, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
| Methods inherited from interface java.beans.DesignMode |
isDesignTime, setDesignTime |
| Methods inherited from interface java.beans.Visibility |
avoidingGui, dontUseGui, needsGui, okToUseGui |
| Field Detail |
protected javax.swing.AbstractAction action
protected Command command
protected java.util.ResourceBundle resource
public static final java.lang.String ICON
public static final java.lang.String MENU
public static final java.lang.String MENU_ITEM
public static final java.lang.String MENU_LAYOUT
public static final java.lang.String TOOLBAR
public static final java.lang.String TOOLTIP
| Constructor Detail |
protected CommandAction(Command command,
java.util.ResourceBundle res,
java.lang.String name)
command - The command object to delegate the ActionEvent tores - The Resource Bundle used for resolving the name and other propertiesname - The name of the CommandAction. Must be a key found in the Resource Bundle| Method Detail |
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenere - The action eventpublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener in interface javax.swing.Actionlistener - The listener to be addedpublic javax.swing.JMenuItem getMenuItem()
public java.lang.Object getValue(java.lang.String key)
getValue in interface javax.swing.Actionkey - Description of Parameter
public boolean isEnabled()
isEnabled in interface javax.swing.Action
public void putValue(java.lang.String key,
java.lang.Object value)
putValue in interface javax.swing.Actionkey - Description of Parametervalue - Description of Parameterpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener in interface javax.swing.Actionlistener - The listener to removepublic void serviceAvailable(java.beans.beancontext.BeanContextServiceAvailableEvent bcsae)
serviceAvailable in interface java.beans.beancontext.BeanContextServicesListenerserviceAvailable in class java.beans.beancontext.BeanContextServicesSupportbcsae - The availability eventpublic void serviceRevoked(java.beans.beancontext.BeanContextServiceRevokedEvent bcsre)
serviceRevoked in interface java.beans.beancontext.BeanContextServiceRevokedListenerserviceRevoked in class java.beans.beancontext.BeanContextServicesSupportbcsre - The revocation eventpublic void setEnabled(boolean b)
setEnabled in interface javax.swing.Actionb - If true, the action will be enableprotected void initializeBeanContextResources()
initializeBeanContextResources in class java.beans.beancontext.BeanContextServicesSupportprotected void register(java.beans.beancontext.BeanContextServices context)
context - Description of Parameterprotected void releaseBeanContextResources()
releaseBeanContextResources in class java.beans.beancontext.BeanContextServicesSupportprotected void unregister(java.beans.beancontext.BeanContextServices context)
context - Description of Parameterpublic final java.lang.String getMenu()
public final int getMenuLayout()
public final java.util.ResourceBundle getResourceBundle()
public final boolean getToolBar()
public final void setIcon(java.lang.String icon)
icon - The new icon valuepublic final void setMenu(java.lang.String menu)
menu - Description of Parameterpublic final void setMenuLayout(int menuLayout)
menuLayout - The new menuLayout valuepublic final void setSmallIcon(java.lang.String icon)
icon - Description of Parameterpublic final void setToolBar(boolean inToolBar)
inToolBar - The new toolBar valueprotected final Command getCommand()
protected final void setCommand(Command newValue)
newValue - the command for this action to act uponprotected final void setResourceBundle(java.util.ResourceBundle newValue)
newValue - The new value for resourceBundle attribute
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||