Search in sources :

Example 51 with H2

use of com.vaadin.flow.component.html.H2 in project flow-components by vaadin.

the class CheckboxGroupDemoPage 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)

Example 52 with H2

use of com.vaadin.flow.component.html.H2 in project flow-components by vaadin.

the class FeaturesDiy method createConfirmDialog.

@Override
protected ConfirmDialog createConfirmDialog(String sample) {
    ConfirmDialog dialog = new ConfirmDialog();
    dialog.setId(sample);
    dialog.setHeader(new H2("Meeting starting").getElement());
    dialog.setText(new Span("Your next meeting starts in 5 minutes").getElement());
    // This button will get discarded by the new confirm button added below.
    dialog.setConfirmButton(new Button("Discarded confirm button"));
    Button confirmButton = new Button("Confirm");
    confirmButton.setId("confirmDiy");
    confirmButton.setIcon(VaadinIcon.CALENDAR.create());
    confirmButton.addClickListener(e -> {
        this.onOK(new ConfirmDialog.ConfirmEvent(dialog, false));
        dialog.close();
    });
    dialog.setConfirmButton(confirmButton.getElement());
    return dialog;
}
Also used : Button(com.vaadin.flow.component.button.Button) H2(com.vaadin.flow.component.html.H2) Span(com.vaadin.flow.component.html.Span) ConfirmDialog(com.vaadin.flow.component.confirmdialog.ConfirmDialog)

Example 53 with H2

use of com.vaadin.flow.component.html.H2 in project flow-components by vaadin.

the class DatePickerViewDemoPage 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 54 with H2

use of com.vaadin.flow.component.html.H2 in project flow-components by vaadin.

the class GridUpdateDataProviderPage method createBeanGrid.

private void createBeanGrid() {
    Grid<Pojo> grid = new Grid<>(Pojo.class);
    grid.setId("bean-grid");
    List<Pojo> orig = Arrays.asList(new Pojo(1, "foo"), new Pojo(2, "bar"));
    List<Pojo> updated = Arrays.asList(new Pojo(1, "FOOBAR"), new Pojo(2, "bar"));
    grid.setItems(orig);
    NativeButton updateProvider = new NativeButton("Use another list", event -> grid.setItems(updated));
    updateProvider.setId("update-bean-provider");
    add(new H2("Bean grid"), grid, updateProvider);
}
Also used : NativeButton(com.vaadin.flow.component.html.NativeButton) Grid(com.vaadin.flow.component.grid.Grid) H2(com.vaadin.flow.component.html.H2)

Example 55 with H2

use of com.vaadin.flow.component.html.H2 in project flow-components by vaadin.

the class LegacyTestView method addCard.

protected 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)

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