Search in sources :

Example 61 with H2

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);
}
Also used : Grid(com.vaadin.flow.component.grid.Grid) H2(com.vaadin.flow.component.html.H2)

Example 62 with H2

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);
}
Also used : NativeButton(com.vaadin.flow.component.html.NativeButton) Grid(com.vaadin.flow.component.grid.Grid) H2(com.vaadin.flow.component.html.H2) CallbackDataProvider(com.vaadin.flow.data.provider.CallbackDataProvider)

Example 63 with H2

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);
}
Also used : VerticalLayout(com.vaadin.flow.component.orderedlayout.VerticalLayout) H2(com.vaadin.flow.component.html.H2)

Example 64 with H2

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);
}
Also used : VerticalLayout(com.vaadin.flow.component.orderedlayout.VerticalLayout) H2(com.vaadin.flow.component.html.H2) Span(com.vaadin.flow.component.html.Span)

Example 65 with H2

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);
}
Also used : VerticalLayout(com.vaadin.flow.component.orderedlayout.VerticalLayout) H2(com.vaadin.flow.component.html.H2)

Aggregations

H2 (com.vaadin.flow.component.html.H2)68 VerticalLayout (com.vaadin.flow.component.orderedlayout.VerticalLayout)29 Div (com.vaadin.flow.component.html.Div)25 Grid (com.vaadin.flow.component.grid.Grid)11 ComboBox (com.vaadin.flow.component.combobox.ComboBox)10 Button (com.vaadin.flow.component.button.Button)8 Paragraph (com.vaadin.flow.component.html.Paragraph)7 HorizontalLayout (com.vaadin.flow.component.orderedlayout.HorizontalLayout)7 Route (com.vaadin.flow.router.Route)6 List (java.util.List)6 IntStream (java.util.stream.IntStream)6 NativeButton (com.vaadin.flow.component.html.NativeButton)5 ArrayList (java.util.ArrayList)5 Html (com.vaadin.flow.component.Html)4 TextField (com.vaadin.flow.component.textfield.TextField)4 Faker (com.github.javafaker.Faker)3 ItemFilter (com.vaadin.flow.component.combobox.ComboBox.ItemFilter)3 Label (com.vaadin.flow.component.html.Label)3 CallbackDataProvider (com.vaadin.flow.data.provider.CallbackDataProvider)3 ComponentRenderer (com.vaadin.flow.data.renderer.ComponentRenderer)3