Package com.vaadin.ui

Examples of com.vaadin.ui.HorizontalLayout


        setMainWindow(mainWindow);

        String shortString = "Short";
        String longString = "Very, very long";

        HorizontalLayout hl = new HorizontalLayout();

        for (int i = 0; i < 2; i++) {
            NativeSelect ns = new NativeSelect(shortString);
            ns.addItem(longString);
            ns.setNullSelectionAllowed(false);
            ns.select(longString);
            hl.addComponent(ns);
        }
        mainWindow.addComponent(hl);
    }
View Full Code Here


        return 10513;
    }

    @Override
    protected void setup() {
        HorizontalLayout layout = new HorizontalLayout();
        layout.setWidth("310px");
        layout.setHeight("300px");

        final Table table = new TreeTable();
        table.setSizeFull();

        table.addGeneratedColumn("parameterId", new EmptyColumnGenerator());
        table.addGeneratedColumn("wordingTextId", new TypeColumnGenerator());
        table.addGeneratedColumn("parameterTypeId", new TypeColumnGenerator());

        table.setColumnWidth("parameterId", 26);

        table.addItem(new TestObject("name 1", "value 1"));
        table.addItem(new TestObject("name 2", "value 2"));
        table.addItem(new TestObject("name 3", "value 3"));
        table.addItem(new TestObject("name 4", "value 4"));
        table.addItem(new TestObject("name 5", "value 5"));

        layout.addComponent(table);

        Button button = new Button("Add");
        button.setId("button");
        button.addClickListener(new ClickListener() {
View Full Code Here

        return 3110;
    }

    @Override
    protected void setup() {
        HorizontalLayout hl = new HorizontalLayout();
        hl.addComponent(createButtons(true));
        hl.addComponent(createButtons(false));

        addComponent(hl);

    }
View Full Code Here

        return 10513;
    }

    @Override
    protected void setup() {
        HorizontalLayout layout = new HorizontalLayout();
        layout.setWidth("300px");
        layout.setHeight("300px");

        final TreeTable table = new TreeTable();
        table.setSizeFull();

        table.addGeneratedColumn("parameterId", new HierarchyColumnGenerator());
        table.addGeneratedColumn("wordingTextId", new TypeColumnGenerator());
        table.addGeneratedColumn("parameterTypeId", new TypeColumnGenerator());

        table.setColumnWidth("parameterId", 26);

        table.addItem(new TestObject("name 1", "value 1"));
        table.addItem(new TestObject("name 2", "value 2"));
        table.addItem(new TestObject("name 3", "value 3"));
        table.addItem(new TestObject("name 4", "value 4"));
        table.addItem(new TestObject("name 5", "value 5"));
        final TestObject parent = new TestObject("name 6", "value 6");
        table.addItem(parent);
        table.setFooterVisible(true);
        for (int i = 1; i <= 10; ++i) {
            TestObject child = new TestObject("name 6-" + i, "value 6-" + i);
            table.addItem(child);
            table.setParent(child, parent);
        }
        table.setVisibleColumns(new Object[] { "wordingTextId", "parameterId",
                "parameterTypeId" });
        table.setColumnHeaders(new String[] { "", "", "" });
        table.setHierarchyColumn("parameterId");

        layout.addComponent(table);

        Button button = new Button("Toggle");
        button.setId("button");
        button.addClickListener(new ClickListener() {
View Full Code Here

        setMainWindow(mainw);

        mainw.addComponent(new Label(
                "This test has somewhat invalid layouts in it to detect analyzy layout function in debug dialog"));

        HorizontalLayout hl = new HorizontalLayout();
        Panel panel = buildPanel("p1");
        Panel panel2 = buildPanel("p2");
        hl.addComponent(panel);
        hl.addComponent(panel2);

        mainw.addComponent(hl);

        hl = new HorizontalLayout();
        panel = buildPanel("p1");
        panel.setSizeUndefined();
        panel.setHeight("100%");
        panel2 = buildPanel("p2");
        panel2.setSizeUndefined();
        panel2.setHeight("100%");

        hl.addComponent(panel);
        hl.addComponent(panel2);
        mainw.addComponent(hl);

        HorizontalSplitPanel sp = new HorizontalSplitPanel();

        VerticalLayout first = new VerticalLayout();
View Full Code Here

                                (enabled ? "enabled" : "disabled")));
                    }
                }
            }
        });
        HorizontalLayout cbs = new HorizontalLayout();
        cbs.setSpacing(true);
        cbs.addComponent(cb);
        cbs.addComponent(cb2);
        addComponent(cbs);

        layout = new HorizontalLayout();
        layout.setSpacing(true);
        layout.addComponent(createSelect(
                new ListSelect("List Select, enabled"), true));
        layout.addComponent(createSelect(
                new ListSelect("List Select, disabled"), false));
View Full Code Here

        leftComponent.setMargin(true);
        leftComponent.setSpacing(true);

        // Toolbar with buttons to hide or show lists

        HorizontalLayout toolBar = new HorizontalLayout();
        toolBar.setSpacing(true);
        toolBar.setMargin(true);

        leftComponent.addComponent(toolBar);
        leftComponent.setExpandRatio(toolBar, 0.0f);

        // List of trucks -----------------------

        tables[0] = new Table("Trucks");
        tables[0].addContainerProperty("Brand", String.class, null);
        tables[0].addContainerProperty("Model", String.class, null);
        tables[0].addContainerProperty("License Plate", String.class, null);

        for (int i = 1; i < LENGTHS[0]; i++) {
            tables[0].addItem(
                    new Object[] { "MAN", "XYZ", "1-ABC-" + format.format(i) },
                    Integer.valueOf(i));
        }
        tables[0].setPageLength(LENGTHS[0]);

        tables[0].setWidth("100%");
        tables[0].setHeight("100%");
        tables[0].setSelectable(true);

        leftComponent.addComponent(tables[0]);
        leftComponent.setExpandRatio(tables[0], 1.0f);

        // List of trailers ----------------------

        tables[1] = new Table("Trailers");
        tables[1].addContainerProperty("Type", String.class, null);
        tables[1].addContainerProperty("License Plate", String.class, null);
        for (int i = 1; i < LENGTHS[1]; i++) {
            tables[1].addItem(
                    new Object[] { "Cooler", "1-QQQ-" + format.format(i) },
                    Integer.valueOf(i));
        }
        tables[1].setPageLength(LENGTHS[1]);

        tables[1].setWidth("100%");
        tables[1].setHeight("100%");
        tables[1].setSelectable(true);

        leftComponent.addComponent(tables[1]);
        leftComponent.setExpandRatio(tables[1], 1.0f);

        // List of drivers ------------------------

        tables[2] = new Table("Drivers");
        tables[2].addContainerProperty("First Name", String.class, null);
        tables[2].addContainerProperty("Last Name", String.class, null);
        tables[2].addContainerProperty("HR ID", String.class, null);
        for (int i = 1; i < LENGTHS[2]; i++) {
            tables[2].addItem(
                    new Object[] { "King", "Vabis", "HR-" + format.format(i) },
                    Integer.valueOf(i));
        }
        tables[2].setPageLength(LENGTHS[2]);

        tables[2].setWidth("100%");
        tables[2].setHeight("100%");
        tables[2].setSelectable(true);

        leftComponent.addComponent(tables[2]);
        leftComponent.setExpandRatio(tables[2], 1.0f);

        leftComponent.setWidth("100%");

        HorizontalSplitPanel split = new HorizontalSplitPanel();
        split.setFirstComponent(leftComponent);

        VerticalLayout rightComponent = new VerticalLayout();
        rightComponent.setMargin(true);
        rightComponent.addComponent(new Label("Left blank!"));
        split.setSecondComponent(rightComponent);

        split.setSizeFull();

        VerticalLayout mainLayout = new VerticalLayout();
        mainLayout.setSizeFull();
        mainLayout.addComponent(split);
        mainLayout.setExpandRatio(split, 1.0f);

        LegacyWindow mainWindow = new LegacyWindow("Visibilitybug Application",
                mainLayout);
        mainWindow.setSizeFull();

        setMainWindow(mainWindow);

        // complete toolbar

        for (int i = 0; i < buttons.length; i++) {
            buttons[i] = new ToggleButton(tables[i]);
            toolBar.addComponent(buttons[i]);
        }

    }
View Full Code Here

    @Override
    protected void setup() {
        getLayout().setSizeFull();

        HorizontalLayout hl = new HorizontalLayout();
        hl.setSizeFull();
        hl.setSpacing(true);

        Panel part1 = createPart("Empty required fields validation", true,
                false);
        part1.setId("emptyFieldPart");
        hl.addComponent(part1);

        Panel part2 = createPart(
                "Empty required fields with failing validator", true, true);
        part1.setId("validatedFieldPart");
        hl.addComponent(part2);

        VerticalLayout panelLayout = new VerticalLayout();
        panelLayout.setMargin(true);
        Panel panel = new Panel(panelLayout);
        panel.setSizeFull();
View Full Code Here

    Component[] children = new Component[] { new Label("A"), new Label("B"),
            new Label("C"), new Label("D") };

    @Test
    public void moveComponentsBetweenLayouts() {
        AbstractOrderedLayout layout1 = new HorizontalLayout();
        AbstractOrderedLayout layout2 = new VerticalLayout();

        layout1.addComponent(children[0]);
        layout1.addComponent(children[1]);

        layout2.addComponent(children[2]);
        layout2.addComponent(children[3]);

        layout2.addComponent(children[1], 1);
        assertOrder(layout1, new int[] { 0 });
        assertOrder(layout2, new int[] { 2, 1, 3 });

        layout1.addComponent(children[3], 0);
        assertOrder(layout1, new int[] { 3, 0 });
        assertOrder(layout2, new int[] { 2, 1 });

        layout2.addComponent(children[0]);
        assertOrder(layout1, new int[] { 3 });
        assertOrder(layout2, new int[] { 2, 1, 0 });

        layout1.addComponentAsFirst(children[1]);
        assertOrder(layout1, new int[] { 1, 3 });
        assertOrder(layout2, new int[] { 2, 0 });
    }
View Full Code Here

    public void testVLIteration() {
        testIndexing(new VerticalLayout(), 10);
    }

    public void testHLIteration() {
        testIndexing(new HorizontalLayout(), 12);
    }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.HorizontalLayout

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.