|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.pietschy.command.group.impl.AbstractGroupBuilder
public abstract class AbstractGroupBuilder
Base implementation of GroupBuilder. This class provides the core functionality,
sub classes need to implement #applyChanges(Collection and GroupBuilder.discard().
| Constructor Summary | |
|---|---|
protected |
AbstractGroupBuilder(CommandGroup parent,
java.util.Collection<GroupMember> members,
ExpansionPointMember expansionMember)
Creates a new builder instance. |
| 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. |
protected abstract void |
applyChanges(java.util.Collection<GroupMember> members)
|
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. |
protected GroupMember |
getMemberFor(java.lang.String id)
|
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. |
protected void |
validate(Command command)
Validates the the command is non-null and that it's not already a member. |
protected void |
validate(java.lang.String id)
Validates the specified command id. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.pietschy.command.group.GroupBuilder |
|---|
discard |
| Constructor Detail |
|---|
protected AbstractGroupBuilder(CommandGroup parent,
java.util.Collection<GroupMember> members,
ExpansionPointMember expansionMember)
parent - the parent group that is being built.members - the parent groups existing members.expansionMember - the parent groups expansion point.| Method Detail |
|---|
public void applyChanges()
GroupBuilder
applyChanges in interface GroupBuilderprotected abstract void applyChanges(java.util.Collection<GroupMember> members)
public void add(java.lang.String id)
GroupBuilderThe group will use it's current binding to locate the actual command instance.
add in interface GroupBuilderid - the id of the command or group to add.public void addInline(java.lang.String id)
GroupBuilderThe group will use it's current binding to locate the actual group instance.
addInline in interface GroupBuilderid - the id of the group to add.public void add(ActionCommand command)
GroupBuilder
add in interface GroupBuildercommand - the command to add.public void add(CommandGroup group)
GroupBuilder
add in interface GroupBuildergroup - the group to add.public void addInline(CommandGroup group)
GroupBuilderThe group will use it's current binding to locate the actual group instance.
addInline in interface GroupBuildergroup - the group to add.public void addGlue()
GroupBuilderBox.createGlue().
Glue members are ignored for menu bars on the Mac OS plaform.
addGlue in interface GroupBuilderpublic void addSeparator()
GroupBuilder
addSeparator in interface GroupBuilderpublic void remove(java.lang.String id)
GroupBuilder
remove in interface GroupBuilderid - the id of the command to remove.protected GroupMember getMemberFor(java.lang.String id)
public void remove(ActionCommand command)
GroupBuilder
remove in interface GroupBuildercommand - the command to remove.public void remove(CommandGroup group)
GroupBuilder
remove in interface GroupBuildergroup - the group to remove.public boolean contains(ActionCommand command)
GroupBuilder
contains in interface GroupBuildercommand - the command to check.
true if the builder already contains the command, false otherwise.public boolean contains(CommandGroup group)
GroupBuilder
contains in interface GroupBuildergroup - the group to check.
true if the builder already contains the group, false otherwise.public boolean contains(java.lang.String id)
GroupBuilder
contains in interface GroupBuilderid - the id of the command or group to check.
true if the builder already contains the command or group, false otherwise.public void clear()
GroupBuilder
clear in interface GroupBuilderpublic void addExpansionPoint(SeparatorMode mode)
GroupBuilderSeparatorMode. The expansion
point will only render it's separators if it contains one or more members.
addExpansionPoint in interface GroupBuildermode - the separator mode to use.CommandGroup.getExpansionPointBuilder()public void removeExpansionPoint()
GroupBuilder
If not explicitly added again, the expansion point will be automatically inserted at the
end of the group with the separator mode SeparatorMode.NONE.
removeExpansionPoint in interface GroupBuilderprotected void validate(Command command)
command - the command to validate.protected void validate(java.lang.String id)
id - the id to validate.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||