Package com.vaadin.ui

Examples of com.vaadin.ui.VerticalLayout


    private static final String DESCRIPTION = "Simple test that renders n labels into ordered layout.";

    private static final int INITIAL_COMPONENTS = 1000;

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

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

        main.addComponent(new Button("click when rendered",
                new ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        endTest();
                    }
                }));

        main.addComponent(new Button(
                "Click for layout repaint (cached components)",
                new ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        testContainer.markAsDirty();
                    }
                }));

        testContainer = new VerticalLayout();

        for (int i = 0; i < INITIAL_COMPONENTS; i++) {
            Label l = new Label("foo" + i);
            testContainer.addComponent(l);
        }
View Full Code Here


@SuppressWarnings("serial")
public class WebkitScrollbarTest extends AbstractTestUI {

    @Override
    protected void setup(VaadinRequest request) {
        final VerticalLayout uiLayout = new VerticalLayout();
        uiLayout.setMargin(true);
        setContent(uiLayout);

        final VerticalLayout windowLayout = new VerticalLayout();

        final Window testWindow = new Window("WebKitFail", windowLayout);
        testWindow.setWidth(300, Unit.PIXELS);

        GridLayout gl = new GridLayout();
        gl.setHeight(null);
        gl.setWidth(100, Unit.PERCENTAGE);
        windowLayout.addComponent(gl);

        ListSelect listSelect = new ListSelect();
        listSelect.setWidth(100, Unit.PERCENTAGE);
        gl.addComponent(listSelect);
        gl.setMargin(true);
View Full Code Here

    ArrayList<MyComponent> order = new ArrayList<MyComponent>();

    public OrderedLayoutSwapComponents() {

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

import com.vaadin.ui.VerticalLayout;

public class StressComponentsInTable extends CustomComponent {

    public StressComponentsInTable() {
        final VerticalLayout main = new VerticalLayout();
        setCompositionRoot(main);

        main.addComponent(getTestTable(4, 1000));

    }
View Full Code Here

        // Main window contains heading and panel
        main.addComponent(new Label("<h2>Tree demo</h2>", ContentMode.HTML));

        // configure file structure panel
        VerticalLayout explorerLayout = new VerticalLayout();
        explorerLayout.setMargin(true);
        explorerPanel.setContent(explorerLayout);
        main.addComponent(explorerPanel);
        explorerLayout.addComponent(tree);
        explorerPanel.setHeight("400px");

        // "this" handles tree's expand event
        tree.addListener(this);
View Full Code Here

        setTheme("tests-components");
        mainWindow.getContent().setSizeFull();
        setMainWindow(mainWindow);
        sp = new HorizontalSplitPanel();
        sp.setSizeFull();
        VerticalLayout naviLayout = new VerticalLayout();
        naviLayout
                .addComponent(new Label(
                        "Click to open a test case.<br/>Right click to open test in a new window<br/><br/>",
                        ContentMode.HTML));
        naviLayout.addComponent(createMenu());
        naviLayout.addComponent(createMissingTestsList());

        sp.setFirstComponent(naviLayout);
        sp.setSplitPosition(250, Sizeable.UNITS_PIXELS);
        VerticalLayout embeddingLayout = new VerticalLayout();
        embeddingLayout.setSizeFull();
        embeddingLayout
                .addComponent(new Label(
                        "<b>Do not use the embedded version for creating automated tests. Open the test in a new window before recording.</b><br/>",
                        ContentMode.HTML));
        applicationEmbedder.setSizeFull();
        embeddingLayout.addComponent(applicationEmbedder);
        embeddingLayout.setExpandRatio(applicationEmbedder, 1);
        sp.setSecondComponent(embeddingLayout);
        mainWindow.addComponent(sp);

        applicationEmbedder.setType(Embedded.TYPE_BROWSER);
        baseUrl = getURL().toString().replace(getClass().getName(), "")
View Full Code Here

    public void init() {
        final LegacyWindow mainWindow = new LegacyWindow("Layout demo");
        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
        panelCLayout.addComponent(layoutC);

        // Add demo panels (layouts) to main window
        mainWindow.addComponent(panelA);
        mainWindow.addComponent(panelB);
        mainWindow.addComponent(panelG);
View Full Code Here

            result = new Link("", new ExternalResource("http://www.vaadin.com"));
            result.setCaption("Link component " + caption);
            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."
                                    + " Panel contains an layout where the actual contained components are added, "
                                    + "this layout may be switched on the fly."));
View Full Code Here

    private static int sequence = 0;

    public UsingCustomNewItemHandlerInSelect() {

        VerticalLayout pl = new VerticalLayout();
        pl.setMargin(true);
        final Panel panel = new Panel("Select demo", pl);
        pl.addComponent(select);

        select.setCaption("Select component");
        select.setImmediate(true);
        select.addContainerProperty("CAPTION", String.class, "");
        select.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
View Full Code Here

        sp.setSplitPosition(290, Sizeable.UNITS_PIXELS);

        final HorizontalSplitPanel sp2 = new HorizontalSplitPanel();
        sp2.setSplitPosition(255, Sizeable.UNITS_PIXELS);

        VerticalLayout pl = new VerticalLayout();
        pl.setMargin(true);
        final Panel p = new Panel("Accordion Panel", pl);
        p.setSizeFull();

        tab = new TabSheet();
        tab.setSizeFull();

        VerticalLayout reportLayout = new VerticalLayout();
        final Panel report = new Panel("Monthly Program Runs", reportLayout);
        final VerticalLayout controls = reportLayout;
        controls.setMargin(true);
        controls.addComponent(new Label("Report tab"));
        controls.addComponent(click);
        controls.addComponent(click2);
        reportLayout.addComponent(controls);
        final DateField cal = new DateField();
        cal.setResolution(DateField.RESOLUTION_DAY);
        cal.setLocale(new Locale("en", "US"));
        reportLayout.addComponent(cal);
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.