Search in sources :

Example 6 with H2

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

Example 7 with H2

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);
}
Also used : Div(com.vaadin.flow.component.html.Div) Anchor(com.vaadin.flow.component.html.Anchor) UnorderedList(com.vaadin.flow.component.html.UnorderedList) H2(com.vaadin.flow.component.html.H2) VaadinIcon(com.vaadin.flow.component.icon.VaadinIcon) Icon(com.vaadin.flow.component.icon.Icon) ListItem(com.vaadin.flow.component.html.ListItem) Paragraph(com.vaadin.flow.component.html.Paragraph)

Example 8 with H2

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

Example 9 with H2

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

Example 10 with H2

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));
}
Also used : IntStream(java.util.stream.IntStream) ItemFilter(com.vaadin.flow.component.combobox.ComboBox.ItemFilter) ComponentRenderer(com.vaadin.flow.data.renderer.ComponentRenderer) VerticalLayout(com.vaadin.flow.component.orderedlayout.VerticalLayout) Div(com.vaadin.flow.component.html.Div) Label(com.vaadin.flow.component.html.Label) H2(com.vaadin.flow.component.html.H2) ComboBox(com.vaadin.flow.component.combobox.ComboBox) Collectors(java.util.stream.Collectors) Route(com.vaadin.flow.router.Route) ArrayList(java.util.ArrayList) List(java.util.List) Faker(com.github.javafaker.Faker) TemplateRenderer(com.vaadin.flow.data.renderer.TemplateRenderer) ElementConstants(com.vaadin.flow.dom.ElementConstants) Div(com.vaadin.flow.component.html.Div) ComboBox(com.vaadin.flow.component.combobox.ComboBox) 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