|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.richclient.command.GroupMember
org.springframework.richclient.command.SimpleGroupMember
public class SimpleGroupMember
A simple implementation of the GroupMember
interface that manages normal commands that
can be associated with instances of AbstractButton
s.
Field Summary |
---|
Fields inherited from class org.springframework.richclient.command.GroupMember |
---|
logger |
Constructor Summary | |
---|---|
SimpleGroupMember(CommandGroup parentGroup,
AbstractCommand command)
Creates a new SimpleGroupMember belonging to the given command group and wrapping
the given command. |
Method Summary | |
---|---|
protected 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. |
protected AbstractButton |
findButton(AbstractCommand attachedCommand,
List buttons)
Searches the given list of AbstractButton s for one that is not an instance of a
JMenuItem and has the given command attached to it. |
protected JMenuItem |
findMenu(AbstractCommand attachedCommand,
List abstractButtons)
Searches the given list of AbstractButton s for one that is an instance of a
JMenuItem and has the given command attached to it. |
AbstractCommand |
getCommand()
Returns the underlying command, never null. |
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)
Sets the enabled flag of the underlying command. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SimpleGroupMember(CommandGroup parentGroup, AbstractCommand command)
SimpleGroupMember
belonging to the given command group and wrapping
the given command.
parentGroup
- The command group that this member belongs to.command
- The command that this group member represents.
IllegalArgumentException
- if either argument is null.
InvalidGroupMemberException
- if the given command group does not support the type of
the given command.Method Detail |
---|
public void setEnabled(boolean enabled)
setEnabled
in class GroupMember
enabled
- The enabled flag.protected void fill(GroupContainerPopulator containerPopulator, Object controlFactory, CommandButtonConfigurer buttonConfigurer, List previousButtons)
GroupMember
controlFactory
provided, but it will generally be
a control that a command can be associated with, such as a button or menu item.
fill
in class GroupMember
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.public boolean managesCommand(String commandId)
CommandGroup
.
managesCommand
in class GroupMember
commandId
- The id of the command to be checked for. May be null.
public AbstractCommand getCommand()
getCommand
in class GroupMember
protected JMenuItem findMenu(AbstractCommand attachedCommand, List abstractButtons)
AbstractButton
s for one that is an instance of a
JMenuItem
and has the given command attached to it. If found, the menu item will be
removed from the list.
attachedCommand
- The command that we are checking to see if it attached to any item in the list.abstractButtons
- The collection of AbstractButton
s that will be checked to
see if they have the given command attached to them. May be null or empty.
protected AbstractButton findButton(AbstractCommand attachedCommand, List buttons)
AbstractButton
s for one that is not an instance of a
JMenuItem
and has the given command attached to it. If found, the button will be
removed from the list.
attachedCommand
- The command that we are checking to see if it attached to any item in the list.abstractButtons
- The collection of AbstractButton
s that will be checked to
see if they have the given command attached to them. May be null or empty.
protected void onAdded()
onAdded
in class GroupMember
protected void onRemoved()
onRemoved
in class GroupMember
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |