use of com.vaadin.flow.component.html.H2 in project flow-components by vaadin.
the class GridMultiSelectionColumnPage method createUnknownItemCountLazyGrid.
private void createUnknownItemCountLazyGrid() {
Grid<String> unknownItemCountLazyGrid = new Grid<>();
unknownItemCountLazyGrid.setItems(query -> IntStream.range(query.getOffset(), query.getOffset() + query.getLimit()).mapToObj(Integer::toString));
setUp(unknownItemCountLazyGrid);
unknownItemCountLazyGrid.setId(UNKNOWN_ITEM_COUNT_LAZY_GRID_ID);
add(new H2("Unknown Item Count Lazy grid"), unknownItemCountLazyGrid);
}
use of com.vaadin.flow.component.html.H2 in project flow-components by vaadin.
the class GridMultiSelectionColumnPage method createGridWithSwappedDataProvider.
private void createGridWithSwappedDataProvider() {
Grid<String> grid = new Grid<>();
setUp(grid);
grid.setItems(Arrays.asList("Item 1", "Item 2", "Item 3"));
grid.setItems(new CallbackDataProvider<>(this::fetch, this::count));
grid.setId("swapped-grid");
NativeButton inMemory = new NativeButton("Set in-memory DataProvider", evt -> grid.setItems(Arrays.asList("Item 1", "Item 2", "Item 3")));
inMemory.setId("set-in-memory-button");
NativeButton backEnd = new NativeButton("Set backend DataProvider", evt -> grid.setItems(new CallbackDataProvider<>(this::fetch, this::count)));
backEnd.setId("set-backend-button");
add(new H2("Swapped grid"), grid, inMemory, backEnd);
}
use of com.vaadin.flow.component.html.H2 in project flow-components by vaadin.
the class NotificationView method addCard.
private void addCard(String title, String description, Component... components) {
if (description != null) {
title = title + ": " + description;
}
VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
layout.add(new H2(title));
layout.add(components);
add(layout);
}
use of com.vaadin.flow.component.html.H2 in project flow-components by vaadin.
the class OrderedLayoutView method addCard.
private void addCard(String title, String description, Component... components) {
VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
layout.add(new H2(title));
if (description != null) {
layout.add(new Span(description));
}
layout.add(components);
add(layout);
}
use of com.vaadin.flow.component.html.H2 in project flow-components by vaadin.
the class ProgressBarView method addCard.
private void addCard(String title, Component... components) {
VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
layout.add(new H2(title));
layout.add(components);
add(layout);
}
Aggregations