]> source.dussan.org Git - vaadin-framework.git/blob
4d8f2f94fc56934bc5bd6a243b3930c61f4ffbe8
[vaadin-framework.git] /
1 package com.vaadin.tests.components.orderedlayout;
2
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;
9
10 /**
11  * The Application's "main" class
12  */
13 @SuppressWarnings("serial")
14 public class VerticalRelativeSizeWithoutExpand extends UI {
15
16     @Override
17     protected void init(VaadinRequest request) {
18
19         final VerticalLayout layout = new VerticalLayout();
20         layout.setSizeFull();
21         layout.setMargin(true);
22         layout.setSpacing(true);
23         setContent(layout);
24
25         Panel panel1 = new Panel("This should not be seen");
26         panel1.setSizeFull();
27         VerticalLayout verticalLayout1 = new VerticalLayout();
28         verticalLayout1.setSizeFull();
29         Tree tree = new Tree();
30         tree.setSizeFull();
31         tree.setContainerDataSource(
32                 new BeanItemContainer<String>(String.class));
33         String a = "aaaaaaaaaaaaaaaaaaaaaaaa";
34         String b = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
35         String c = "ccccccccccccccccccccccccccccccccccccccccccccccccc";
36         tree.addItem(a);
37         tree.addItem(b);
38         tree.addItem(c);
39         tree.setChildrenAllowed(a, true);
40         tree.setChildrenAllowed(b, true);
41         tree.setParent(b, a);
42         tree.setParent(c, b);
43         verticalLayout1.addComponent(tree);
44         panel1.setContent(verticalLayout1);
45         layout.addComponent(panel1);
46
47         final Panel panel2 = new Panel("This should use all space");
48         panel2.setSizeFull();
49
50         layout.addComponent(panel2);
51         layout.setExpandRatio(panel2, 1);
52
53     }
54
55 }