Package com.vaadin.featurepack.util
Class V8Utils
java.lang.Object
com.vaadin.featurepack.util.V8Utils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <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 voidaddWindow(com.vaadin.flow.component.UI ui, com.vaadin.flow.component.dialog.Dialog dialog) static voidcenter(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 Stringstatic <T> booleanisHidden(com.vaadin.flow.component.grid.Grid.Column<T> column) static <T extends com.vaadin.flow.component.ComponentEvent<?>>
voidremoveListener(com.vaadin.flow.component.Component component, com.vaadin.flow.component.ComponentEventListener<T> listener) Removes the givenComponentEventListenerfrom the component.static voidremoveWindow(com.vaadin.flow.component.UI ui, com.vaadin.flow.component.dialog.Dialog dialog) static voidsetClosable(com.vaadin.flow.component.dialog.Dialog dialog, boolean closable) static <T> voidsetColumnOrder(com.vaadin.flow.component.grid.Grid<T> grid, String... columns) static voidsetContent(com.vaadin.flow.component.Component component, com.vaadin.flow.component.Component componentToSet) static voidsetHeight(com.vaadin.flow.component.Component component, float height, com.vaadin.flow.component.Unit unit) static voidsetHeightByRows(com.vaadin.flow.component.grid.Grid<?> grid, double rows) Set the height of a grid just big enough to fit n many rows.static voidstatic <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 voidsetWidth(com.vaadin.flow.component.Component component, float width, com.vaadin.flow.component.Unit unit) static <T> voidstatic <T> voidsort(com.vaadin.flow.component.grid.Grid<T> grid, String columnKey, com.vaadin.flow.data.provider.SortDirection dir)
-
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
-
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- theGridcomponent 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
-
getLabel
-
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 givenComponentEventListenerfrom the component.- Type Parameters:
T- the type of the event- Parameters:
component- the component to remove the listener fromlistener- the listener to remove
-