org.springframework.richclient.command
Class AbstractCommand

java.lang.Object
  extended by org.springframework.binding.value.support.AbstractPropertyChangePublisher
      extended by org.springframework.richclient.command.AbstractCommand
All Implemented Interfaces:
BeanNameAware, InitializingBean, PropertyChangePublisher, ActionCommandExecutor, GuardedActionCommandExecutor, Authorizable, Guarded, SecurityControllable
Direct Known Subclasses:
ActionCommand, CommandGroup

public abstract class AbstractCommand
extends AbstractPropertyChangePublisher
implements InitializingBean, BeanNameAware, GuardedActionCommandExecutor, SecurityControllable

Base class for commands. Extend this class by implementing the ActionCommandExecutor.execute() method.

Most (if not all) commands result in a UI component. Several methods are provided here to deliver abstractButtons or menuItems. Configuring this visual aspect of the command is done by a number of CommandFaceDescriptors. One of these will be registered as the default while others can be used to create a different look by providing a faceDescriptorId.

Author:
Keith Donald, Jan Hoskens
See Also:
CommandFaceDescriptor

Field Summary
static String ENABLED_PROPERTY_NAME
          Property used to notify changes in the enabled state.
static String VISIBLE_PROPERTY_NAME
          Property used to notify changes in the visible state.
 
Fields inherited from class org.springframework.binding.value.support.AbstractPropertyChangePublisher
logger
 
Fields inherited from interface org.springframework.richclient.core.Authorizable
AUTHORIZED_PROPERTY
 
Constructor Summary
protected AbstractCommand()
          Default constructor.
protected AbstractCommand(String id)
          Constructor providing an id for configuration.
protected AbstractCommand(String id, CommandFaceDescriptor faceDescriptor)
          Constructor providing an id and the default FaceDescriptor.
protected AbstractCommand(String id, Map faceDescriptors)
          Constructor providing an id and a number of FaceDescriptors.
protected AbstractCommand(String id, String encodedLabel)
          Constructor providing id and encodedLabel.
protected AbstractCommand(String id, String encodedLabel, Icon icon, String caption)
          Constructor providing id and a number of parameters to create a default CommandFaceDescriptor.
 
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 afterPropertiesSet()
          Performs initialisation and validation of this instance after its dependencies have been set.
 void attach(AbstractButton button)
          Attach and configure the button to the default faceDescriptor using the default configurer.
 void attach(AbstractButton button, CommandButtonConfigurer configurer)
          Attach and configure the button to the default faceDescriptor using the given configurer.
 void attach(AbstractButton button, String faceDescriptorId, CommandButtonConfigurer configurer)
          Attach and configure the button to the faceDescriptorId using the configurer.
protected  Iterator buttonIterator()
          Returns an iterator over all buttons by traversing each CommandFaceButtonManager.
 AbstractButton createButton()
          Create a button using the defaults for faceDescriptorId, buttonFactory and buttonConfigurer.
 AbstractButton createButton(ButtonFactory buttonFactory)
          Create a button using the defaults for faceDescriptorId and buttonConfigurer.
 AbstractButton createButton(ButtonFactory buttonFactory, CommandButtonConfigurer buttonConfigurer)
          Create a button using the default buttonFactory.
 AbstractButton createButton(String faceDescriptorId)
          Create a button using the defaults for buttonFactory and buttonConfigurer.
 AbstractButton createButton(String faceDescriptorId, ButtonFactory buttonFactory)
          Create a button using the default buttonConfigurer.
 AbstractButton createButton(String faceDescriptorId, ButtonFactory buttonFactory, CommandButtonConfigurer buttonConfigurer)
          Creates a button using the provided id, factory and configurer.
 JMenuItem createMenuItem()
          Create a menuItem using the defaults for faceDescriptorId, menuFactory and menuItemButtonConfigurer.
 JMenuItem createMenuItem(MenuFactory menuFactory)
          Create a menuItem using the defaults for faceDescriptorId and menuItemButtonConfigurer.
 JMenuItem createMenuItem(MenuFactory menuFactory, CommandButtonConfigurer buttonConfigurer)
          Create a menuItem using the default faceDescriptorId.
 JMenuItem createMenuItem(String faceDescriptorId)
          Create a menuItem using the defaults for menuFactory and menuItemButtonConfigurer.
 JMenuItem createMenuItem(String faceDescriptorId, MenuFactory menuFactory)
          Create a menuItem using the default and menuItemButtonConfigurer.
 JMenuItem createMenuItem(String faceDescriptorId, MenuFactory menuFactory, CommandButtonConfigurer buttonConfigurer)
          Create a menuItem using the provided id, factory and configurer.
protected  Iterator defaultButtonIterator()
           Returns an iterator over all buttons in the default CommandFaceButtonManager.
 void detach(AbstractButton button)
          Detach the button from the CommandFaceButtonManager.
 KeyStroke getAccelerator()
          Returns the accelerator from the default faceDescriptor or the default accelerator of the CommandButtonLabelInfo#BLANK_BUTTON_LABEL#getAccelerator().
protected  ButtonFactory getButtonFactory()
           
 AbstractButton getButtonIn(Container container)
          Search for the first button of this command that is a child component of the given container.
protected  CommandServices getCommandServices()
          Returns the CommandServices for this AbstractCommand.
protected  ComponentFactory getComponentFactory()
           
protected  CommandButtonConfigurer getDefaultButtonConfigurer()
           
 String getDefaultFaceDescriptorId()
          Returns the default faceDescriptorId.
protected  CommandFaceDescriptor getFaceDescriptor()
          Returns the default faceDescriptor.
 CommandFaceDescriptorRegistry getFaceDescriptorRegistry()
          Returns the CommandFaceDescriptorRegistry of this AbstractCommand which holds all face descriptors.
 Icon getIcon()
          Returns the icon from the default faceDescriptor or null if no faceDescriptor is available.
 String getId()
           
protected  MenuFactory getMenuFactory()
           
protected  CommandButtonConfigurer getMenuItemButtonConfigurer()
           
 int getMnemonic()
          Returns the mnemonic from the default faceDescriptor or the default mnemonic of the CommandButtonLabelInfo#BLANK_BUTTON_LABEL#getMnemonic().
 int getMnemonicIndex()
          Returns the mnemonicIndex from the default faceDescriptor or the default mnemonicIndex of the CommandButtonLabelInfo#BLANK_BUTTON_LABEL#getMnemonicIndex().
 String getSecurityControllerId()
          Get the id (bean name) of the security controller that should manage this object.
 String getText()
          Returns the text from the default faceDescriptor or the default text of the CommandButtonLabelInfo#BLANK_BUTTON_LABEL#getText().
protected  CommandButtonConfigurer getToolBarButtonConfigurer()
           
protected  ButtonFactory getToolBarButtonFactory()
           
 boolean isAnonymous()
          Returns true if this command doesn't have an Id.
 boolean isAttached(AbstractButton b)
          Returns true if the provided button is attached to the default CommandFaceButtonManager.
 boolean isAuthorized()
          Returns true if the command is authorized.
 boolean isEnabled()
          Returns true if the command is enabled and isAuthorized().
 boolean isFaceConfigured()
          Returns true if this command has a default faceDescriptor.
 boolean isVisible()
          Returns true if the command is visible.
protected  void onButtonAttached(AbstractButton button)
          Additional code to execute when attaching a button.
protected  void onButtonDetached()
          Implement this to add custom code executed when detaching a button.
 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.
 boolean requestFocusIn(Container container)
          Search for a button representing this command in the provided container and let it request the focus.
 void setAuthorized(boolean authorized)
          Set the authorized state.
 void setBeanName(String name)
          
 void setCaption(String shortDescription)
          Set the provided description on the default CommandFaceDescriptor.
 void setCommandServices(CommandServices services)
          Set the CommandServices.
 void setDefaultFaceDescriptorId(String defaultFaceDescriptorId)
          Change the default FaceDescriptor.
 void setEnabled(boolean enabled)
          Set the enabled state of this command.
 void setFaceDescriptor(CommandFaceDescriptor faceDescriptor)
          Set the default faceDescriptor to use for this command.
 void setFaceDescriptor(String faceDescriptorId, CommandFaceDescriptor faceDescriptor)
          Add an additional CommandFaceDescriptor.
 void setFaceDescriptorRegistry(CommandFaceDescriptorRegistry faceDescriptorRegistry)
          Set the CommandFaceDescriptorRegistry to use when registering/looking up CommandFaceDescriptors.
 void setFaceDescriptors(Map faceDescriptors)
          Add a number of CommandFaceDescriptors to this Command.
 void setIcon(Icon icon)
          Set the provided icon on the default CommandFaceDescriptor.
 void setIconInfo(CommandButtonIconInfo iconInfo)
          Set the provided iconInfo on the default CommandFaceDescriptor.
protected  void setId(String id)
          Set the id.
 void setLabel(CommandButtonLabelInfo label)
          Set the provided label on the default CommandFaceDescriptor.
 void setLabel(String encodedLabel)
          Set the provided label on the default CommandFaceDescriptor.
 void setSecurityControllerId(String controllerId)
          Set the Id of the security controller that should manage this object.
 void setVisible(boolean value)
          Set this command visible and update all associated buttons.
 String toString()
          
protected  void updatedEnabledState()
          This method is called when any predicate for enabled state has changed.
protected  void updatedVisibleState()
           This method is called when any predicate for visible state has changed.
 
Methods inherited from class org.springframework.binding.value.support.AbstractPropertyChangePublisher
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, firePropertiesChanged, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasChanged, hasChanged, hasChanged, hasChanged, hasChanged, hasChanged, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.richclient.command.ActionCommandExecutor
execute
 

Field Detail

ENABLED_PROPERTY_NAME

public static final String ENABLED_PROPERTY_NAME
Property used to notify changes in the enabled state.

See Also:
Constant Field Values

VISIBLE_PROPERTY_NAME

public static final String VISIBLE_PROPERTY_NAME
Property used to notify changes in the visible state.

See Also:
Constant Field Values
Constructor Detail

AbstractCommand

protected AbstractCommand()
Default constructor. Id can be set by context.

See Also:
BeanNameAware

AbstractCommand

protected AbstractCommand(String id)
Constructor providing an id for configuration.

Parameters:
id -

AbstractCommand

protected AbstractCommand(String id,
                          String encodedLabel)
Constructor providing id and encodedLabel. A default FaceDescriptor will be created by passing the encodedLabel.

Parameters:
id -
encodedLabel - label to use when creating the default CommandFaceDescriptor.

AbstractCommand

protected AbstractCommand(String id,
                          String encodedLabel,
                          Icon icon,
                          String caption)
Constructor providing id and a number of parameters to create a default CommandFaceDescriptor.

Parameters:
id -
encodedLabel - label for the default CommandFaceDescriptor.
icon - icon for the default CommandFaceDescriptor.
caption - caption for the default CommandFaceDescriptor.

AbstractCommand

protected AbstractCommand(String id,
                          CommandFaceDescriptor faceDescriptor)
Constructor providing an id and the default FaceDescriptor.

Parameters:
id -
faceDescriptor - the default FaceDescriptor to use.

AbstractCommand

protected AbstractCommand(String id,
                          Map faceDescriptors)
Constructor providing an id and a number of FaceDescriptors. No default faceDescriptor is set.

Parameters:
id -
faceDescriptors - a map which contains <faceDescriptorId, faceDescriptor> pairs.
Method Detail

getId

public String getId()
Returns:
id of this Command.

setId

protected void setId(String id)
Set the id. In most cases, this is provided by the constructor or through the beanId provided in the applicationContext.

Parameters:
id -

setBeanName

public void setBeanName(String name)

Specified by:
setBeanName in interface BeanNameAware

setFaceDescriptor

public void setFaceDescriptor(CommandFaceDescriptor faceDescriptor)
Set the default faceDescriptor to use for this command.

Parameters:
faceDescriptor - the CommandFaceDescriptor to use as default.

setFaceDescriptor

public void setFaceDescriptor(String faceDescriptorId,
                              CommandFaceDescriptor faceDescriptor)
Add an additional CommandFaceDescriptor.

Parameters:
faceDescriptorId - key to identify and use this faceDescriptor.
faceDescriptor - additional CommandFaceDescriptor.

setFaceDescriptors

public void setFaceDescriptors(Map faceDescriptors)
Add a number of CommandFaceDescriptors to this Command.

Parameters:
faceDescriptors - a Map which contains <faceDescriptorId, CommandFaceDescriptor> pairs.

setDefaultFaceDescriptorId

public void setDefaultFaceDescriptorId(String defaultFaceDescriptorId)
Change the default FaceDescriptor.

Parameters:
defaultFaceDescriptorId - the id of the faceDescriptor to be used as default.

setFaceDescriptorRegistry

public void setFaceDescriptorRegistry(CommandFaceDescriptorRegistry faceDescriptorRegistry)
Set the CommandFaceDescriptorRegistry to use when registering/looking up CommandFaceDescriptors.

Parameters:
faceDescriptorRegistry - registry to use for the CommandFaceDescriptors.

setCommandServices

public void setCommandServices(CommandServices services)
Set the CommandServices.


setLabel

public void setLabel(String encodedLabel)
Set the provided label on the default CommandFaceDescriptor.

See Also:
CommandFaceDescriptor.setButtonLabelInfo(String)

setLabel

public void setLabel(CommandButtonLabelInfo label)
Set the provided label on the default CommandFaceDescriptor.

See Also:
CommandFaceDescriptor#setLabelInfo(String)

setCaption

public void setCaption(String shortDescription)
Set the provided description on the default CommandFaceDescriptor.

See Also:
CommandFaceDescriptor.setCaption(String)

setIcon

public void setIcon(Icon icon)
Set the provided icon on the default CommandFaceDescriptor.

See Also:
CommandFaceDescriptor.setIcon(Icon)

setIconInfo

public void setIconInfo(CommandButtonIconInfo iconInfo)
Set the provided iconInfo on the default CommandFaceDescriptor.

See Also:
CommandFaceDescriptor.setIconInfo(CommandButtonIconInfo)

afterPropertiesSet

public void afterPropertiesSet()
Performs initialisation and validation of this instance after its dependencies have been set. If subclasses override this method, they should begin by calling super.afterPropertiesSet().

Specified by:
afterPropertiesSet in interface InitializingBean

getDefaultFaceDescriptorId

public String getDefaultFaceDescriptorId()
Returns the default faceDescriptorId.


getFaceDescriptor

protected CommandFaceDescriptor getFaceDescriptor()
Returns the default faceDescriptor.


isFaceConfigured

public boolean isFaceConfigured()
Returns true if this command has a default faceDescriptor.


getIcon

public Icon getIcon()
Returns the icon from the default faceDescriptor or null if no faceDescriptor is available.


getText

public String getText()
Returns the text from the default faceDescriptor or the default text of the CommandButtonLabelInfo#BLANK_BUTTON_LABEL#getText().


getMnemonic

public int getMnemonic()
Returns the mnemonic from the default faceDescriptor or the default mnemonic of the CommandButtonLabelInfo#BLANK_BUTTON_LABEL#getMnemonic().


getMnemonicIndex

public int getMnemonicIndex()
Returns the mnemonicIndex from the default faceDescriptor or the default mnemonicIndex of the CommandButtonLabelInfo#BLANK_BUTTON_LABEL#getMnemonicIndex().


getAccelerator

public KeyStroke getAccelerator()
Returns the accelerator from the default faceDescriptor or the default accelerator of the CommandButtonLabelInfo#BLANK_BUTTON_LABEL#getAccelerator().


getFaceDescriptorRegistry

public CommandFaceDescriptorRegistry getFaceDescriptorRegistry()
Returns the CommandFaceDescriptorRegistry of this AbstractCommand which holds all face descriptors.


getCommandServices

protected CommandServices getCommandServices()
Returns the CommandServices for this AbstractCommand.


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()
Returns true if the command is authorized.

Specified by:
isAuthorized in interface Authorizable
Returns:
authorized

isEnabled

public boolean isEnabled()
Returns true if the command is enabled and isAuthorized().

Specified by:
isEnabled in interface Guarded
Returns:
if the object is in an enabled state, otherwise.
See Also:
isAuthorized()

updatedEnabledState

protected void updatedEnabledState()
This method is called when any predicate for enabled state has changed. This implementation fires the enabled changed event if the return value of isEnabled() has changed.

Subclasses which have an additional predicate to enabled state must call this method if the state of the predicate changes.


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

addEnabledListener

public 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.

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

removeEnabledListener

public 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.

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

defaultButtonIterator

protected final Iterator defaultButtonIterator()

Returns an iterator over all buttons in the default CommandFaceButtonManager.

To traverse all buttons of all CommandFaceButtonManagers see buttonIterator().


buttonIterator

protected final Iterator buttonIterator()
Returns an iterator over all buttons by traversing each CommandFaceButtonManager.


isAnonymous

public boolean isAnonymous()
Returns true if this command doesn't have an Id.


isVisible

public boolean isVisible()
Returns true if the command is visible.


setVisible

public void setVisible(boolean value)
Set this command visible and update all associated buttons.


updatedVisibleState

protected void updatedVisibleState()

This method is called when any predicate for visible state has changed. This implementation fires the visible changed event if the return value of isVisible() has changed.

Subclasses which have an additional predicate to visible state must call this method if the state of the predicate changes.


createButton

public final AbstractButton createButton()
Create a button using the defaults for faceDescriptorId, buttonFactory and buttonConfigurer.

See Also:
createButton(String, ButtonFactory, CommandButtonConfigurer)

createButton

public final AbstractButton createButton(String faceDescriptorId)
Create a button using the defaults for buttonFactory and buttonConfigurer.

See Also:
createButton(String, ButtonFactory, CommandButtonConfigurer)

createButton

public final AbstractButton createButton(ButtonFactory buttonFactory)
Create a button using the defaults for faceDescriptorId and buttonConfigurer.

See Also:
createButton(String, ButtonFactory, CommandButtonConfigurer)

createButton

public final AbstractButton createButton(String faceDescriptorId,
                                         ButtonFactory buttonFactory)
Create a button using the default buttonConfigurer.

See Also:
createButton(String, ButtonFactory, CommandButtonConfigurer)

createButton

public final AbstractButton createButton(ButtonFactory buttonFactory,
                                         CommandButtonConfigurer buttonConfigurer)
Create a button using the default buttonFactory.

See Also:
createButton(String, ButtonFactory, CommandButtonConfigurer)

createButton

public AbstractButton createButton(String faceDescriptorId,
                                   ButtonFactory buttonFactory,
                                   CommandButtonConfigurer buttonConfigurer)
Creates a button using the provided id, factory and configurer.

Parameters:
faceDescriptorId - id of the faceDescriptor used to configure the button.
buttonFactory - factory that delivers the button.
buttonConfigurer - configurer mapping the faceDescriptor on the button.
Returns:
a button attached to this command.

createMenuItem

public final JMenuItem createMenuItem()
Create a menuItem using the defaults for faceDescriptorId, menuFactory and menuItemButtonConfigurer.

See Also:
createMenuItem(String, MenuFactory, CommandButtonConfigurer)

createMenuItem

public final JMenuItem createMenuItem(String faceDescriptorId)
Create a menuItem using the defaults for menuFactory and menuItemButtonConfigurer.

See Also:
createMenuItem(String, MenuFactory, CommandButtonConfigurer)

createMenuItem

public final JMenuItem createMenuItem(MenuFactory menuFactory)
Create a menuItem using the defaults for faceDescriptorId and menuItemButtonConfigurer.

See Also:
createMenuItem(String, MenuFactory, CommandButtonConfigurer)

createMenuItem

public final JMenuItem createMenuItem(String faceDescriptorId,
                                      MenuFactory menuFactory)
Create a menuItem using the default and menuItemButtonConfigurer.

See Also:
createMenuItem(String, MenuFactory, CommandButtonConfigurer)

createMenuItem

public final JMenuItem createMenuItem(MenuFactory menuFactory,
                                      CommandButtonConfigurer buttonConfigurer)
Create a menuItem using the default faceDescriptorId.

See Also:
createMenuItem(String, MenuFactory, CommandButtonConfigurer)

createMenuItem

public JMenuItem createMenuItem(String faceDescriptorId,
                                MenuFactory menuFactory,
                                CommandButtonConfigurer buttonConfigurer)
Create a menuItem using the provided id, factory and configurer.

Parameters:
faceDescriptorId - id of the faceDescriptor used to configure the button.
menuFactory - factory that delivers the menuItem.
buttonConfigurer - configurer mapping the faceDescriptor on the button.
Returns:
a menuItem attached to this command.

attach

public void attach(AbstractButton button)
Attach and configure the button to the default faceDescriptor using the default configurer.

See Also:
attach(AbstractButton, String, CommandButtonConfigurer)

attach

public void attach(AbstractButton button,
                   CommandButtonConfigurer configurer)
Attach and configure the button to the default faceDescriptor using the given configurer.

See Also:
attach(AbstractButton, String, CommandButtonConfigurer)

attach

public void attach(AbstractButton button,
                   String faceDescriptorId,
                   CommandButtonConfigurer configurer)
Attach and configure the button to the faceDescriptorId using the configurer.

Parameters:
button - the button to attach and configure.
faceDescriptorId - the id of the faceDescriptor.
configurer - that maps the faceDescriptor on the button.

onButtonAttached

protected void onButtonAttached(AbstractButton button)
Additional code to execute when attaching a button.

Parameters:
button - the button that has been attached.

detach

public void detach(AbstractButton button)
Detach the button from the CommandFaceButtonManager.

Parameters:
button - the button to detach.

isAttached

public boolean isAttached(AbstractButton b)
Returns true if the provided button is attached to the default CommandFaceButtonManager.

Parameters:
b - the button to check.
Returns:
true if b is attached to the default CommandFaceButtonManager.

onButtonDetached

protected void onButtonDetached()
Implement this to add custom code executed when detaching a button.


getDefaultButtonConfigurer

protected CommandButtonConfigurer getDefaultButtonConfigurer()
See Also:
CommandServices.getDefaultButtonConfigurer()

getToolBarButtonConfigurer

protected CommandButtonConfigurer getToolBarButtonConfigurer()
See Also:
CommandServices.getToolBarButtonConfigurer()

getToolBarButtonFactory

protected ButtonFactory getToolBarButtonFactory()
See Also:
CommandServices.getToolBarButtonFactory()

getMenuItemButtonConfigurer

protected CommandButtonConfigurer getMenuItemButtonConfigurer()
See Also:
CommandServices.getMenuItemButtonConfigurer()

getComponentFactory

protected ComponentFactory getComponentFactory()
See Also:
CommandServices.getComponentFactory()

getButtonFactory

protected ButtonFactory getButtonFactory()
See Also:
CommandServices.getButtonFactory()

getMenuFactory

protected MenuFactory getMenuFactory()
See Also:
CommandServices.getMenuFactory()

requestFocusIn

public boolean requestFocusIn(Container container)
Search for a button representing this command in the provided container and let it request the focus.

Parameters:
container - the container which holds the command button.
Returns:
true if the focus request is likely to succeed.
See Also:
getButtonIn(Container), JComponent.requestFocusInWindow()

getButtonIn

public AbstractButton getButtonIn(Container container)
Search for the first button of this command that is a child component of the given container.

Parameters:
container - the container to be searched.
Returns:
the AbstractButton representing this command that is embedded in the container or null if none was found.

toString

public String toString()

Overrides:
toString in class Object


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