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);
}
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;
}
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);
}
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);
}
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);
}
Aggregations