org.pietschy.command
Class ToggleCommandGroup

java.lang.Object
  extended by org.pietschy.command.Command
      extended by org.pietschy.command.CommandGroup
          extended by org.pietschy.command.ToggleCommandGroup
All Implemented Interfaces:
java.util.EventListener, CommandManagerListener
Direct Known Subclasses:
PageSelectorGroup

public class ToggleCommandGroup
extends CommandGroup

ToggleGroupCommand managed mutually exclusive collections of ToggleCommands.


Field Summary
 
Fields inherited from class org.pietschy.command.CommandGroup
memberList
 
Fields inherited from class org.pietschy.command.Command
internalLog, listenerList, pcs
 
Constructor Summary
ToggleCommandGroup(CommandManager commandManager)
          Creates a new anonymous command group with the specified id.
ToggleCommandGroup(CommandManager commandManager, java.lang.String groupId)
          Creates a new command groups with the specified id.
 
Method Summary
protected  ToggleGroupController getController()
          Gets the ToggleGroupController managing this group.
 boolean isAllowableMember(Command prospectiveMember)
          Ensures that only ToggleCommand instances are added to this group.
 boolean isEmptySelectionAllowed()
          Checks if this group allows the last selected command to be deselected.
 boolean isExclusive()
           
 void setEmptySelectionAllowed(boolean emptySelectionAllowed)
          Configures if this group allows the last selected command to be deselected.
 void setExclusive(boolean exclusive)
           
 
Methods inherited from class org.pietschy.command.CommandGroup
acceptVisitor, add, add, addGlue, addGlue, addGroupListener, addInline, addInline, addSeparator, addSeparator, bindMembers, bindMembers, commandRegistered, contains, createButton, createButton, createMenuBar, createMenuBar, createMenuBar, createMenuBar, createMenuItem, createPopupMenu, createPopupMenu, createToolBar, createToolBar, createToolBar, createToolBar, fireMembersChanged, getMemberCount, getMemberFactory, getMemberList, isInlineMember, isMember, rebuildAllPopups, remove, remove, removeGroupListener, reset, reset, visit, visitChildren
 
Methods inherited from class org.pietschy.command.Command
addFace, addHoverListener, addNewFace, addNotify, addPropertyChangeListener, addPropertyChangeListener, attach, buttonIterator, configureButtonAppearance, configureButtonAppearances, configureButtonAppearances, configureButtonStates, createButton, createButton, createButton, createMenuItem, createMenuItem, createMenuItem, detach, export, faceExists, fireHoverEnded, fireHoverStarted, getAccelerator, getAlternativeFaceNames, getButtonFactory, getButtonIn, getCommandManager, getDefaultFace, getDefaultFace, getDescription, getFace, getFace, getIcon, getId, getLongDescription, getMenuFactory, getMnemonic, getMnemonicIndex, getProperty, getProperty, getPropertyNames, getSelectedIcon, getText, getTextPosition, getToolbarFactory, initCommandManager, installFace, isAnonymous, isAttachedTo, isEnabled, isVisible, putProperty, removeHoverListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, requestFocusIn, setAccelerator, setButtonFactory, setDescription, setEnabled, setIcon, setLongDescription, setMenuFactory, setMnemonic, setMnemonicIndex, setSelectedIcon, setText, setTextPosition, setToolbarFactory, setVisible, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ToggleCommandGroup

public ToggleCommandGroup(CommandManager commandManager)
Creates a new anonymous command group with the specified id. CommandGroups are lazy loading in that they will store the only the command ids until they are asked to create a button or menu. The command will use the specifed CommandManager to obtain commands.


ToggleCommandGroup

public ToggleCommandGroup(CommandManager commandManager,
                          java.lang.String groupId)
Creates a new command groups with the specified id. CommandGroups are lazy loading in that they will store the only the command ids until they are asked to create a button or menu. The command will use the specifed CommandManager to obtain commands.

Parameters:
groupId - this groups unique id.
Method Detail

getController

protected ToggleGroupController getController()
Gets the ToggleGroupController managing this group.

Returns:
this groups ToggleGroupController.

isAllowableMember

public boolean isAllowableMember(Command prospectiveMember)
Ensures that only ToggleCommand instances are added to this group.

Overrides:
isAllowableMember in class CommandGroup
Parameters:
prospectiveMember - the Command being added.
Returns:
true if the prospective member is an instance of ToggleCommand, false otherwise.
See Also:
isAllowableMember(org.pietschy.command.Command)

setEmptySelectionAllowed

public void setEmptySelectionAllowed(boolean emptySelectionAllowed)
Configures if this group allows the last selected command to be deselected.

Parameters:
emptySelectionAllowed - true to allow the last selected command to be deslected, false to ensure at least one command is always selected.

isEmptySelectionAllowed

public boolean isEmptySelectionAllowed()
Checks if this group allows the last selected command to be deselected.

Returns:
true if the last selected command can be deslected, false if at least one command must always be selected.

isExclusive

public boolean isExclusive()

setExclusive

public void setExclusive(boolean exclusive)