Klasse GridScroller

java.lang.Object
org.vaadin.addons.stefan.gridscroller.GridScroller

public class GridScroller extends Object
Utility class that provides methods to set and read the pixel based scroll position of a Vaadin grid.
Autor:
Stefan Uebe
  • Verschachtelte Klassen - Übersicht

    Verschachtelte Klassen
    Modifikator und Typ
    Klasse
    Beschreibung
    static class 
    Container class providing information about scroll positions in a two dimensional component.
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    GridScroller(com.vaadin.flow.component.grid.Grid<?> grid)
    Creates a new instance for the given grid.
  • Methodenübersicht

    Modifikator und Typ
    Methode
    Beschreibung
    com.vaadin.flow.component.grid.Grid<?>
    Returns the wrapped grid.
    static void
    readScrollPositions(com.vaadin.flow.component.grid.Grid<?> grid, com.vaadin.flow.function.SerializableConsumer<GridScroller.ScrollPosition> leftTopConsumer)
    Reads the current scroll position of the given grid and passes it to the given consumer.
    void
    readScrollPositions(com.vaadin.flow.function.SerializableConsumer<GridScroller.ScrollPosition> leftTopConsumer)
    Reads the current scroll position of given grid and passes it to the given consumer.
    static void
    scroll(com.vaadin.flow.component.grid.Grid<?> grid, Double left, Double top)
    Sets the both scroll positions in pixels for the given grid.
    static void
    scroll(com.vaadin.flow.component.grid.Grid<?> grid, GridScroller.ScrollPosition scrollPosition)
    Sets the both scroll positions in pixels for the given grid.
    void
    scroll(Double left, Double top)
    Sets the both scroll positions in pixels for the grid.
    void
    Sets the both scroll positions in pixels for the grid.
    static void
    scrollLeft(com.vaadin.flow.component.grid.Grid<?> grid, Double value)
    Sets the left / horizontal / x scroll position in pixels for the given grid.
    void
    Sets the left / horizontal / x scroll position in pixels for grid.
    static void
    scrollTop(com.vaadin.flow.component.grid.Grid<?> grid, Double value)
    Sets the top / vertical / y scroll position in pixels for the given grid.
    void
    Sets the top / vertical / y scroll position in pixels for the grid.

    Von Klasse geerbte Methoden Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Konstruktordetails

    • GridScroller

      public GridScroller(com.vaadin.flow.component.grid.Grid<?> grid)
      Creates a new instance for the given grid.
      Parameter:
      grid - grid to manage
      Löst aus:
      NullPointerException - when given parameter is null
  • Methodendetails

    • scrollTop

      public static void scrollTop(com.vaadin.flow.component.grid.Grid<?> grid, Double value)
      Sets the top / vertical / y scroll position in pixels for the given grid. Passing null resets the scroll position to the top.
      Parameter:
      grid - grid to modify
      value - new scroll position
    • scrollLeft

      public static void scrollLeft(com.vaadin.flow.component.grid.Grid<?> grid, Double value)
      Sets the left / horizontal / x scroll position in pixels for the given grid. Passing null resets the scroll position to the left.
      Parameter:
      grid - grid to modify
      value - new scroll position
    • scroll

      public static void scroll(com.vaadin.flow.component.grid.Grid<?> grid, Double left, Double top)
      Sets the both scroll positions in pixels for the given grid. Passing null resets the respective scroll position.
      Parameter:
      grid - grid to modify
      left - new scroll position for left / horizontal / x
      top - new scroll position for top / vertical / y
    • scroll

      public static void scroll(com.vaadin.flow.component.grid.Grid<?> grid, GridScroller.ScrollPosition scrollPosition)
      Sets the both scroll positions in pixels for the given grid. Passing null resets the scroll positions.
      Parameter:
      grid - grid to modify
      scrollPosition - new scroll position
    • scroll

      public void scroll(Double left, Double top)
      Sets the both scroll positions in pixels for the grid. Passing null resets the respective scroll position.
      Parameter:
      left - new scroll position for left / horizontal / x
      top - new scroll position for top / vertical / y
    • scroll

      public void scroll(GridScroller.ScrollPosition scrollPosition)
      Sets the both scroll positions in pixels for the grid. Passing null resets the scroll positions.
      Parameter:
      scrollPosition - new scroll position
    • readScrollPositions

      public static void readScrollPositions(com.vaadin.flow.component.grid.Grid<?> grid, com.vaadin.flow.function.SerializableConsumer<GridScroller.ScrollPosition> leftTopConsumer)
      Reads the current scroll position of the given grid and passes it to the given consumer. Please notify, that this will do a round trip to the client, calling the consumer afterwards with the client result. If the client cannot be reached, then the consumer will not be called.
      Parameter:
      grid - grid to read from
      leftTopConsumer - consumer for the scroll position
      Löst aus:
      IllegalStateException - return value from the client is not a json array
    • scrollTop

      public void scrollTop(Double value)
      Sets the top / vertical / y scroll position in pixels for the grid. Passing null resets the scroll position to the top.
      Parameter:
      value - new scroll position
    • scrollLeft

      public void scrollLeft(Double value)
      Sets the left / horizontal / x scroll position in pixels for grid. Passing null resets the scroll position to the left.
      Parameter:
      value - new scroll position
    • readScrollPositions

      public void readScrollPositions(com.vaadin.flow.function.SerializableConsumer<GridScroller.ScrollPosition> leftTopConsumer)
      Reads the current scroll position of given grid and passes it to the given consumer. Please notify, that this will do a round trip to the client, calling the consumer afterwards with the client result. If the client cannot be reached, then the consumer will not be called.
      Parameter:
      leftTopConsumer - consumer for the scroll position
      Löst aus:
      IllegalStateException - return value from the client is not a json array
    • getGrid

      public com.vaadin.flow.component.grid.Grid<?> getGrid()
      Returns the wrapped grid.
      Gibt zurück:
      grid