1 package com.vaadin.tests.components.orderedlayout;
3 import com.vaadin.server.VaadinRequest;
4 import com.vaadin.ui.HorizontalLayout;
5 import com.vaadin.ui.Panel;
6 import com.vaadin.ui.UI;
7 import com.vaadin.ui.VerticalLayout;
8 import com.vaadin.v7.data.util.BeanItemContainer;
9 import com.vaadin.v7.ui.Tree;
11 public class HorizontalRelativeSizeWithoutExpand extends UI {
14 protected void init(VaadinRequest request) {
16 final HorizontalLayout layout = new HorizontalLayout();
18 layout.setMargin(true);
19 layout.setSpacing(true);
22 Panel panel1 = new Panel("This should not be seen");
24 VerticalLayout verticalLayout1 = new VerticalLayout();
25 verticalLayout1.setSizeFull();
26 Tree tree = new Tree();
28 tree.setContainerDataSource(
29 new BeanItemContainer<String>(String.class));
30 String a = "aaaaaaaaaaaaaaaaaaaaaaaa";
31 String b = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
32 String c = "ccccccccccccccccccccccccccccccccccccccccccccccccc";
36 tree.setChildrenAllowed(a, true);
37 tree.setChildrenAllowed(b, true);
40 verticalLayout1.addComponent(tree);
41 panel1.setContent(verticalLayout1);
42 layout.addComponent(panel1);
44 final Panel panel2 = new Panel("This should use all space");
47 layout.addComponent(panel2);
48 layout.setExpandRatio(panel2, 1);