Interface GroupListDataComponent<E>

Type Parameters:
E - item type
All Superinterfaces:
ListDataComponent<E>
All Known Implementing Classes:
AbstractGroupDataGridAdapter, GroupDataGrid, GroupDataGridAdapter

public interface GroupListDataComponent<E> extends ListDataComponent<E>
A component that provides grouping functionality for a list of items.
  • Method Details

    • groupByKeys

      void groupByKeys(String... keys)
      Groups data by the specified column keys.

      The previous grouping will be replaced by a new one.

      Parameters:
      keys - the column keys to group by
    • groupByKeysList

      void groupByKeysList(List<String> keys)
      Groups data by the specified column keys.

      The previous grouping will be replaced by a new one.

      Parameters:
      keys - the column keys to group by
    • ungroup

      void ungroup()
      Resets any grouping applied in the grid.
    • ungroupByKeys

      void ungroupByKeys(String... keys)
      Ungroups the provided array of column keys.

      Grouping columns that are not in the provided keys array will still be applied.

      Parameters:
      keys - the array of column keys used to ungroup
    • ungroupByKeysList

      void ungroupByKeysList(List<String> keys)
      Ungroups the provided list of column keys.

      Grouping columns that are not in the provided keys list will still be applied.

      Parameters:
      keys - a list of column keys used to ungroup;
    • expand

      void expand(GroupInfo group)
      Expands the specified group.
      Parameters:
      group - the group to be expanded
    • expandByPath

      void expandByPath(E item)
      Expands all groups that are on the path to the provided item.
      Parameters:
      item - item to expand all groups
    • expandAll

      void expandAll()
      Expands all root groups and their children recursively.
    • collapse

      void collapse(GroupInfo group)
      Collapses the specified group.
      Parameters:
      group - the group to be collapsed
    • collapseByPath

      void collapseByPath(E item)
      Collapses all groups that are on the path to the provided item.
      Parameters:
      item - item to collapse all groups
    • collapseAll

      void collapseAll()
      Collapses all root groups and their children recursively.
    • isExpanded

      boolean isExpanded(GroupInfo group)
      Determines if the specified group is expanded.
      Parameters:
      group - the group to check
      Returns:
      true if the group is expanded, false otherwise
    • getRootGroups

      List<GroupInfo> getRootGroups()
      Returns:
      the list of root groups
    • getChildren

      List<GroupInfo> getChildren(GroupInfo group)
      Returns:
      the list of nested groups
    • hasChildren

      boolean hasChildren(GroupInfo groupInfo)
      Indicates that the group has nested groups
      Parameters:
      groupInfo - group info
    • hasGroups

      boolean hasGroups()
      Indicates that items have groups
    • addCollapseListener

      com.vaadin.flow.shared.Registration addCollapseListener(Consumer<GroupListDataComponent.CollapseEvent<E>> listener)
      Adds a listener to be notified when a group is collapsed.
      Parameters:
      listener - the listener to add
      Returns:
      a registration object for removing the listener
    • addExpandListener

      com.vaadin.flow.shared.Registration addExpandListener(Consumer<GroupListDataComponent.ExpandEvent<E>> listener)
      Adds a listener to be notified when a group is expanded.
      Parameters:
      listener - the listener to add
      Returns:
      a registration object for removing the listener