org.springframework.richclient.command
Class LazyGroupMember

java.lang.Object
  extended by org.springframework.richclient.command.GroupMember
      extended by org.springframework.richclient.command.LazyGroupMember

public class LazyGroupMember
extends GroupMember

A GroupMember implementation that can be used as a placeholder for lazily initialized commands.


Field Summary
 
Fields inherited from class org.springframework.richclient.command.GroupMember
logger
 
Constructor Summary
LazyGroupMember(CommandGroup parentGroup, String lazyCommandId)
          Creates a new LazyGroupMember belonging to the given command group and managing a lazily initialized command with the given id.
 
Method Summary
protected  void fill(GroupContainerPopulator parentContainerPopulator, 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.
 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.
 void setEnabled(boolean enabled)
          Delegates this call to the lazily loaded member, but only if it has already been loaded.
 
Methods inherited from class org.springframework.richclient.command.GroupMember
getCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazyGroupMember

public LazyGroupMember(CommandGroup parentGroup,
                       String lazyCommandId)
Creates a new LazyGroupMember belonging to the given command group and managing a lazily initialized command with the given id.

Parameters:
parentGroup - The command group that this member belongs to.
lazyCommandId - The id of the command that this group member represents.
Throws:
IllegalArgumentException - if either argument is null.
Method Detail

setEnabled

public void setEnabled(boolean enabled)
Delegates this call to the lazily loaded member, but only if it has already been loaded. Calling this method before the underlying member has beeen loaded will have no effect.

Specified by:
setEnabled in class GroupMember
Parameters:
enabled - The enabled flag.

fill

protected void fill(GroupContainerPopulator parentContainerPopulator,
                    Object controlFactory,
                    CommandButtonConfigurer buttonConfigurer,
                    List previousButtons)
Description copied from class: GroupMember
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.

Specified by:
fill in class GroupMember
Parameters:
parentContainerPopulator - 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.

managesCommand

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

Specified by:
managesCommand in class GroupMember
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.

onAdded

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

Overrides:
onAdded in class GroupMember

onRemoved

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

Overrides:
onRemoved in class GroupMember


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