1 package com.vaadin.tests.components.orderedlayout;
3 import com.vaadin.server.VaadinRequest;
4 import com.vaadin.ui.Panel;
5 import com.vaadin.ui.UI;
6 import com.vaadin.ui.VerticalLayout;
7 import com.vaadin.v7.data.util.BeanItemContainer;
8 import com.vaadin.v7.ui.Tree;
11 * The Application's "main" class
13 @SuppressWarnings("serial")
14 public class VerticalRelativeSizeWithoutExpand extends UI {
17 protected void init(VaadinRequest request) {
19 final VerticalLayout layout = new VerticalLayout();
21 layout.setMargin(true);
22 layout.setSpacing(true);
25 Panel panel1 = new Panel("This should not be seen");
27 VerticalLayout verticalLayout1 = new VerticalLayout();
28 verticalLayout1.setSizeFull();
29 Tree tree = new Tree();
31 tree.setContainerDataSource(
32 new BeanItemContainer<String>(String.class));
33 String a = "aaaaaaaaaaaaaaaaaaaaaaaa";
34 String b = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
35 String c = "ccccccccccccccccccccccccccccccccccccccccccccccccc";
39 tree.setChildrenAllowed(a, true);
40 tree.setChildrenAllowed(b, true);
43 verticalLayout1.addComponent(tree);
44 panel1.setContent(verticalLayout1);
45 layout.addComponent(panel1);
47 final Panel panel2 = new Panel("This should use all space");
50 layout.addComponent(panel2);
51 layout.setExpandRatio(panel2, 1);