GUI Commands User GuideVersion 2.1 |
||
Group BuildersGroupBuilders allow you to programmatically create and modify the members of a given group. The following is an example of rebuilding a group from scratch.
CommandGroup group = new CommandGroup("my-group");
// get the builder
GroupBuilder builder = group.getBuilder();
// remove any existing members.
builder.clear();
// add some members that will be found from the
// groups CommandConatiner.
builder.add("my-command");
builder.addInline("another-group");
// add a separator member.
builder.addSeparator();
// add a command that will be used regardless of the
// current command container.
builder.add(anAnonymousCommand);
// apply the changes
builder.applyChanges();
Once either |
||