org.springframework.richclient.command
Class GroupMember

java.lang.Object
  extended by org.springframework.richclient.command.GroupMember
Direct Known Subclasses:
ComponentGroupMember, ExpansionPointGroupMember, GlueGroupMember, LazyGroupMember, SeparatorGroupMember, SimpleGroupMember

public abstract class GroupMember
extends Object

A member of a CommandGroup.

A command group will generally consist of command objects but may also contain other objects such as separators or glue components used for spacing. This class is a simple wrapper around these various types of command group members.


Field Summary
protected  org.apache.commons.logging.Log logger
          Class logger, available to subclasses.
 
Constructor Summary
GroupMember()
           
 
Method Summary
protected abstract  void fill(GroupContainerPopulator containerPopulator, Object controlFactory, CommandButtonConfigurer buttonConfigurer, List previousButtons)
          Subclasses must implement this method to use the given container populator to add a GUI control component to a GUI container.
 AbstractCommand getCommand()
          Subclasses may override to return the command that they wrap.
abstract  boolean managesCommand(String commandId)
          Subclasses must implement this method to indicate whether or not they manage a command with the given id.
protected  void onAdded()
          Subclasses may override to be notified when they are added to a command group.
protected  void onRemoved()
          Subclasses may override to be notified when they are removed from the group they belong to.
abstract  void setEnabled(boolean enabled)
          Subclasses may override this method to allow their underlying command to be enabled or disabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Class logger, available to subclasses.

Constructor Detail

GroupMember

public GroupMember()
Method Detail

fill

protected abstract void fill(GroupContainerPopulator containerPopulator,
                             Object controlFactory,
                             CommandButtonConfigurer buttonConfigurer,
                             List previousButtons)
Subclasses must implement this method to use the given container populator to add a GUI control component to a GUI container. The actual type of the GUI control will be determined by the type of the controlFactory provided, but it will generally be a control that a command can be associated with, such as a button or menu item.

Parameters:
containerPopulator - The object responsible for populating a GUI container with an appropriate control component based on this instance. Must not be null.
controlFactory - The factory for creating an appropriate GUI control that the underlying command will be associated with.
buttonConfigurer - The object that is to configure the newly created control component.
previousButtons - A list of AbstractButton instances that have already been added to the container. May be null or empty.
Throws:
IllegalArgumentException - if containerPopulator, controlFactory or buttonConfigurer are null.

setEnabled

public abstract void setEnabled(boolean enabled)
Subclasses may override this method to allow their underlying command to be enabled or disabled.

Parameters:
enabled - The enabled flag.

managesCommand

public abstract boolean managesCommand(String commandId)
Subclasses must implement this method to indicate whether or not they manage a command with the given id. This method should also traverse nested commands if the command managed by this member is a CommandGroup.

Parameters:
commandId - The id of the command to be checked for. May be null.
Returns:
true if the command, or any of its nested commands, managed by this group member has the given command id.

getCommand

public AbstractCommand getCommand()
Subclasses may override to return the command that they wrap.

Returns:
The wrapped command, possibly null.

onAdded

protected void onAdded()
Subclasses may override to be notified when they are added to a command group.


onRemoved

protected void onRemoved()
Subclasses may override to be notified when they are removed from the group they belong to.



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