use of com.vaadin.flow.component.html.H2 in project docs by vaadin.
the class DialogNoPadding method createDialogLayout.
private static VerticalLayout createDialogLayout(Dialog dialog) {
H2 dialogTitle = new H2("Create new employee");
Header header = new Header(dialogTitle);
VerticalLayout personalInformationSection = createPersonalInformationSection();
VerticalLayout employeeInformationSection = createEmployeeInformationSection();
VerticalLayout scrollContent = new VerticalLayout(personalInformationSection, employeeInformationSection);
Scroller scroller = new Scroller(scrollContent);
Footer footer = createFooter(dialog);
VerticalLayout dialogContent = new VerticalLayout(header, scroller, footer);
dialogContent.setPadding(false);
dialogContent.setSpacing(false);
dialogContent.getStyle().remove("width");
dialogContent.setAlignItems(FlexComponent.Alignment.STRETCH);
dialogContent.setClassName("dialog-no-padding-example-overlay");
return dialogContent;
}
use of com.vaadin.flow.component.html.H2 in project layout-examples by vaadin.
the class PricingView method createFooter.
private void createFooter() {
Div box;
box = new Div();
box.addClassName("copyright-box");
Paragraph copyright = new Paragraph("© 2019");
copyright.addClassName("copyright");
box.add(new Icon(VaadinIcon.VAADIN_H), copyright);
footer.add(box);
box = new Div();
box.add(new H2("Features"));
box.add(new UnorderedList(new ListItem(new Anchor("#", "Cool stuff")), new ListItem(new Anchor("#", "Random feature")), new ListItem(new Anchor("#", "Team feature")), new ListItem(new Anchor("#", "Stuff for developers")), new ListItem(new Anchor("#", "Another one")), new ListItem(new Anchor("#", "Last time"))));
footer.add(box);
box = new Div();
box.add(new H2("Resources"));
box.add(new UnorderedList(new ListItem(new Anchor("#", "Resource")), new ListItem(new Anchor("#", "Resource name")), new ListItem(new Anchor("#", "Another resource")), new ListItem(new Anchor("#", "Final resource"))));
footer.add(box);
box = new Div();
box.add(new H2("About"));
box.add(new UnorderedList(new ListItem(new Anchor("#", "Team")), new ListItem(new Anchor("#", "Locations")), new ListItem(new Anchor("#", "Privacy")), new ListItem(new Anchor("#", "Terms"))));
footer.add(box);
}
use of com.vaadin.flow.component.html.H2 in project flow-components by vaadin.
the class IconView 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 TabsPage 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 ComboBoxDemoPage method createComboBoxWithCallbackLazyLoading.
private void createComboBoxWithCallbackLazyLoading() {
ComboBox<String> comboBox = new ComboBox<>();
/*
* This data provider doesn't load all the items to the server memory
* right away. The component calls the first provided callback to fetch
* items from the given range with the given filter. The second callback
* should provide the number of items that match the query.
*/
comboBox.setDataProvider((filter, offset, limit) -> IntStream.range(offset, offset + limit).mapToObj(i -> "Item " + i), filter -> 500);
comboBox.setId("callback-box");
add(new Div(new H2("Lazy Loading"), new H2("Lazy loading with callbacks"), comboBox));
}
Aggregations