Search in sources :

Example 11 with SplitLayout

use of com.vaadin.flow.component.splitlayout.SplitLayout in project flow-components by vaadin.

the class SplitLayoutUnitTest method testGetOrientation_nothingSet_defaultReturnsHORIZONTAL.

@Test
public void testGetOrientation_nothingSet_defaultReturnsHORIZONTAL() {
    SplitLayout splitLayout = new SplitLayout();
    Assert.assertEquals("Invalid default orientation", SplitLayout.Orientation.HORIZONTAL, splitLayout.getOrientation());
}
Also used : SplitLayout(com.vaadin.flow.component.splitlayout.SplitLayout) Test(org.junit.Test)

Example 12 with SplitLayout

use of com.vaadin.flow.component.splitlayout.SplitLayout in project flow-components by vaadin.

the class SplitLayoutUnitTest method testAddingSeveralComponents_slotspresent_wrapsInDiv.

@Test
public void testAddingSeveralComponents_slotspresent_wrapsInDiv() {
    SplitLayout splitLayout = new SplitLayout();
    splitLayout.addToPrimary(new Label("1"), new Label("2"), new Label("3"));
    splitLayout.addToSecondary(new Label("4"), new Label("5"));
    Component primaryComponent = splitLayout.getPrimaryComponent();
    Assert.assertEquals("The slot doesn't contain the primary slot.", "primary", primaryComponent.getElement().getAttribute("slot"));
    Assert.assertEquals("No wrapper div", "div", primaryComponent.getElement().getTag());
    Assert.assertEquals("Wrong number of children", 3, primaryComponent.getChildren().count());
    Component secondaryComponent = splitLayout.getSecondaryComponent();
    Assert.assertEquals("The slot doesn't contain the secondary slot.", "secondary", secondaryComponent.getElement().getAttribute("slot"));
    Assert.assertEquals("No wrapper div", "div", secondaryComponent.getElement().getTag());
    Assert.assertEquals("Wrong number of children", 2, secondaryComponent.getChildren().count());
}
Also used : SplitLayout(com.vaadin.flow.component.splitlayout.SplitLayout) Label(com.vaadin.flow.component.html.Label) Component(com.vaadin.flow.component.Component) Test(org.junit.Test)

Example 13 with SplitLayout

use of com.vaadin.flow.component.splitlayout.SplitLayout in project flow-components by vaadin.

the class SplitLayoutView method addMinMaxWidthLayout.

private void addMinMaxWidthLayout() {
    SplitLayout layout = new SplitLayout();
    layout.setId("split-layout-min-max");
    layout.addToPrimary(new Label("First content component"));
    layout.addToSecondary(new Label("Second content component"));
    layout.setPrimaryStyle("minWidth", "100px");
    layout.setPrimaryStyle("maxWidth", "150px");
    layout.setPrimaryStyle("background", "salmon");
    layout.getPrimaryComponent().setId("min-max-first-component");
    setMinHeightForLayout(layout);
    addCard("Split Layout with Minimum and Maximum Widths", layout);
}
Also used : SplitLayout(com.vaadin.flow.component.splitlayout.SplitLayout) Label(com.vaadin.flow.component.html.Label)

Aggregations

SplitLayout (com.vaadin.flow.component.splitlayout.SplitLayout)13 Label (com.vaadin.flow.component.html.Label)6 NativeButton (com.vaadin.flow.component.html.NativeButton)3 Span (com.vaadin.flow.component.html.Span)3 Component (com.vaadin.flow.component.Component)2 Test (org.junit.Test)2 HasSize (com.vaadin.flow.component.HasSize)1 Div (com.vaadin.flow.component.html.Div)1 HorizontalLayout (com.vaadin.flow.component.orderedlayout.HorizontalLayout)1 VerticalLayout (com.vaadin.flow.component.orderedlayout.VerticalLayout)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 BindingContext (org.linkki.core.binding.BindingContext)1 PropertyBehaviorProvider (org.linkki.core.binding.dispatcher.behavior.PropertyBehaviorProvider)1 BindingManager (org.linkki.core.binding.manager.BindingManager)1 DefaultBindingManager (org.linkki.core.binding.manager.DefaultBindingManager)1 ContactComponent (org.linkki.samples.playground.binding.components.ContactComponent)1 ContactsTableComponent (org.linkki.samples.playground.binding.components.ContactsTableComponent)1