Interface ActionGroupModel

All Superinterfaces:
ActionModel, Iterable<ActionModel>
All Known Implementing Classes:
ActionGroupModelImpl

public interface ActionGroupModel extends ActionModel, Iterable<ActionModel>
  • Field Details

  • Method Details

    • setDefaultAction

      void setDefaultAction(int actionIndex)
    • getDefaultAction

      int getDefaultAction()
    • setMutualExclusive

      void setMutualExclusive(boolean flag)
    • isMutualExclusive

      boolean isMutualExclusive()
    • findById

      ActionModel findById(String actionId)
    • addAction

      void addAction(ActionModel action)
      Adds the specified action unmodified to this action array.
    • removeAction

      boolean removeAction(ActionModel action)

      Removes the specified action from this group.

      Only remove from root action array. This method does not iterate recursively through all actions.

      Parameters:
      action - action in this action array to remove
    • removeActions

      void removeActions(Predicate<ActionModel> predicate)
      Removes all actions which match the given predicate. Not only root actions are removed; this method iterates recursively through all actions.
      Parameters:
      predicate - the predicate to apply.
    • deepCopy

      ActionGroupModel deepCopy()
      Creates a deep copy of this group.
      Specified by:
      deepCopy in interface ActionModel
      Returns:
      a new this
    • isEmpty

      boolean isEmpty()
      Returns whether this group has any actions.
      Returns:
      true if there is at least one action in this group, false if there are none
    • actionList

      List<ActionModel> actionList()

      Returns a List of the containing actions.

      In opposition to Iterable.iterator() this method keeps the structure of the actions and action groups and doesn't put it all in the same level.

      Returns:
      a List of the containing actions
    • sort

      void sort()
      Recursively sorts this groups children with respect to its ActionModel.getPosition() property.
    • mergeGroup

      void mergeGroup(ActionGroupModel group)

      Merges the actions from the specified group into this group.

      The properties of the given group itself are discarded. Only their containing actions are added to the actions of this group. If the given action contains a group that is already defined in here, their actions will be added to the existing group, such that no doublet groups arise.

    • removeEmptyGroups

      void removeEmptyGroups()
      Recursively removes all empty action groups from this group.
    • findDefaultAction

      void findDefaultAction()
      If this group has no default action set, it finds the first enabled action in this group and sets it as the default action. Does this recursively for any other action group encountered.
    • preserveOrder

      void preserveOrder(boolean overwrite)
      Adds position objects to the child actions that reflect their current order. This method does not step into any child group.
      Parameters:
      overwrite - if true overwrite existing position entries
    • replaceAction

      void replaceAction(ActionModel modelToReplace, ActionModel newActionModel)
    • findActionModel

      ActionModel findActionModel(String propertyName, String propertyValue)
    • collectActionModels

      List<ActionModel> collectActionModels()
      Returns:
      all action models contained in this model
    • findActionModels

      Iterable<ActionModel> findActionModels(String propertyName, String propertyValue)
      Parameters:
      propertyName - name of a property
      propertyValue - value for property
      Returns:
      all action models contained in this model with the specified property