Package com.vaadin.ui

Examples of com.vaadin.ui.Panel


        final LegacyWindow main = new LegacyWindow(getClass().getName()
                .substring(getClass().getName().lastIndexOf(".") + 1));
        setMainWindow(main);

        HorizontalLayout pl = new HorizontalLayout();
        Panel p = new Panel("Test wrapper for gridlayout margin/spacing", pl);

        gl = new GridLayout(3, 3);
        gl.setMargin(true);
        for (int i = 0; i < 3 * 3; i++) {
            gl.addComponent(new Button("test"));
View Full Code Here


    }

    private void createUI(GridLayout layout) {
        VerticalLayout pl = new VerticalLayout();
        pl.setMargin(true);
        Panel p = new Panel(
                "This is a panel with a longer caption than it should have", pl);
        p.setWidth("100px");
        pl.addComponent(new Label("Contents"));
        layout.addComponent(p);
    }
View Full Code Here

        VerticalLayout el = new VerticalLayout();
        main.setContent(el);

        VerticalLayout pl = new VerticalLayout();
        pl.setMargin(true);
        Panel p = new Panel("Test panel", pl);
        p.setSizeFull();

        pl.addComponent(new Label(
                "Second component is embedded with a slow resource "
                        + "and thus should break layout if Embedded cannot"
                        + " request re-layout after load."));
View Full Code Here

    }

    private void createPanel(GridLayout layout) {
        VerticalLayout panelLayout = new VerticalLayout();
        panelLayout.setMargin(true);
        panel = new Panel("panel caption", panelLayout);
        layout.addComponent(panel);

        innerLayout1 = new HorizontalLayout();
        innerLayout1.setSpacing(true);
        panelLayout.addComponent(innerLayout1);
View Full Code Here

        setMainWindow(new LegacyWindow("#1869", lo));
        lo.setMargin(true);
        lo.setSpacing(true);

        VerticalLayout el = new VerticalLayout();
        Panel elp = new Panel(
                "Vertical ExpandLayout /w first component expanded", el);
        el.setHeight("1000px");
        for (int i = 0; i < 3; i++) {
            Button b = new Button("x");
            el.addComponent(b);
            if (i == 0) {
                b.setSizeFull();
                el.setExpandRatio(b, 1);
            }
        }
        lo.addComponent(elp);
        elp.setWidth("300px");
        elp.setHeight("300px");

        HorizontalLayout elh = new HorizontalLayout();
        Panel elph = new Panel(
                "Horizontal ExpandLayout /w first component expanded", elh);
        elh.setWidth("1000px");
        for (int i = 0; i < 3; i++) {
            Button b = new Button("x");
            elh.addComponent(b);
            if (i == 0) {
                b.setSizeFull();
                elh.setExpandRatio(b, 1);
            }
        }
        lo.addComponent(elph);
        elph.setWidth("300px");
        elph.setHeight("300px");

    }
View Full Code Here

        }
        on = !on;
    }

    private Component getTestComponent() {
        Panel p = new Panel();
        p.setSizeFull();

        Button b = new Button("toggle Values", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                toggleStyleName();
            }
        });
        p.setContent(b);
        return p;
    }
View Full Code Here

        // set theme and some layout stuff
        setMainWindow(w);
        w.getContent().setSizeFull();
        ((MarginHandler) w.getContent()).setMargin(false);

        Panel p = new Panel("Workout Log");
        p.setStyleName(Reindeer.PANEL_LIGHT);
        w.addComponent(p);
        mainLayout = new VerticalLayout();
        p.setContent(mainLayout);

        populateAndConfigureTable();

        mainLayout.addComponent(table);

        // make table consume all extra space
        p.setSizeFull();
        mainLayout.setSizeFull();
        mainLayout.setExpandRatio(table, 1);
        table.setSizeFull();
    }
View Full Code Here

        // 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
View Full Code Here

        setMainWindow(mainWindow);

        // Create horizontal ordered layout
        VerticalLayout panelALayout = new VerticalLayout();
        panelALayout.setMargin(true);
        final Panel panelA = new Panel(
                "Panel containing horizontal ordered layout", panelALayout);
        HorizontalLayout layoutA = new HorizontalLayout();
        // Add 4 random components
        fillLayout(layoutA, componentCountA);
        // Add layout to panel
        panelALayout.addComponent(layoutA);

        // Create vertical ordered layout
        VerticalLayout panelBLayout = new VerticalLayout();
        panelBLayout.setMargin(true);
        final Panel panelB = new Panel(
                "Panel containing vertical ordered layout", panelBLayout);
        VerticalLayout layoutB = new VerticalLayout();
        // Add 4 random components
        fillLayout(layoutB, componentCountB);
        // Add layout to panel
        panelBLayout.addComponent(layoutB);

        // Create grid layout
        final int gridSize = (int) java.lang.Math.sqrt(componentCountC);
        VerticalLayout panelGLayout = new VerticalLayout();
        panelGLayout.setMargin(true);
        final Panel panelG = new Panel("Panel containing grid layout ("
                + gridSize + " x " + gridSize + ")", panelGLayout);
        GridLayout layoutG = new GridLayout(gridSize, gridSize);
        // Add 12 random components
        fillLayout(layoutG, componentCountC);
        // Add layout to panel
        panelGLayout.addComponent(layoutG);

        // Create TabSheet
        final TabSheet tabsheet = new TabSheet();
        tabsheet.setCaption("Tabsheet, above layouts are added to this component");
        layoutA = new HorizontalLayout();
        // Add 4 random components
        fillLayout(layoutA, componentCountA);
        tabsheet.addTab(layoutA, "Horizontal ordered layout", null);
        layoutB = new VerticalLayout();
        // Add 4 random components
        fillLayout(layoutB, componentCountB);
        tabsheet.addTab(layoutB, "Vertical ordered layout", null);
        layoutG = new GridLayout(gridSize, gridSize);
        // Add 12 random components
        fillLayout(layoutG, componentCountC);
        tabsheet.addTab(layoutG, "Grid layout (4 x 2)", null);

        // Create custom layout
        VerticalLayout panelCLayout = new VerticalLayout();
        panelCLayout.setMargin(true);
        final Panel panelC = new Panel("Custom layout with style exampleStyle",
                panelCLayout);
        final CustomLayout layoutC = new CustomLayout("exampleStyle");
        // Add 4 random components
        fillLayout(layoutC, componentCountD);
        // Add layout to panel
View Full Code Here

            break;
        case 5:
            // Link
            VerticalLayout panelLayout = new VerticalLayout();
            panelLayout.setMargin(true);
            result = new Panel(panelLayout);
            result.setCaption("Panel component " + caption);
            panelLayout
                    .addComponent(new Label(
                            "Panel is a container for other components, by default it draws a frame around it's "
                                    + "extremities and may have a caption to clarify the nature of the contained components' purpose."
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Panel

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.