aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/components/menubar/MenuBarInSplitPanel.java
blob: 5a59aa6187ce35976441684fc27cc66737e01342 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.vaadin.tests.components.menubar;

import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Label;
import com.vaadin.ui.MenuBar;
import com.vaadin.ui.Tree;
import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;

public class MenuBarInSplitPanel extends AbstractTestCase {

    @Override
    protected String getDescription() {
        return "Move the splitter left so that some menu items are collapsed, then back right. The menu bar should always fill the available space.";
    }

    @Override
    protected Integer getTicketNumber() {
        return 6590;
    }

    @Override
    public void init() {
        LegacyWindow mainWindow = new LegacyWindow("MenuBar in SplitPanel",
                new HorizontalSplitPanel());
        VerticalLayout left = new VerticalLayout();
        mainWindow.addComponent(left);
        left.setSizeFull();
        MenuBar menu = new MenuBar();
        menu.setWidth("100%");
        menu.addItem("File", null);
        menu.addItem("Edit", null);
        menu.addItem("Help", null);
        left.addComponent(menu);
        Tree tree = new Tree();
        for (int i = 0; i < 10; i++) {
            tree.addItem("Node " + i);
        }
        left.addComponent(tree);
        left.setExpandRatio(tree, 1.0f);
        Label label = new Label("Right");
        mainWindow.addComponent(label);
        setMainWindow(mainWindow);
    }

}