Class CommandToggleGroupModel
- java.lang.Object
-
- org.pushingpixels.flamingo.api.common.model.CommandToggleGroupModel
-
public class CommandToggleGroupModel extends java.lang.ObjectGroup of toggle commands.
-
-
Constructor Summary
Constructors Constructor Description CommandToggleGroupModel()Creates a new command group.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Command command)Adds the specified command to the group.voidclearSelection()Clears the selection of this command toggle group model.java.util.Collection<Command>getCommands()Returns an unmodifiable collection with all the commands tracked by this model.CommandgetSelected()Returns the selected command of this group model.booleanisAllowsClearingSelection()Returns the current value for clearing selection.voidremove(Command command)Removes the specified command from the group.voidremoveAll()voidsetAllowsClearingSelection(boolean allowsClearingSelection)Sets the new value for clearing selection.voidsetSelected(Command command, boolean isSelected)Changes the selected status of the specified command.
-
-
-
Method Detail
-
getCommands
public java.util.Collection<Command> getCommands()
Returns an unmodifiable collection with all the commands tracked by this model.- Returns:
- An unmodifiable collection with all the commands tracked by this model.
-
setAllowsClearingSelection
public void setAllowsClearingSelection(boolean allowsClearingSelection)
Sets the new value for clearing selection. Iftrueis passed, the selection can be cleared inclearSelection()orsetSelected(Command, boolean)(passing the currently selected command andfalse).- Parameters:
allowsClearingSelection- The new value for clearing selection.
-
isAllowsClearingSelection
public boolean isAllowsClearingSelection()
Returns the current value for clearing selection.trueis returned when selection can be cleared inclearSelection()orsetSelected(Command, boolean)(passing the currently selected command andfalse).- Returns:
- The current value for clearing selection.
-
add
public void add(Command command)
Adds the specified command to the group. If the command is selected, and the group has a selected command, the newly added command is marked as unselected.- Parameters:
command- The command to be added.
-
remove
public void remove(Command command)
Removes the specified command from the group.- Parameters:
command- The command to be removed
-
removeAll
public void removeAll()
-
setSelected
public void setSelected(Command command, boolean isSelected)
Changes the selected status of the specified command.- Parameters:
command- command.isSelected- Selection indication.
-
getSelected
public Command getSelected()
Returns the selected command of this group model.- Returns:
- The selected command of this group model. The result can be
null.
-
clearSelection
public void clearSelection()
Clears the selection of this command toggle group model.
-
-