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