Class V8Utils

java.lang.Object
com.vaadin.featurepack.util.V8Utils

public class V8Utils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> com.vaadin.flow.component.grid.Grid.Column<T>
    addColumn(com.vaadin.flow.component.grid.Grid<T> grid, com.vaadin.flow.function.ValueProvider<T,?> valueProvider, com.vaadin.flow.data.renderer.Renderer<T> renderer)
     
    static void
    addWindow(com.vaadin.flow.component.UI ui, com.vaadin.flow.component.dialog.Dialog dialog)
     
    static void
    center(com.vaadin.flow.component.dialog.Dialog dialog)
     
    static <T> com.vaadin.flow.data.binder.Binder.Binding<T,?>
    getEditorBinding(com.vaadin.flow.component.grid.Grid.Column<T> column)
     
    static String
    getLabel(Object component)
     
    static <T> boolean
    isHidden(com.vaadin.flow.component.grid.Grid.Column<T> column)
     
    static <T extends com.vaadin.flow.component.ComponentEvent<?>>
    void
    removeListener(com.vaadin.flow.component.Component component, com.vaadin.flow.component.ComponentEventListener<T> listener)
    Removes the given ComponentEventListener from the component.
    static void
    removeWindow(com.vaadin.flow.component.UI ui, com.vaadin.flow.component.dialog.Dialog dialog)
     
    static void
    setClosable(com.vaadin.flow.component.dialog.Dialog dialog, boolean closable)
     
    static <T> void
    setColumnOrder(com.vaadin.flow.component.grid.Grid<T> grid, String... columns)
     
    static void
    setContent(com.vaadin.flow.component.Component component, com.vaadin.flow.component.Component componentToSet)
     
    static void
    setHeight(com.vaadin.flow.component.Component component, float height, com.vaadin.flow.component.Unit unit)
     
    static void
    setHeightByRows(com.vaadin.flow.component.grid.Grid<?> grid, double rows)
    Set the height of a grid just big enough to fit n many rows.
    static void
    setLabel(Object component, String content)
     
    static <T> com.vaadin.flow.component.grid.Grid.Column<T>
    setRenderer(com.vaadin.flow.component.grid.Grid.Column<T> column, com.vaadin.flow.data.renderer.Renderer renderer)
     
    static void
    setWidth(com.vaadin.flow.component.Component component, float width, com.vaadin.flow.component.Unit unit)
     
    static <T> void
    sort(com.vaadin.flow.component.grid.Grid<T> grid, String columnKey)
     
    static <T> void
    sort(com.vaadin.flow.component.grid.Grid<T> grid, String columnKey, com.vaadin.flow.data.provider.SortDirection dir)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • V8Utils

      public V8Utils()
  • Method Details

    • addColumn

      public static <T> com.vaadin.flow.component.grid.Grid.Column<T> addColumn(com.vaadin.flow.component.grid.Grid<T> grid, com.vaadin.flow.function.ValueProvider<T,?> valueProvider, com.vaadin.flow.data.renderer.Renderer<T> renderer)
    • center

      public static void center(com.vaadin.flow.component.dialog.Dialog dialog)
    • sort

      public static <T> void sort(com.vaadin.flow.component.grid.Grid<T> grid, String columnKey)
    • sort

      public static <T> void sort(com.vaadin.flow.component.grid.Grid<T> grid, String columnKey, com.vaadin.flow.data.provider.SortDirection dir)
    • setColumnOrder

      public static <T> void setColumnOrder(com.vaadin.flow.component.grid.Grid<T> grid, String... columns)
    • getEditorBinding

      public static <T> com.vaadin.flow.data.binder.Binder.Binding<T,?> getEditorBinding(com.vaadin.flow.component.grid.Grid.Column<T> column)
    • isHidden

      public static <T> boolean isHidden(com.vaadin.flow.component.grid.Grid.Column<T> column)
    • setRenderer

      public static <T> com.vaadin.flow.component.grid.Grid.Column<T> setRenderer(com.vaadin.flow.component.grid.Grid.Column<T> column, com.vaadin.flow.data.renderer.Renderer renderer)
    • setHeightByRows

      public static void setHeightByRows(com.vaadin.flow.component.grid.Grid<?> grid, double rows)

      Set the height of a grid just big enough to fit n many rows. The height of the grid is set at the moment this method is called. If the size of the header or footer of the grid changes after calling this method, the resulting height might not be sufficient to show n rows. A minimum of 1 row height is set if n is set to less than 1.

      NOTE: This method only does an approximate calculation using the values of the sizes set in the lumo theme. Rows in Flow Grid do not have a fixed height and so results are not guaranteed to suit every case.

      Parameters:
      grid - the Grid component to set the height to.
      rows - the amount of rows to show.
    • addWindow

      public static void addWindow(com.vaadin.flow.component.UI ui, com.vaadin.flow.component.dialog.Dialog dialog)
    • removeWindow

      public static void removeWindow(com.vaadin.flow.component.UI ui, com.vaadin.flow.component.dialog.Dialog dialog)
    • setClosable

      public static void setClosable(com.vaadin.flow.component.dialog.Dialog dialog, boolean closable)
    • setContent

      public static void setContent(com.vaadin.flow.component.Component component, com.vaadin.flow.component.Component componentToSet)
    • setWidth

      public static void setWidth(com.vaadin.flow.component.Component component, float width, com.vaadin.flow.component.Unit unit)
    • setHeight

      public static void setHeight(com.vaadin.flow.component.Component component, float height, com.vaadin.flow.component.Unit unit)
    • setLabel

      public static void setLabel(Object component, String content)
    • getLabel

      public static String getLabel(Object component)
    • removeListener

      public static <T extends com.vaadin.flow.component.ComponentEvent<?>> void removeListener(com.vaadin.flow.component.Component component, com.vaadin.flow.component.ComponentEventListener<T> listener)
      Removes the given ComponentEventListener from the component.
      Type Parameters:
      T - the type of the event
      Parameters:
      component - the component to remove the listener from
      listener - the listener to remove