Class JmixTreeGridDataProvider<T>

java.lang.Object
com.vaadin.flow.data.provider.AbstractDataProvider<T,Void>
All Implemented Interfaces:
com.vaadin.flow.data.provider.DataProvider<T,Void>, com.vaadin.flow.data.provider.hierarchy.HierarchicalDataProvider<T,Void>, JmixBinding, ContainerDataUnit<T>, DataUnit, EntityDataUnit, EntityGridDataItems<T>, EntityTreeGridDataItems<T>, GridDataItems<T>, GridDataItems.Sortable<T>, TreeGridDataItems<T>, HasType<T>, Serializable

public class JmixTreeGridDataProvider<T> extends JmixGridDataProvider<T> implements com.vaadin.flow.data.provider.hierarchy.HierarchicalDataProvider<T,Void>, EntityTreeGridDataItems<T>
See Also:
  • Field Details

    • hierarchyProperty

      protected String hierarchyProperty
  • Constructor Details

    • JmixTreeGridDataProvider

      public JmixTreeGridDataProvider(CollectionContainer<T> container, String hierarchyProperty)
    • JmixTreeGridDataProvider

      public JmixTreeGridDataProvider(CollectionContainer<T> container, String hierarchyProperty, boolean showOrphans)
  • Method Details

    • getChildCount

      public int getChildCount(com.vaadin.flow.data.provider.hierarchy.HierarchicalQuery<T,Void> query)
      Specified by:
      getChildCount in interface com.vaadin.flow.data.provider.hierarchy.HierarchicalDataProvider<T,Void>
    • fetchChildren

      public Stream<T> fetchChildren(com.vaadin.flow.data.provider.hierarchy.HierarchicalQuery<T,Void> query)
      Specified by:
      fetchChildren in interface com.vaadin.flow.data.provider.hierarchy.HierarchicalDataProvider<T,Void>
    • hasChildren

      public boolean hasChildren(T item)
      Specified by:
      hasChildren in interface com.vaadin.flow.data.provider.hierarchy.HierarchicalDataProvider<T,Void>
      Specified by:
      hasChildren in interface TreeGridDataItems<T>
      Parameters:
      item - the item to check
      Returns:
      true if the item has children, false otherwise
    • getLevel

      public int getLevel(T item)
      Description copied from interface: TreeGridDataItems
      Returns the hierarchy level of an item.
      Specified by:
      getLevel in interface TreeGridDataItems<T>
      Parameters:
      item - the item to get level
      Returns:
      the level of the given item
    • getChildCount

      public int getChildCount(T parent)
      Specified by:
      getChildCount in interface TreeGridDataItems<T>
      Parameters:
      parent - the parent item
      Returns:
      child count of the given parent item
    • getChildren

      public Stream<T> getChildren(@Nullable T item)
      Specified by:
      getChildren in interface TreeGridDataItems<T>
      Parameters:
      item - the item to obtain children or null to get root items
      Returns:
      children of the given item
    • getParent

      @Nullable public T getParent(T item)
      Specified by:
      getParent in interface TreeGridDataItems<T>
      Parameters:
      item - the item to get parent
      Returns:
      the parent of the given item or null if no parent
    • getHierarchyPropertyName

      public String getHierarchyPropertyName()
      Description copied from interface: TreeGridDataItems
      Returns the property of entity which forms the hierarchy.
      Specified by:
      getHierarchyPropertyName in interface TreeGridDataItems<T>
      Returns:
      hierarchy property name