com.pietschy.command.group
Interface GroupBuilder

All Known Implementing Classes:
AbstractGroupBuilder, DelegatingToggleGroup.DelegatingToggleGroupBuilder

public interface GroupBuilder

Interface for programatically managing the members of a group.


Method Summary
 void add(ActionCommand command)
          Adds the specified command.
 void add(CommandGroup group)
          Adds the specified group.
 void add(java.lang.String id)
          Adds the command with the specified id.
 void addExpansionPoint(SeparatorMode mode)
          Adds an expansion point to the group using the specified SeparatorMode.
 void addGlue()
          Adds a glue member to the group.
 void addInline(CommandGroup group)
          Adds the specified group as an inline member.
 void addInline(java.lang.String id)
          Adds the group with the specified id as an inline member.
 void addSeparator()
          Adds a separator member to the group.
 void applyChanges()
          Applies the current builder state to the group and discards the builder.
 void clear()
          Clears the group.
 boolean contains(ActionCommand command)
          Checks if the builder contains the specified command.
 boolean contains(CommandGroup group)
          Checks if the builder contains the specified group.
 boolean contains(java.lang.String id)
          Checks if the builder contains the command or group with the specified id.
 void discard()
          Discards the builder without updating the group.
 void remove(ActionCommand command)
          Removes the specified command from the group.
 void remove(CommandGroup group)
          Removes the specified command from the group.
 void remove(java.lang.String id)
          Removes the member with the specified id.
 void removeExpansionPoint()
          Removes the expasion point.
 

Method Detail

add

void add(java.lang.String id)
Adds the command with the specified id. The id can be that of an ActionCommand or CommandGroup.

The group will use it's current binding to locate the actual command instance.

Parameters:
id - the id of the command or group to add.

add

void add(ActionCommand command)
Adds the specified command. The command can be anonymous and does not need to be bound.

Parameters:
command - the command to add.

add

void add(CommandGroup group)
Adds the specified group. The added group can be anonymous and does not need to be bound.

Parameters:
group - the group to add.

addInline

void addInline(java.lang.String id)
Adds the group with the specified id as an inline member. Inline members have thier contents embedded directly in the parent group instead of as a sub menu.

The group will use it's current binding to locate the actual group instance.

Parameters:
id - the id of the group to add.

addInline

void addInline(CommandGroup group)
Adds the specified group as an inline member. Inline members have thier contents embedded directly in the parent group instead of as a sub menu. The added group can be anonymous and does not need to be bound.

The group will use it's current binding to locate the actual group instance.

Parameters:
group - the group to add.

addGlue

void addGlue()
Adds a glue member to the group. Glue members function equivalently to Box.createGlue().

Glue members are ignored for menu bars on the Mac OS plaform.


addSeparator

void addSeparator()
Adds a separator member to the group.


remove

void remove(java.lang.String id)
Removes the member with the specified id.

Parameters:
id - the id of the command to remove.

remove

void remove(ActionCommand command)
Removes the specified command from the group.

Parameters:
command - the command to remove.

remove

void remove(CommandGroup group)
Removes the specified command from the group.

Parameters:
group - the group to remove.

contains

boolean contains(ActionCommand command)
Checks if the builder contains the specified command.

Parameters:
command - the command to check.
Returns:
true if the builder already contains the command, false otherwise.

contains

boolean contains(CommandGroup group)
Checks if the builder contains the specified group.

Parameters:
group - the group to check.
Returns:
true if the builder already contains the group, false otherwise.

contains

boolean contains(java.lang.String id)
Checks if the builder contains the command or group with the specified id.

Parameters:
id - the id of the command or group to check.
Returns:
true if the builder already contains the command or group, false otherwise.

clear

void clear()
Clears the group.


addExpansionPoint

void addExpansionPoint(SeparatorMode mode)
Adds an expansion point to the group using the specified SeparatorMode. The expansion point will only render it's separators if it contains one or more members.

Parameters:
mode - the separator mode to use.
See Also:
CommandGroup.getExpansionPointBuilder()

removeExpansionPoint

void removeExpansionPoint()
Removes the expasion point.

If not explicitly added again, the expansion point will be automatically inserted at the end of the group with the separator mode SeparatorMode.NONE.


applyChanges

void applyChanges()
Applies the current builder state to the group and discards the builder. Further changes to the group will require a new builder instance.


discard

void discard()
Discards the builder without updating the group. Any future changes to the group will require a new builder instance.



Copyright © 2006 - 2007 Andrew Pietsch