Package com.vaadin.ui

Examples of com.vaadin.ui.VerticalLayout


    Accordion getAccordion(String caption) {
        TestIcon testIcon = new TestIcon(0);
        Accordion ac = new Accordion();
        ac.setCaption(caption);
        ac.addTab(new VerticalLayout() {
            {
                setMargin(true);
                addComponent(new Label(
                        "Fabio vel iudice vincam, sunt in culpa qui officia. Ut enim ad minim veniam, quis nostrud exercitation."));
            }
        }, "First Caption", testIcon.get());
        ac.addTab(new VerticalLayout() {
            {
                setMargin(true);
                addComponent(new Label(
                        "Gallia est omnis divisa in partes tres, quarum."));
            }
        }, "Second Caption", testIcon.get());
        ac.addTab(new VerticalLayout() {
            {
                setMargin(true);
                addComponent(new Label(
                        "Nihil hic munitissimus habendi senatus locus, nihil horum? Sed haec quis possit intrepidus aestimare tellus."));
            }
        }, "Third Caption", testIcon.get());
        ac.addTab(new VerticalLayout() {
            {
                setMargin(true);
                addComponent(new Label(
                        "Inmensae subtilitatis, obscuris et malesuada fames. Quisque ut dolor gravida, placerat libero vel, euismod."));
            }
View Full Code Here


        table = new Table();
        table.setContainerDataSource(container2);
        table.setPageLength(10);

        VerticalLayout buttonLayout = new VerticalLayout();
        buttonLayout.setWidth(null);

        Button b = new Button("Set items to 2", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                table.setContainerDataSource(container2);
            }
        });
        buttonLayout.addComponent(b);

        b = new Button("Set items to 50", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                table.setContainerDataSource(container50);
            }

        });
        buttonLayout.addComponent(b);

        hl.addComponent(buttonLayout);
        hl.addComponent(table);

        addComponent(hl);
View Full Code Here

    private static final int INITIAL_COMPONENTS = 10;

    public PerformanceTestBasicComponentRendering() {

        main = new VerticalLayout();
        setCompositionRoot(main);
        addInfo();

        result = new Label();
        main.addComponent(result);

        testContainer = new VerticalLayout();

        final Table t = TestForTablesInitialColumnWidthLogicRendering
                .getTestTable(5, 200);

        Table t2 = new Table("Test Table with 199 rows rendered initially") {
View Full Code Here

    private Select s2;

    public TestForWindowing() {

        final VerticalLayout main = new VerticalLayout();

        main.addComponent(new Label(
                "Click the button to create a new inline window."));

        final CheckBox asModal = new CheckBox("As modal");
        main.addComponent(asModal);

        final Button create = new Button("Create a new window",
                new ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        VerticalLayout layout = new VerticalLayout();
                        layout.setMargin(true);
                        Window w = new Window("Testing Window", layout);

                        if (asModal.getValue().booleanValue()) {
                            w.setModal(true);
                        }

                        AbstractSelect s1 = new OptionGroup();
                        s1.setCaption("1. Select output format");
                        s1.addItem("Excel sheet");
                        s1.addItem("CSV plain text");
                        s1.setValue("Excel sheet");
                        s1.setImmediate(true);

                        s2 = new Select();
                        s2.addItem("Separate by comma (,)");
                        s2.addItem("Separate by colon (:)");
                        s2.addItem("Separate by semicolon (;)");
                        s2.setEnabled(false);

                        s1.addListener(new ValueChangeListener() {

                            @Override
                            public void valueChange(ValueChangeEvent event) {
                                String v = (String) event.getProperty()
                                        .getValue();
                                if (v.equals("CSV plain text")) {
                                    s2.setEnabled(true);
                                } else {
                                    s2.setEnabled(false);
                                }
                            }

                        });

                        layout.addComponent(s1);
                        layout.addComponent(s2);

                        Slider s = new Slider();
                        s.setCaption("Volume");
                        s.setMax(13);
                        s.setMin(12);
                        s.setResolution(2);
                        s.setImmediate(true);
                        // s.setOrientation(Slider.ORIENTATION_VERTICAL);
                        // s.setArrows(false);

                        layout.addComponent(s);

                        UI.getCurrent().addWindow(w);

                    }
View Full Code Here

        setTheme("tests-components");

        // Create custom layout, themes/example/layout/mainLayout.html
        mainLayout = new CustomLayout("mainLayout");
        // wrap custom layout inside a panel
        VerticalLayout customLayoutPanelLayout = new VerticalLayout();
        customLayoutPanelLayout.setMargin(true);
        final Panel customLayoutPanel = new Panel(
                "Panel containing custom layout (mainLayout.html)",
                customLayoutPanelLayout);
        customLayoutPanelLayout.addComponent(mainLayout);

        // Login components
        mainLayout.addComponent(username, "loginUser");
        mainLayout.addComponent(loginPwd, "loginPassword");
        mainLayout.addComponent(loginButton, "loginButton");
View Full Code Here

     * Set body panel caption, remove all existing components and add given
     * custom layout in it.
     *
     */
    public void setBody(String customLayout) {
        VerticalLayout bodyLayout = new VerticalLayout();
        bodyLayout.setMargin(true);
        bodyLayout.addComponent(new CustomLayout(customLayout));
        bodyPanel.setContent(bodyLayout);
        bodyPanel.setCaption(customLayout + ".html");
    }
View Full Code Here

    private final VerticalLayout main;

    public TestForChildComponentRendering() {

        main = new VerticalLayout();
        setCompositionRoot(main);
        createNewView();
    }
View Full Code Here

        final ArrayList<Component> components = new ArrayList<Component>();
        while (it.hasNext()) {
            components.add(it.next());
        }

        final VerticalLayout v = main;
        v.removeAllComponents();

        for (int i = components.size(); i > 0; i--) {
            final int index = (int) (Math.random() * i);
            v.addComponent(components.get(index));
            components.remove(index);
        }
    }
View Full Code Here

            + " Completing test ought to be much faster with Toolkit 5.";

    private static final int INITIAL_COMPONENTS = 40;

    public PerformanceTestSubTreeCaching() {
        main = new VerticalLayout();
        setCompositionRoot(main);
        addInfo();

        Button b = new Button("start test", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                startTest();
            }
        });
        b.setDescription("Push this button to start test. A test label will be rendered above existing components.");
        main.addComponent(b);
        b = new Button("end test", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                endTest();
            }
        });
        b.setDescription("Push this button as soon as test componenet is rendered.");
        main.addComponent(b);

        result = new Label();
        main.addComponent(result);

        testContainer = new VerticalLayout();
        populateContainer(testContainer, INITIAL_COMPONENTS);
        main.addComponent(testContainer);
    }
View Full Code Here

        });

    }

    private VerticalLayout wrapInPanelLayout(Component component) {
        VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        layout.addComponent(component);
        return layout;
    }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.VerticalLayout

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.