Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Commit

Permalink
Adding missing method to Vaadin Split Layout demos (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
shadikhani committed May 8, 2020
1 parent a960c38 commit 582f41c
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ private void addComponentWithThemeVariant() {
new Label("First content component"),
new Label("Second content component"));
layout.addThemeVariants(SplitLayoutVariant.LUMO_SMALL);

add(layout);
// end-source-example

addVariantsDemo(() -> {
Expand All @@ -69,6 +71,8 @@ private void addHorizontalLayout() {
SplitLayout layout = new SplitLayout(
new Label("First content component"),
new Label("Second content component"));

add(layout);
// end-source-example

setMinHeightForLayout(layout);
Expand All @@ -82,6 +86,8 @@ private void addVerticalLayout() {
layout.setOrientation(Orientation.VERTICAL);
layout.addToPrimary(new Label("Top content component"));
layout.addToSecondary(new Label("Bottom content component"));

add(layout);
// end-source-example

setMinHeightForLayout(layout);
Expand All @@ -103,6 +109,8 @@ private void addLayoutCombination() {
SplitLayout layout = new SplitLayout();
layout.addToPrimary(firstLabel);
layout.addToSecondary(innerLayout);

add(layout);
// end-source-example

layout.getPrimaryComponent().setId("first-component");
Expand All @@ -124,6 +132,8 @@ private void addResizeNotificationLayout() {
AtomicInteger resizeCounter = new AtomicInteger();
layout.addSplitterDragendListener(event -> message.setText(
"SplitLayout Resized " + resizeCounter.incrementAndGet() + " times."));

add(layout, message);
// end-source-example

message.setId("resize-message");
Expand All @@ -139,6 +149,8 @@ private void addInitialSplitterPositionLayout() {

SplitLayout layout = new SplitLayout(firstLabel, secondLabel);
layout.setSplitterPosition(80);

add(layout);
// end-source-example

layout.getPrimaryComponent().setId("initial-sp-first-component");
Expand All @@ -157,6 +169,8 @@ private void addMinMaxWidthLayout() {
layout.setPrimaryStyle("minWidth", "100px");
layout.setPrimaryStyle("maxWidth", "150px");
layout.setPrimaryStyle("background", "salmon");

add(layout);
// end-source-example

layout.getPrimaryComponent().setId("min-max-first-component");
Expand Down

0 comments on commit 582f41c

Please sign in to comment.