Class JmixGroupGrid<T>

java.lang.Object
com.vaadin.flow.component.Component
io.jmix.groupgridflowui.kit.vaadin.grid.Grid<T>
io.jmix.groupgridflowui.kit.component.JmixGroupGrid<T>
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<Grid<T>>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<Grid<T>>, com.vaadin.flow.component.FocusNotifier<Grid<T>>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasTheme, com.vaadin.flow.data.event.SortEvent.SortNotifier<Grid<T>,GridSortOrder<T>>, com.vaadin.flow.data.provider.HasDataGenerators<T>, com.vaadin.flow.data.provider.HasDataView<T,Void,GridDataView<T>>, com.vaadin.flow.data.provider.HasLazyDataView<T,Void,GridLazyDataView<T>>, com.vaadin.flow.data.provider.HasListDataView<T,GridListDataView<T>>, com.vaadin.flow.data.provider.hierarchy.HasHierarchicalDataProvider<T>, HasActions, HasSubParts, SelectionChangeNotifier<Grid<T>,T>, Serializable
Direct Known Subclasses:
GroupDataGrid

public class JmixGroupGrid<T> extends Grid<T> implements SelectionChangeNotifier<Grid<T>,T>, HasSubParts, HasActions, com.vaadin.flow.data.provider.hierarchy.HasHierarchicalDataProvider<T>
See Also:
  • Field Details

  • Constructor Details

    • JmixGroupGrid

      public JmixGroupGrid()
  • Method Details

    • addAction

      public void addAction(Action action)
      Description copied from interface: HasActions
      Add an action to the component.
      Specified by:
      addAction in interface HasActions
      Parameters:
      action - action to add
    • addAction

      public void addAction(Action action, int index)
      Description copied from interface: HasActions
      Add an action to the component at the specified index.
      Specified by:
      addAction in interface HasActions
      Parameters:
      action - action to add
      index - index at which the specified action is to be added
    • removeAction

      public void removeAction(Action action)
      Description copied from interface: HasActions
      Removes the action from the component.
      Specified by:
      removeAction in interface HasActions
      Parameters:
      action - action to remove
    • getActions

      public Collection<Action> getActions()
      Specified by:
      getActions in interface HasActions
      Returns:
      unmodifiable collection of actions
    • getAction

      @Nullable public Action getAction(String id)
      Description copied from interface: HasActions
      Returns an action with passed id.
      Specified by:
      getAction in interface HasActions
      Parameters:
      id - id of the action to find
      Returns:
      an action by its id, or null if not found
    • getActionsSupport

      public JmixGroupGridActionsSupport<JmixGroupGrid<T>,T> getActionsSupport()
      Returns:
      the actions support instance for the grid
    • getSubPart

      @Nullable public Object getSubPart(String name)
      Description copied from interface: HasSubParts
      Returns a sub part object by its name.
      Specified by:
      getSubPart in interface HasSubParts
      Parameters:
      name - sub part name, e.g. component id
      Returns:
      a sub part object by its name, or null if not found
    • getDataCommunicator

      public com.vaadin.flow.data.provider.hierarchy.HierarchicalDataCommunicator<T> getDataCommunicator()
      Description copied from class: Grid
      Returns the data communicator of this Grid.
      Overrides:
      getDataCommunicator in class Grid<T>
      Returns:
      the data communicator, not null
    • addItemClickListener

      public com.vaadin.flow.shared.Registration addItemClickListener(com.vaadin.flow.component.ComponentEventListener<ItemClickEvent<T>> listener)
      Description copied from class: Grid
      Adds an item click listener to this component.
      Overrides:
      addItemClickListener in class Grid<T>
      Parameters:
      listener - the listener to add, not null
      Returns:
      a handle that can be used for removing the listener
      See Also:
    • addItemDoubleClickListener

      public com.vaadin.flow.shared.Registration addItemDoubleClickListener(com.vaadin.flow.component.ComponentEventListener<ItemDoubleClickEvent<T>> listener)
      Description copied from class: Grid
      Adds an item double click listener to this component.

      Note that double click event happens along with a click event. It means there is no way to get a double click event only (double click without a click): a click listener added using Grid.addItemClickListener(ComponentEventListener) (if any) will also be notified about a click event once a double click event is fired.

      Double click event type is not fully supported by the mobile browsers which means that double click event might not work (double click listeners won't be notified) for such browsers.

      Overrides:
      addItemDoubleClickListener in class Grid<T>
      Parameters:
      listener - the listener to add, not null
      Returns:
      a handle that can be used for removing the listener
      See Also:
    • getDataProvider

      public com.vaadin.flow.data.provider.hierarchy.HierarchicalDataProvider<T,com.vaadin.flow.function.SerializablePredicate<T>> getDataProvider()
      Description copied from class: Grid
      Returns the data provider of this grid.

      To get information and control over the items in the grid, use either Grid.getListDataView() or Grid.getLazyDataView() instead.

      Specified by:
      getDataProvider in interface com.vaadin.flow.data.provider.hierarchy.HasHierarchicalDataProvider<T>
      Overrides:
      getDataProvider in class Grid<T>
      Returns:
      the data provider of this grid, not null
    • setDataProvider

      public void setDataProvider(com.vaadin.flow.data.provider.hierarchy.HierarchicalDataProvider<T,?> hierarchicalDataProvider)
      Specified by:
      setDataProvider in interface com.vaadin.flow.data.provider.hierarchy.HasHierarchicalDataProvider<T>
    • setDataProvider

      @Deprecated public void setDataProvider(com.vaadin.flow.data.provider.DataProvider<T,?> dataProvider)
      Deprecated.
      use setDataProvider(HierarchicalDataProvider), HasHierarchicalDataProvider.setItems(Collection, ValueProvider), HasHierarchicalDataProvider.setItems(Stream, ValueProvider) or HasHierarchicalDataProvider.setTreeData(TreeData) instead.
      Group grid only supports hierarchical data providers. Use setDataProvider(HierarchicalDataProvider) instead.

      This method is inherited from Grid and has been marked as deprecated to indicate that it is not supported. This method will throw an UnsupportedOperationException.

      Overrides:
      setDataProvider in class Grid<T>
      Parameters:
      dataProvider - the data provider
    • setItems

      @Deprecated public GridLazyDataView<T> setItems(com.vaadin.flow.data.provider.BackEndDataProvider<T,Void> dataProvider)
      Deprecated.
      use setDataProvider(HierarchicalDataProvider), HasHierarchicalDataProvider.setItems(Collection, ValueProvider), HasHierarchicalDataProvider.setItems(Stream, ValueProvider) or HasHierarchicalDataProvider.setTreeData(TreeData) instead.
      Group grid does not support data views. Use setDataProvider(HierarchicalDataProvider) instead.

      This method is inherited from Grid and has been marked as deprecated to indicate that it is not supported. This method will throw an UnsupportedOperationException.

      Specified by:
      setItems in interface com.vaadin.flow.data.provider.HasLazyDataView<T,Void,GridLazyDataView<T>>
      Overrides:
      setItems in class Grid<T>
      Parameters:
      dataProvider - the data provider
      Returns:
      the data view
    • setItems

      @Deprecated public GridLazyDataView<T> setItems(com.vaadin.flow.data.provider.CallbackDataProvider.FetchCallback<T,Void> fetchCallback)
      Deprecated.
      use setDataProvider(HierarchicalDataProvider), HasHierarchicalDataProvider.setItems(Collection, ValueProvider), HasHierarchicalDataProvider.setItems(Stream, ValueProvider) or HasHierarchicalDataProvider.setTreeData(TreeData) instead.
      Group grid supports only hierarchical data so use another method instead.

      This method is inherited from Grid and has been marked as deprecated to indicate that it is not supported. This method will throw an UnsupportedOperationException.

      Specified by:
      setItems in interface com.vaadin.flow.data.provider.HasLazyDataView<T,Void,GridLazyDataView<T>>
      Parameters:
      fetchCallback - the fetch callback
      Returns:
      the data view
    • setItems

      @Deprecated public GridListDataView<T> setItems(com.vaadin.flow.data.provider.ListDataProvider<T> dataProvider)
      Deprecated.
      use setDataProvider(HierarchicalDataProvider), HasHierarchicalDataProvider.setItems(Collection, ValueProvider), HasHierarchicalDataProvider.setItems(Stream, ValueProvider) or HasHierarchicalDataProvider.setTreeData(TreeData) instead.
      Group grid supports only hierarchical data providers so use another method instead.

      This method is inherited from Grid and has been marked as deprecated to indicate that it is not supported. This method will throw an UnsupportedOperationException.

      Specified by:
      setItems in interface com.vaadin.flow.data.provider.HasListDataView<T,GridListDataView<T>>
      Overrides:
      setItems in class Grid<T>
      Parameters:
      dataProvider - the data provider
      Returns:
      the data view
    • setItems

      @Deprecated public GridListDataView<T> setItems(T... items)
      Deprecated.
      use setDataProvider(HierarchicalDataProvider), HasHierarchicalDataProvider.setItems(Collection, ValueProvider), HasHierarchicalDataProvider.setItems(Stream, ValueProvider) or HasHierarchicalDataProvider.setTreeData(TreeData) instead.
      Group grid supports only hierarchical data so use another method instead.

      This method is inherited from Grid and has been marked as deprecated to indicate that it is not supported. This method will throw an UnsupportedOperationException.

      Specified by:
      setItems in interface com.vaadin.flow.data.provider.HasListDataView<T,GridListDataView<T>>
      Parameters:
      items - the items to display, not null
      Returns:
      the data view
    • setItems

      @Deprecated public GridListDataView<T> setItems(Collection<T> items)
      Deprecated.
      use setDataProvider(HierarchicalDataProvider), HasHierarchicalDataProvider.setItems(Collection, ValueProvider), HasHierarchicalDataProvider.setItems(Stream, ValueProvider) or HasHierarchicalDataProvider.setTreeData(TreeData) instead.
      Group grid supports only hierarchical data, so use another method instead.

      This method is inherited from Grid and has been marked as deprecated to indicate that it is not supported. This method will throw an UnsupportedOperationException.

      Specified by:
      setItems in interface com.vaadin.flow.data.provider.HasListDataView<T,GridListDataView<T>>
      Parameters:
      items - the items to display, not null
      Returns:
      the data view
    • getListDataView

      @Deprecated public GridListDataView<T> getListDataView()
      Deprecated.
      not supported
      Group grid does not support list data view.

      This method is inherited from Grid and has been marked as deprecated to indicate that it is not supported. This method will throw an UnsupportedOperationException.

      Specified by:
      getListDataView in interface com.vaadin.flow.data.provider.HasListDataView<T,GridListDataView<T>>
      Overrides:
      getListDataView in class Grid<T>
      Returns:
      exception is thrown
    • getLazyDataView

      @Deprecated public GridLazyDataView<T> getLazyDataView()
      Deprecated.
      not supported
      Group grid does not support list data view.

      This method is inherited from Grid and has been marked as deprecated to indicate that it is not supported. This method will throw an UnsupportedOperationException.

      Specified by:
      getLazyDataView in interface com.vaadin.flow.data.provider.HasLazyDataView<T,Void,GridLazyDataView<T>>
      Overrides:
      getLazyDataView in class Grid<T>
      Returns:
      an exception is thrown
    • getGenericDataView

      @Deprecated public GridDataView<T> getGenericDataView()
      Deprecated.
      not supported
      Group grid does not support list data view.

      This method is inherited from Grid and has been marked as deprecated to indicate that it is not supported. This method will throw an UnsupportedOperationException.

      Specified by:
      getGenericDataView in interface com.vaadin.flow.data.provider.HasDataView<T,Void,GridDataView<T>>
      Overrides:
      getGenericDataView in class Grid<T>
      Returns:
      an exception is thrown
      See Also:
    • scrollToIndex

      public void scrollToIndex(int rowIndex)
      Scrolls to the index of an item in the root level of the tree. To scroll to a nested item, use scrollToIndex(int...).

      Scrolls so that the row is shown at the start of the visible area whenever possible.

      If the index parameter exceeds current item set size the grid will scroll to the end.

      Overrides:
      scrollToIndex in class Grid<T>
      Parameters:
      rowIndex - zero-based index of the item in the root level of the tree
      See Also:
    • scrollToIndex

      public void scrollToIndex(int... indexes)
      Scrolls to a nested item within the tree.

      The `indexes` parameter can be either a single number or multiple numbers. The grid will first try to scroll to the item at the first index in the root level of the tree. In case the item at the first index is expanded, the grid will then try scroll to the item at the second index within the children of the expanded first item, and so on. Each given index points to a child of the item at the previous index.

      Parameters:
      indexes - zero-based row indexes to scroll to
      See Also:
    • scrollToEnd

      public void scrollToEnd()
      Description copied from class: Grid
      Scrolls to the last data row of the grid.
      Overrides:
      scrollToEnd in class Grid<T>
    • scrollToItem

      @Deprecated public void scrollToItem(T item)
      Deprecated.
      Group grid does not support scrolling to a given item. Use scrollToIndex(int...) instead.

      This method is inherited from Grid and has been marked as deprecated to indicate that it is not supported. This method will throw an UnsupportedOperationException.

      Overrides:
      scrollToItem in class Grid<T>
      Parameters:
      item - the item to scroll to
    • getDefaultHeaderRow

      public HeaderRow getDefaultHeaderRow()
      Overrides:
      getDefaultHeaderRow in class Grid<T>
      Returns:
      a default header row
    • createActionsSupport

      protected JmixGroupGridActionsSupport<JmixGroupGrid<T>,T> createActionsSupport()
    • createDefaultArrayUpdater

      protected GridArrayUpdater createDefaultArrayUpdater(com.vaadin.flow.function.SerializableBiFunction<GridArrayUpdater.UpdateQueueData,Integer,Grid.UpdateQueue> updateQueueFactory)
      Overrides:
      createDefaultArrayUpdater in class Grid<T>
    • generateSelectableData

      protected void generateSelectableData(T item, elemental.json.JsonObject jsonObject)
      Overrides:
      generateSelectableData in class Grid<T>
    • createDetailsManager

      protected Grid<T>.DetailsManager createDetailsManager()
      Overrides:
      createDetailsManager in class Grid<T>
    • expand

      protected void expand(Collection<T> items, boolean userOriginated)
    • collapse

      protected void collapse(Collection<T> items, boolean userOriginated)
    • fireExpandEvent

      protected void fireExpandEvent(Collection<T> collapsedItems, boolean userOriginated)
    • fireCollapseEvent

      protected void fireCollapseEvent(Collection<T> expandedItems, boolean userOriginated)