Class CommandToggleGroupModel



  • public class CommandToggleGroupModel
    extends java.lang.Object
    Group of toggle commands.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(Command command)
      Adds the specified command to the group.
      void clearSelection​()
      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.
      Command getSelected​()
      Returns the selected command of this group model.
      boolean isAllowsClearingSelection​()
      Returns the current value for clearing selection.
      void remove​(Command command)
      Removes the specified command from the group.
      void removeAll​()  
      void setAllowsClearingSelection​(boolean allowsClearingSelection)
      Sets the new value for clearing selection.
      void setSelected​(Command command, boolean isSelected)
      Changes the selected status of the specified command.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CommandToggleGroupModel

        public CommandToggleGroupModel​()
        Creates a new command group.
    • 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. If true is passed, the selection can be cleared in clearSelection() or setSelected(Command, boolean) (passing the currently selected command and false).
        Parameters:
        allowsClearingSelection - The new value for clearing selection.
      • isAllowsClearingSelection

        public boolean isAllowsClearingSelection​()
        Returns the current value for clearing selection. true is returned when selection can be cleared in clearSelection() or setSelected(Command, boolean) (passing the currently selected command and false).
        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.