|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.binding.value.support.AbstractPropertyChangePublisher
org.springframework.richclient.command.AbstractCommand
org.springframework.richclient.command.CommandGroup
public class CommandGroup
Implementation of an AbstractCommand
that groups a collection of
commands. This can be used to construct a menu with all kinds of sub menus.
Field Summary |
---|
Fields inherited from class org.springframework.richclient.command.AbstractCommand |
---|
ENABLED_PROPERTY_NAME, VISIBLE_PROPERTY_NAME |
Fields inherited from class org.springframework.binding.value.support.AbstractPropertyChangePublisher |
---|
logger |
Fields inherited from interface org.springframework.richclient.core.Authorizable |
---|
AUTHORIZED_PROPERTY |
Constructor Summary | |
---|---|
CommandGroup()
|
|
CommandGroup(String groupId)
|
|
CommandGroup(String groupId,
CommandFaceDescriptor face)
|
|
CommandGroup(String groupId,
CommandRegistry commandRegistry)
Constructor with id for configuration and the CommandRegistry to use. |
|
CommandGroup(String id,
String encodedLabel)
|
|
CommandGroup(String id,
String encodedLabel,
Icon icon,
String caption)
|
Method Summary | |
---|---|
void |
add(AbstractCommand command)
|
void |
add(AbstractCommand command,
boolean rebuild)
|
void |
add(String groupMemberPath,
AbstractCommand command)
|
void |
add(String groupMemberPath,
AbstractCommand command,
boolean rebuild)
|
protected void |
addCommandsToGroupContainer(GroupContainerPopulator groupContainerPopulator)
Create a container with the given GroupContainerPopulator which will hold the members of this group. |
protected void |
addComponentInternal(Component component)
|
void |
addGlue()
|
void |
addGlue(boolean rebuild)
|
protected void |
addGlueInternal()
|
void |
addGroupListener(CommandGroupListener l)
|
protected void |
addInternal(AbstractCommand command)
|
protected void |
addLazyInternal(String commandId)
|
void |
addSeparator()
|
void |
addSeparator(boolean rebuild)
|
protected void |
addSeparatorInternal()
|
boolean |
contains(AbstractCommand command)
|
AbstractButton |
createButton(ButtonFactory buttonFactory,
MenuFactory menuFactory)
|
AbstractButton |
createButton(ButtonFactory buttonFactory,
MenuFactory menuFactory,
CommandButtonConfigurer buttonConfigurer)
|
AbstractButton |
createButton(String faceDescriptorId,
ButtonFactory buttonFactory,
CommandButtonConfigurer buttonConfigurer)
Creates a button using the provided id, factory and configurer. |
AbstractButton |
createButton(String faceDescriptorId,
ButtonFactory buttonFactory,
MenuFactory menuFactory)
|
AbstractButton |
createButton(String faceDescriptorId,
ButtonFactory buttonFactory,
MenuFactory menuFactory,
CommandButtonConfigurer buttonConfigurer)
|
JComponent |
createButtonBar()
Create a button bar with buttons for all the commands in this group. |
JComponent |
createButtonBar(com.jgoodies.forms.layout.ColumnSpec columnSpec,
com.jgoodies.forms.layout.RowSpec rowSpec)
Create a button bar with buttons for all the commands in this. |
JComponent |
createButtonBar(com.jgoodies.forms.layout.ColumnSpec columnSpec,
com.jgoodies.forms.layout.RowSpec rowSpec,
Border border)
Create a button bar with buttons for all the commands in this. |
JComponent |
createButtonBar(com.jgoodies.forms.layout.Size minimumButtonSize)
Create a button bar with buttons for all the commands in this group. |
JComponent |
createButtonBar(com.jgoodies.forms.layout.Size minimumButtonSize,
Border border)
Create a button bar with buttons for all the commands in this. |
JComponent |
createButtonStack()
Create a button stack with buttons for all the commands. |
JComponent |
createButtonStack(com.jgoodies.forms.layout.ColumnSpec columnSpec,
com.jgoodies.forms.layout.RowSpec rowSpec)
Create a button stack with buttons for all the commands. |
JComponent |
createButtonStack(com.jgoodies.forms.layout.ColumnSpec columnSpec,
com.jgoodies.forms.layout.RowSpec rowSpec,
Border border)
Create a button stack with buttons for all the commands. |
JComponent |
createButtonStack(com.jgoodies.forms.layout.Size minimumButtonSize)
Create a button stack with buttons for all the commands. |
JComponent |
createButtonStack(com.jgoodies.forms.layout.Size minimumButtonSize,
Border border)
Create a button stack with buttons for all the commands. |
static CommandGroup |
createCommandGroup(AbstractCommand member)
Creates a command group with a single command member. |
static CommandGroup |
createCommandGroup(Object[] members)
Create a command group which holds all the given members. |
static CommandGroup |
createCommandGroup(String groupId,
Object[] members)
Create a command group which holds all the given members. |
static CommandGroup |
createCommandGroup(String groupId,
Object[] members,
CommandConfigurer configurer)
Create a command group which holds all the given members. |
static CommandGroup |
createExclusiveCommandGroup(Object[] members)
|
static CommandGroup |
createExclusiveCommandGroup(String groupId,
Object[] members)
|
static CommandGroup |
createExclusiveCommandGroup(String groupId,
Object[] members,
CommandConfigurer configurer)
|
JMenuBar |
createMenuBar()
|
JMenuBar |
createMenuBar(MenuFactory factory)
|
JMenuItem |
createMenuItem(String faceDescriptorId,
MenuFactory factory,
CommandButtonConfigurer buttonConfigurer)
Create a menuItem using the provided id, factory and configurer. |
JPopupMenu |
createPopupMenu()
|
JPopupMenu |
createPopupMenu(MenuFactory factory)
|
JComponent |
createToolBar()
|
JComponent |
createToolBar(ButtonFactory buttonFactory)
|
void |
execute()
Executes all the members of this group. |
AbstractCommand |
find(String memberPath)
Search for and return the command contained by this group with the specified path. |
protected void |
fireMembersChanged()
|
protected CommandRegistry |
getCommandRegistry()
|
int |
getMemberCount()
|
protected GroupMemberList |
getMemberList()
|
protected CommandButtonConfigurer |
getPullDownMenuButtonConfigurer()
|
boolean |
isAllowedMember(AbstractCommand proposedMember)
|
protected Iterator |
memberIterator()
|
protected void |
rebuildAllControls()
|
void |
remove(AbstractCommand command)
|
void |
remove(AbstractCommand command,
boolean rebuild)
|
void |
remove(String groupMemberPath,
AbstractCommand command)
|
void |
remove(String groupMemberPath,
AbstractCommand command,
boolean rebuild)
|
void |
removeGroupListener(CommandGroupListener l)
|
void |
reset()
|
void |
setCommandRegistry(CommandRegistry registry)
|
void |
setEnabled(boolean enabled)
Set the enabled state of this command. |
void |
setVisible(boolean visible)
Set this command visible and update all associated buttons. |
int |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CommandGroup()
AbstractCommand.AbstractCommand()
public CommandGroup(String groupId)
AbstractCommand.AbstractCommand(String)
public CommandGroup(String groupId, CommandFaceDescriptor face)
AbstractCommand.AbstractCommand(String, CommandFaceDescriptor)
public CommandGroup(String groupId, CommandRegistry commandRegistry)
CommandRegistry
to use.
AbstractCommand.AbstractCommand(String)
public CommandGroup(String id, String encodedLabel)
AbstractCommand.AbstractCommand(String, String)
public CommandGroup(String id, String encodedLabel, Icon icon, String caption)
AbstractCommand.AbstractCommand(String, String, Icon, String)
Method Detail |
---|
public static CommandGroup createCommandGroup(AbstractCommand member)
member
- the command to put in the CommandGroup
CommandGroup
which contains the given command.public static CommandGroup createCommandGroup(Object[] members)
members
- members to add to the group.
CommandGroup
which contains all the members.public static CommandGroup createCommandGroup(String groupId, Object[] members)
id
- the id to configure the group.members
- members to add to the group.
CommandGroup
which contains all the members.public static CommandGroup createCommandGroup(String groupId, Object[] members, CommandConfigurer configurer)
id
- the id to configure the group.members
- members to add to the group.configurer
- the configurer to use.
CommandGroup
which contains all the members.public static CommandGroup createExclusiveCommandGroup(Object[] members)
public static CommandGroup createExclusiveCommandGroup(String groupId, Object[] members)
public static CommandGroup createExclusiveCommandGroup(String groupId, Object[] members, CommandConfigurer configurer)
protected void addInternal(AbstractCommand command)
protected void addLazyInternal(String commandId)
protected void addSeparatorInternal()
protected void addGlueInternal()
protected void addComponentInternal(Component component)
public final void setCommandRegistry(CommandRegistry registry)
public void setEnabled(boolean enabled)
AbstractCommand
setEnabled
in interface Guarded
setEnabled
in class AbstractCommand
enabled
- statepublic void setVisible(boolean visible)
AbstractCommand
setVisible
in class AbstractCommand
protected CommandRegistry getCommandRegistry()
public void add(AbstractCommand command)
public void add(AbstractCommand command, boolean rebuild)
public void add(String groupMemberPath, AbstractCommand command)
public void add(String groupMemberPath, AbstractCommand command, boolean rebuild)
public void remove(AbstractCommand command)
public void remove(AbstractCommand command, boolean rebuild)
public void remove(String groupMemberPath, AbstractCommand command)
public void remove(String groupMemberPath, AbstractCommand command, boolean rebuild)
public void addSeparator()
public void addSeparator(boolean rebuild)
public void addGlue()
public void addGlue(boolean rebuild)
protected void rebuildAllControls()
protected GroupMemberList getMemberList()
protected Iterator memberIterator()
public int size()
public boolean isAllowedMember(AbstractCommand proposedMember)
public AbstractCommand find(String memberPath)
memberPath
- the path of the command, with nested levels deliniated
by the "/" path separator.
null
if no was command found.public void execute()
public int getMemberCount()
public boolean contains(AbstractCommand command)
public void reset()
public AbstractButton createButton(String faceDescriptorId, ButtonFactory buttonFactory, CommandButtonConfigurer buttonConfigurer)
AbstractCommand
createButton
in class AbstractCommand
faceDescriptorId
- id of the faceDescriptor used to configure the
button.buttonFactory
- factory that delivers the button.buttonConfigurer
- configurer mapping the faceDescriptor on the
button.
public AbstractButton createButton(ButtonFactory buttonFactory, MenuFactory menuFactory)
public AbstractButton createButton(String faceDescriptorId, ButtonFactory buttonFactory, MenuFactory menuFactory)
public AbstractButton createButton(ButtonFactory buttonFactory, MenuFactory menuFactory, CommandButtonConfigurer buttonConfigurer)
public AbstractButton createButton(String faceDescriptorId, ButtonFactory buttonFactory, MenuFactory menuFactory, CommandButtonConfigurer buttonConfigurer)
protected CommandButtonConfigurer getPullDownMenuButtonConfigurer()
public JMenuItem createMenuItem(String faceDescriptorId, MenuFactory factory, CommandButtonConfigurer buttonConfigurer)
AbstractCommand
createMenuItem
in class AbstractCommand
faceDescriptorId
- id of the faceDescriptor used to configure the
button.factory
- factory that delivers the menuItem.buttonConfigurer
- configurer mapping the faceDescriptor on the
button.
public JPopupMenu createPopupMenu()
public JPopupMenu createPopupMenu(MenuFactory factory)
public JComponent createToolBar()
public JComponent createToolBar(ButtonFactory buttonFactory)
public JMenuBar createMenuBar()
public JMenuBar createMenuBar(MenuFactory factory)
public JComponent createButtonBar()
public JComponent createButtonBar(com.jgoodies.forms.layout.Size minimumButtonSize)
minimumButtonSize
- if null, then there is no minimum size
public JComponent createButtonBar(com.jgoodies.forms.layout.ColumnSpec columnSpec, com.jgoodies.forms.layout.RowSpec rowSpec)
columnSpec
- Custom columnSpec for each column containing a button,
can be null
.rowSpec
- Custom rowspec for the buttonbar, can be null
.
public JComponent createButtonBar(com.jgoodies.forms.layout.Size minimumButtonSize, Border border)
minimumButtonSize
- if null, then there is no minimum sizeborder
- if null, then don't use a border
public JComponent createButtonBar(com.jgoodies.forms.layout.ColumnSpec columnSpec, com.jgoodies.forms.layout.RowSpec rowSpec, Border border)
columnSpec
- Custom columnSpec for each column containing a button,
can be null
.rowSpec
- Custom rowspec for the buttonbar, can be null
.border
- if null, then don't use a border
public JComponent createButtonStack()
public JComponent createButtonStack(com.jgoodies.forms.layout.Size minimumButtonSize)
minimumButtonSize
- Minimum size of the buttons (can be null)
public JComponent createButtonStack(com.jgoodies.forms.layout.Size minimumButtonSize, Border border)
minimumButtonSize
- Minimum size of the buttons (can be
null
)border
- Border to set around the stack.
public JComponent createButtonStack(com.jgoodies.forms.layout.ColumnSpec columnSpec, com.jgoodies.forms.layout.RowSpec rowSpec)
columnSpec
- Custom columnSpec for the stack, can be
null
.rowSpec
- Custom rowspec for each row containing a button can be
null
.
public JComponent createButtonStack(com.jgoodies.forms.layout.ColumnSpec columnSpec, com.jgoodies.forms.layout.RowSpec rowSpec, Border border)
columnSpec
- Custom columnSpec for the stack, can be
null
.rowSpec
- Custom rowspec for each row containing a button can be
null
.border
- Border to set around the stack.
protected void addCommandsToGroupContainer(GroupContainerPopulator groupContainerPopulator)
groupContainerPopulator
- public void addGroupListener(CommandGroupListener l)
public void removeGroupListener(CommandGroupListener l)
protected void fireMembersChanged()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |