com.vaadin.ui.components.grid.

Class GridRowDragger<T>

    • Method Detail

      • setTargetDataProviderUpdater

        public void setTargetDataProviderUpdater​(TargetDataProviderUpdater<T> targetDataProviderUpdater)

        Sets the target data provider updater, which handles adding the dropped items to the target grid.

        By default, items are added to the index where they were dropped on for any ListDataProvider. If another type of data provider is used, this updater should be set to handle updating instead.

        Parameters:

        targetDataProviderUpdater - the target drop handler to set, or null to remove

      • getTargetDataProviderUpdater

        public TargetDataProviderUpdater<T> getTargetDataProviderUpdater()

        Returns the target grid data provider updater.

        Returns:

        target grid drop handler

      • setSourceDataProviderUpdater

        public void setSourceDataProviderUpdater​(SourceDataProviderUpdater<T> sourceDataProviderUpdater)

        Sets the source data provider updater, which handles removing items from the drag source grid.

        By default the items are removed from any ListDataProvider. If another type of data provider is used, this updater should be set to handle updating instead.

        If you want to skip removing items from the source, you can use SourceDataProviderUpdater.NOOP.

        Parameters:

        sourceDataProviderUpdater - the drag source data provider updater to set, or null to remove

      • getSourceDataProviderUpdater

        public SourceDataProviderUpdater<T> getSourceDataProviderUpdater()

        Returns the source grid data provider updater.

        Default is null and the items are just removed from the source grid, which only works for ListDataProvider.

        Returns:

        the source grid drop handler

      • setDropIndexCalculator

        public void setDropIndexCalculator​(DropIndexCalculator<T> dropIndexCalculator)

        Sets the drop index calculator for the target grid. With this callback you can have a custom drop location instead of the actual one.

        By default, items are placed on the index they are dropped into in the target grid.

        If you want to always drop items to the end of the target grid, you can use DropIndexCalculator.alwaysDropToEnd().

        Parameters:

        dropIndexCalculator - the drop index calculator

      • getDropIndexCalculator

        public DropIndexCalculator<T> getDropIndexCalculator()

        Gets the drop index calculator.

        Default is null and the dropped items are placed on the drop location.

        Returns:

        the drop index calculator

      • getGridDropTarget

        public GridDropTarget<T> getGridDropTarget()

        Returns the drop target grid to allow performing customizations such as altering DropEffect.

        Returns:

        the drop target grid

      • getGridDragSource

        public GridDragSource<T> getGridDragSource()

        Returns the drag source grid, exposing it for customizations.

        Returns:

        the drag source grid

      • getDraggedItems

        protected List<T> getDraggedItems()

        Returns the currently dragged items captured from the source grid no drag start event, or null if no drag active.

        Returns:

        the currently dragged items or null