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