Search in sources :

Example 1 with Scroller

use of com.vaadin.flow.component.orderedlayout.Scroller 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 2 with Scroller

use of com.vaadin.flow.component.orderedlayout.Scroller in project flow-components by vaadin.

the class OrderedLayoutView method createScrollerWithVerticalLayout.

private void createScrollerWithVerticalLayout() {
    String[] colors = new String[] { "#33C3F3", "#66D2F6", "#99E1F9", "#CCF0FC", "#E5F7FD", "#E5F7FD", "#CCF0FC", "#99E1F9", "#66D2F6", "#33C3F3" };
    Scroller scroller = new Scroller();
    scroller.setHeight("200px");
    VerticalLayout content = new VerticalLayout();
    content.setAlignItems(Alignment.STRETCH);
    for (int i = 0; i < colors.length; i++) {
        Span component = new Span("Component " + i);
        component.getStyle().set("backgroundColor", colors[i]).set("padding", "5px 10px");
        content.add(component);
    }
    scroller.setContent(content);
    add(scroller);
    scroller.setId("scroller-with-vertical-layout");
    addCard("Scroller", "Scroller with VerticalLayout content", scroller);
}
Also used : VerticalLayout(com.vaadin.flow.component.orderedlayout.VerticalLayout) Scroller(com.vaadin.flow.component.orderedlayout.Scroller) Span(com.vaadin.flow.component.html.Span)

Example 3 with Scroller

use of com.vaadin.flow.component.orderedlayout.Scroller in project flow-components by vaadin.

the class OrderedLayoutView method createScroller.

private void createScroller() {
    Scroller scroller = new Scroller();
    scroller.setHeight("100px");
    scroller.setWidth("200px");
    scroller.getStyle().set("border", "1px solid #9E9E9E");
    Div content = createLoremIpsum();
    scroller.setContent(content);
    add(scroller);
    scroller.setId("small-scroller-large-content");
    addCard("Scroller", "Small Scroller with large content", scroller);
}
Also used : Div(com.vaadin.flow.component.html.Div) Scroller(com.vaadin.flow.component.orderedlayout.Scroller)

Aggregations

Scroller (com.vaadin.flow.component.orderedlayout.Scroller)3 VerticalLayout (com.vaadin.flow.component.orderedlayout.VerticalLayout)2 Div (com.vaadin.flow.component.html.Div)1 Footer (com.vaadin.flow.component.html.Footer)1 H2 (com.vaadin.flow.component.html.H2)1 Header (com.vaadin.flow.component.html.Header)1 Span (com.vaadin.flow.component.html.Span)1