Package com.vaadin.ui

Examples of com.vaadin.ui.GridLayout


    public void init() {
        LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
        setMainWindow(w);
        // setTheme("tests-tickets");

        mainLayout = new GridLayout(1, 2);
        w.setContent(mainLayout);
        orderedLayout = createOL();
        gridLayout = createGL();
        formLayout = createForms();
View Full Code Here


        mainLayout.addComponent(orderedLayout);
        // w.setContent(orderedLayout);
    }

    private static Layout createOL() {
        GridLayout layout = new GridLayout(1, 5);

        GridLayout l1 = new GridLayout(1, 3);
        createLayout(l1, new HorizontalLayout(), "1000px", "150px", "100%",
                null, true);
        createLayout(l1, new HorizontalLayout(), "1000px", "150px", "50px",
                null, false);
        GridLayout l2 = new GridLayout(6, 1);
        createLayout(l2, new VerticalLayout(), "200px", "500px", true);
        createLayout(l2, new VerticalLayout(), "200px", "500px", "100%", null,
                true);
        createLayout(l2, new VerticalLayout(), "150px", "500px", true);
        createLayout(l2, new VerticalLayout(), "150px", "500px", "100%", null,
View Full Code Here

        return layout;
    }

    private static Layout createGL() {
        GridLayout layout = new GridLayout(1, 5);

        GridLayout l1 = new GridLayout(1, 3);
        createLayout(l1, new GridLayout(8, 1), "1000px", "150px", "100%", null,
                true);
        createLayout(l1, new GridLayout(8, 1), "1000px", "150px", "50px", null,
                false);
        GridLayout l2 = new GridLayout(6, 1);
        createLayout(l2, new GridLayout(1, 8), "200px", "500px", true);
        createLayout(l2, new GridLayout(1, 8), "200px", "500px", "100%", null,
                true);
        createLayout(l2, new GridLayout(1, 8), "150px", "500px", true);
        createLayout(l2, new GridLayout(1, 8), "150px", "500px", "100%", null,
                true);
        createLayout(l2, new GridLayout(1, 8), "100px", "500px", true);
        createLayout(l2, new GridLayout(1, 8), "100px", "500px", "100%", null,
                true);
        layout.addComponent(l1);
        layout.addComponent(l2);

        return layout;
View Full Code Here

        }

    }

    private Layout createForms() {
        GridLayout layout = new GridLayout(1, 5);
        Form form;

        Random r = new Random();
        GridLayout l1 = new GridLayout(1, 3);
        form = createForm(l1, "200px", "500px");
        BeanItem<FormObject> item = new BeanItem<FormObject>(new FormObject());
        form.setItemDataSource(item);
        for (Iterator<?> i = item.getItemPropertyIds().iterator(); i.hasNext();) {
            Object property = i.next();
View Full Code Here

    private int tooltipCount = 0;

    @Override
    public void setup() {

        GridLayout gl = new GridLayout(2, 2);
        gl.setSizeFull();
        TextField f1 = createField();
        TextField f2 = createField();
        TextField f3 = createField();
        TextField f4 = createField();
        gl.addComponent(f1);
        gl.addComponent(f2);
        gl.addComponent(f3);
        gl.addComponent(f4);

        gl.setComponentAlignment(f1, Alignment.TOP_LEFT);
        gl.setComponentAlignment(f2, Alignment.TOP_RIGHT);
        gl.setComponentAlignment(f3, Alignment.BOTTOM_LEFT);
        gl.setComponentAlignment(f4, Alignment.BOTTOM_RIGHT);

        getLayout().setSizeFull();
        getLayout().addComponent(gl);

    }
View Full Code Here

                });
                addComponent(b);
            }

            gl = new GridLayout(30, 50);
            addComponent(gl);

        }
View Full Code Here

            + "Nunc eros dui, elementum at, ullamcorper eget, varius at, velit. Ut dictum. Cras ullamcorper ante vel tortor. Quisque viverra mauris vulputate quam. Nulla dui. Suspendisse non eros at ipsum faucibus hendrerit. Morbi dignissim pharetra tortor. Etiam malesuada. Mauris lacinia elementum erat. Duis mollis placerat metus. Nunc risus felis, cursus ac, cursus vel, convallis vel, metus. Ut vehicula nibh et nulla. Vivamus id pede. Quisque egestas arcu a ligula. Maecenas vehicula. Quisque sed ligula quis tellus tempus rutrum. Curabitur vel augue sed orci egestas pharetra. Duis pharetra.";

    @Override
    public void init() {
        LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
        w.setContent(new GridLayout(2, 2));
        setMainWindow(w);

        VerticalLayout layout = new VerticalLayout();
        Panel p = new Panel(layout);
        p.setCaption("ExpandLayout");
        p.setWidth("500px");
        p.setHeight("500px");
        layout.setSizeFull();

        w.addComponent(p);

        tf1 = new TextArea();
        tf1.setRows(5);
        tf1.setSizeFull();
        tf1.setValue(contents);
        tf1.setCaption("TextField caption");
        layout.addComponent(tf1);

        /*
         *
         * OrderedLayout
         */

        VerticalLayout layout2 = new VerticalLayout();
        Panel p2 = new Panel(layout2);
        p2.setCaption("OrderedLayout");
        p2.setWidth("500px");
        p2.setHeight("500px");
        layout2.setSizeFull();

        w.addComponent(p2);

        tf2 = new TextArea();
        tf2.setRows(5);
        tf2.setSizeFull();
        tf2.setValue(contents);
        tf2.setCaption("TextField caption");
        layout2.addComponent(tf2);

        /*
         *
         * GridLayout
         */

        VerticalLayout p3l = new VerticalLayout();
        p3l.setMargin(true);
        Panel p3 = new Panel(p3l);
        p3.setCaption("GridLayout");
        p3.setWidth("500px");
        p3.setHeight("500px");
        // p3.setContent(new GridLayout());
        p3l.setSizeFull();
        p3l.setMargin(false);

        GridLayout gl = new GridLayout();
        gl.setSizeFull();
        gl.setMargin(false);
        p3l.addComponent(gl);
        w.addComponent(p3);

        tf3 = new TextArea();
        tf3.setRows(5);
        tf3.setSizeFull();
        tf3.setValue(contents);
        tf3.setCaption("TextField caption");
        // p3.getContent().addComponent(tf3);
        gl.addComponent(tf3);

        // Panel pp = new Panel();
        // pp.setCaption("OrderedLayout");
        // pp.setWidth("500px");
        // pp.setHeight("500px");
View Full Code Here

    @Override
    public void init() {
        LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
        setMainWindow(w);

        GridLayout layout = new GridLayout(2, 2);
        layout.setSpacing(true);

        @SuppressWarnings("unused")
        int nr = 5;
        TextField tf;
        tf = new TextField("TextField (tabIndex 1)");
        tf.setTabIndex(1);
        tf.focus();
        layout.addComponent(tf);
        layout.addComponent(new TextField("TextField without tab index"));
        layout.addComponent(new TextField("TextField without tab index"));
        layout.addComponent(new TextField("TextField without tab index"));
        layout.addComponent(new TextField("TextField without tab index"));
        tf = new TextField("TextField (tabIndex 2)");
        tf.setTabIndex(2);
        layout.addComponent(tf);

        w.setContent(layout);
    }
View Full Code Here

    @Override
    public void init() {
        LegacyWindow w = new LegacyWindow(getClass().getName());
        setMainWindow(w);
        w.setContent(new GridLayout(2, 2));

        // Panel p = new Panel("test");
        // p.setWidth(500);
        // p.setHeight(500);
        // p.setContent(new GridLayout(1, 2));
View Full Code Here

        p.setWidth("500px");
        p.setHeight("500px");
        pl.setSizeFull();
        layout.addComponent(p);

        GridLayout gl = new GridLayout(1, 4);
        gl.setMargin(true);
        gl.setCaption("Horizontal");
        gl.setWidth("100%");

        // Button b;

        // b = new Button("Wide button");
        // b.setWidth("500");
        // gl.addComponent(b);

        addButtons(gl);

        p.setContent(gl);

        /* VERTICAL */

        gl = new GridLayout(4, 1);
        gl.setMargin(true);
        // gl.setCaption("Vertical");
        gl.setHeight("100%");
        addButtons(gl);

        // Button b = new Button("High button");
        // b.setHeight(200);
        // gl.addComponent(b);
View Full Code Here

TOP

Related Classes of com.vaadin.ui.GridLayout

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.