use of com.vaadin.flow.component.splitlayout.SplitLayout in project flow-components by vaadin.
the class SplitLayoutView method addLayoutCombination.
private void addLayoutCombination() {
Label firstLabel = new Label("First content component");
Label secondLabel = new Label("Second content component");
Label thirdLabel = new Label("Third content component");
SplitLayout innerLayout = new SplitLayout();
innerLayout.setOrientation(Orientation.VERTICAL);
innerLayout.addToPrimary(secondLabel);
innerLayout.addToSecondary(thirdLabel);
SplitLayout layout = new SplitLayout();
layout.addToPrimary(firstLabel);
layout.addToSecondary(innerLayout);
layout.setId("split-layout-combination");
layout.getPrimaryComponent().setId("first-component");
layout.getSecondaryComponent().setId("nested-layout");
innerLayout.getPrimaryComponent().setId("second-component");
innerLayout.getSecondaryComponent().setId("third-component");
setMinHeightForLayout(layout);
addCard("Layout Combination", layout);
}
use of com.vaadin.flow.component.splitlayout.SplitLayout in project flow-components by vaadin.
the class SplitLayoutView method addComponentWithThemeVariant.
private void addComponentWithThemeVariant() {
SplitLayout layout = new SplitLayout(new Label("First content component"), new Label("Second content component"));
layout.addThemeVariants(SplitLayoutVariant.LUMO_SMALL);
layout.setId("split-layout-theme-variant");
NativeButton removeVariantButton = new NativeButton("Remove theme variant", e -> layout.removeThemeVariants(SplitLayoutVariant.LUMO_SMALL));
removeVariantButton.setId("remove-variant-button");
addCard("Split Layout theme variant", layout, removeVariantButton);
}
use of com.vaadin.flow.component.splitlayout.SplitLayout in project flow-components by vaadin.
the class SplitLayoutView method addInitialSplitterPositionLayout.
private void addInitialSplitterPositionLayout() {
Label firstLabel = new Label("First content component");
Label secondLabel = new Label("Second content component");
SplitLayout layout = new SplitLayout(firstLabel, secondLabel);
layout.setSplitterPosition(80);
layout.getPrimaryComponent().setId("initial-sp-first-component");
layout.getSecondaryComponent().setId("initial-sp-second-component");
setMinHeightForLayout(layout);
addCard("Split Layout with Initial Splitter Position", layout);
}
use of com.vaadin.flow.component.splitlayout.SplitLayout in project flow-components by vaadin.
the class SplitterPositionView method createLayoutJavaApi.
private void createLayoutJavaApi() {
Span primary = new Span("Primary");
primary.setId("primaryJavaApi");
Span secondary = new Span("Secondary");
secondary.setId("secondaryJavaApi");
SplitLayout layout = new SplitLayout(primary, secondary);
layout.setSplitterPosition(INITIAL_POSITION);
layout.setId("splitLayoutJavaApi");
NativeButton setSplitterPosition = new NativeButton("set splitter position", event -> layout.setSplitterPosition(FINAL_POSITION));
setSplitterPosition.setId("setSplitPositionJavaApi");
add(setSplitterPosition, layout);
}
use of com.vaadin.flow.component.splitlayout.SplitLayout in project flow-components by vaadin.
the class SplitterPositionView method createLayoutElementApi.
private void createLayoutElementApi() {
Span primary = new Span("Primary");
primary.setId("primaryElementApi");
Span secondary = new Span("Secondary");
secondary.setId("secondaryElementApi");
SplitLayout layout = new SplitLayout();
layout.setSplitterPosition(INITIAL_POSITION);
layout.setId("splitLayoutElementApi");
layout.getElement().appendChild(primary.getElement(), secondary.getElement());
NativeButton setSplitterPosition = new NativeButton("set splitter position", event -> layout.setSplitterPosition(FINAL_POSITION));
setSplitterPosition.setId("setSplitPositionElementApi");
add(setSplitterPosition, layout);
}
Aggregations