use of com.vaadin.flow.component.html.H2 in project flow-components by vaadin.
the class GridMultiSelectionColumnPage method createBasicGridFromMultiToSingleBeforeAttached.
private void createBasicGridFromMultiToSingleBeforeAttached() {
Grid<String> grid = new Grid<>();
grid.setItems(IntStream.range(0, ITEM_COUNT).mapToObj(Integer::toString));
setUp(grid);
grid.setId("in-testing-multi-selection-mode-grid-single");
add(new H2("in-testing-multi-selection-mode-grid-single"), grid);
grid.setSelectionMode(SelectionMode.MULTI);
grid.setSelectionMode(SelectionMode.SINGLE);
add(grid);
}
use of com.vaadin.flow.component.html.H2 in project flow-components by vaadin.
the class GridMultiSelectionColumnPage method createDefinedItemCountLazyGrid.
private void createDefinedItemCountLazyGrid() {
Grid<String> lazyGrid = new Grid<>();
lazyGrid.setItems(query -> IntStream.range(query.getOffset(), query.getOffset() + query.getLimit()).mapToObj(Integer::toString), query -> ITEM_COUNT);
setUp(lazyGrid);
lazyGrid.setId(DEFINED_ITEM_COUNT_LAZY_GRID_ID);
add(new H2("Lazy grid"), lazyGrid);
}
use of com.vaadin.flow.component.html.H2 in project flow-components by vaadin.
the class GridMultiSelectionColumnPage method createBasicGridMultiOneRowDeSelected.
private void createBasicGridMultiOneRowDeSelected() {
Grid<String> grid = new Grid<>();
grid.setId(MULTI_SELECT_GRID_ONE_NOT_SELECTED_GRID_ID);
grid.setItems(IntStream.range(0, 2).mapToObj(Integer::toString));
grid.addColumn(i -> i).setHeader("text");
grid.addColumn(i -> String.valueOf(i.length())).setHeader("length");
grid.setSelectionMode(Grid.SelectionMode.MULTI);
grid.getSelectionModel().select("1");
NativeButton selectRow0Button = new NativeButton("Select Row 0");
selectRow0Button.setId("selectRow0");
selectRow0Button.addClickListener(event -> {
grid.getSelectionModel().select("0");
});
add(new H2("Grid with two rows only one row selected"), grid, selectRow0Button);
}
use of com.vaadin.flow.component.html.H2 in project flow-components by vaadin.
the class GridMultiSelectionColumnPage method createBasicGridMultiAllRowsSelected.
private void createBasicGridMultiAllRowsSelected() {
Grid<String> grid = new Grid<>();
grid.setId(MULTI_SELECT_GRID_ALL_SELECTED_GRID_ID);
grid.setItems(IntStream.range(0, 2).mapToObj(Integer::toString));
grid.addColumn(i -> i).setHeader("text");
grid.addColumn(i -> String.valueOf(i.length())).setHeader("length");
grid.setSelectionMode(Grid.SelectionMode.MULTI);
grid.getSelectionModel().select("0");
grid.getSelectionModel().select("1");
NativeButton deSelectRow0Button = new NativeButton("DeSelect Row 0");
deSelectRow0Button.setId("deSelectRow0");
deSelectRow0Button.addClickListener(event -> {
grid.getSelectionModel().deselect("0");
});
add(new H2("Small grid with two rows all selected"), grid, deSelectRow0Button);
}
use of com.vaadin.flow.component.html.H2 in project flow-components by vaadin.
the class GridMultiSelectionColumnPage method setAutoWidthIsTrueOfSelectionColumn.
private void setAutoWidthIsTrueOfSelectionColumn() {
Grid<String> grid = new Grid<>();
grid.setItems(IntStream.range(0, ITEM_COUNT).mapToObj(Integer::toString));
setUp(grid);
grid.setId("set-auto-width-true");
add(new H2("In-set-auto-width-true"), grid);
grid.setSelectionMode(SelectionMode.MULTI);
add(grid);
}
Aggregations