Package com.vaadin.ui

Examples of com.vaadin.ui.VerticalLayout


        TextField editor = new TextField();
        Button done = new Button("Done");

        PropertyEditor(ItemClickEvent event) {
            VerticalLayout layout = new VerticalLayout();
            layout.setMargin(true);
            setContent(layout);
            c = (Container) event.getSource();

            propertyid = event.getPropertyId();
            itemid = event.getItemId();

            setCaption("Editing " + itemid + " : " + propertyid);

            editor.setPropertyDataSource(c.getContainerProperty(itemid,
                    propertyid));
            layout.addComponent(editor);
            layout.addComponent(done);

            setWidth(W + "px");
            setHeight(H + "px");

            setPositionX(event.getClientX() - W / 2);
View Full Code Here


        w.setContent(layout);
        createUI(layout);
    }

    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

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

        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."));

        Embedded em = new Embedded("TestEmbedded", slowRes);
View Full Code Here

    public void fill(IndexedContainer container, int size) {
        for (int i = 0; i < size; i++) {
            int randInt = i;
            Item item = container.addItem(new Integer(i));
            VerticalLayout layout = new VerticalLayout();
            layout.setId("lo" + i);
            layout.addComponent(new Button("Test " + randInt));
            item.getItemProperty("layout").setValue(layout);
        }
    }
View Full Code Here

                .addComponent(
                        new Label(
                                "Defining spacing must be possible also with pure CSS"));

        Layout gl;
        gl = new VerticalLayout();
        gl.setWidth("100%");
        gl.setHeight("200px");
        gl.setStyleName("t2232");
        fillAndAdd(gl);

        gl = new GridLayout();
        gl.setWidth("100%");
        gl.setHeight("200px");
        gl.setStyleName("t2232");
        fillAndAdd(gl);

        gl = new VerticalLayout();
        gl.setWidth("100%");
        gl.setHeight("200px");
        ((SpacingHandler) gl).setSpacing(true);
        fillAndAdd(gl);

        gl = new GridLayout();
        gl.setWidth("100%");
        gl.setHeight("200px");
        ((SpacingHandler) gl).setSpacing(true);
        fillAndAdd(gl);

        gl = new VerticalLayout();
        gl.setWidth("100%");
        gl.setHeight("200px");
        fillAndAdd(gl);

        gl = new GridLayout();
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);

        b1 = new Button("Button inside orderedLayout", new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
View Full Code Here

        tf = new TextField("Disabled");
        tf.setImmediate(true);
        tf.setEnabled(false);
        content.addComponent(tf);

        VerticalLayout oneLayout = new VerticalLayout();
        oneLayout.setMargin(true);
        one.setContent(oneLayout);

        content.addComponent(one);
        tf = new TextField("Enabled");
        tf.setImmediate(true);
        oneLayout.addComponent(tf);
        tf = new TextField("Disabled");
        tf.setImmediate(true);
        tf.setEnabled(false);
        oneLayout.addComponent(tf);

        VerticalLayout twoLayout = new VerticalLayout();
        twoLayout.setMargin(true);
        two.setContent(twoLayout);

        content.addComponent(two);
        tf = new TextField("Enabled");
        tf.setImmediate(true);
        twoLayout.addComponent(tf);
        tf = new TextField("Disabled");
        tf.setImmediate(true);
        tf.setEnabled(false);
        twoLayout.addComponent(tf);

        form = new Form();
        form.setCaption("Enabled");
        form.setFormFieldFactory(new DefaultFieldFactory() {
View Full Code Here

    @Override
    protected void setup(VaadinRequest request) {

        final int totalRows = 100;

        final VerticalLayout layout = new VerticalLayout();

        final IndexedContainer datasource = new IndexedContainer();

        datasource.addContainerProperty("value", Integer.class, -1);
        for (int i = 0; i < totalRows; i++) {
            addRow(datasource);
        }

        final Table table = new Table();
        table.setContainerDataSource(datasource);
        layout.addComponent(table);
        addComponent(layout);

        final Label label = new Label("");
        layout.addComponent(label);

        NativeButton addRowButton = new NativeButton("Add row",
                new NativeButton.ClickListener() {

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

        NativeButton jumpToLastRowButton = new NativeButton("Jump to last row",
                new NativeButton.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        jumpToLastRow(table);
                    }
                });
        NativeButton jumpTo15thRowButton = new NativeButton("Jump to 15th row",
                new NativeButton.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        jumpToFifteenthRow(table);
                    }
                });
        NativeButton jumpToFirstRowButton = new NativeButton(
                "Jump to first row", new NativeButton.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        jumpToFirstRow(table);
                    }
                });

        NativeButton updateLabelButton = new NativeButton("UpdateLabel",
                new NativeButton.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        label.setValue(Integer.toString(table
                                .getCurrentPageFirstItemIndex()));
                    }
                });
        layout.addComponent(addRowButton);
        layout.addComponent(jumpToLastRowButton);
        layout.addComponent(jumpTo15thRowButton);
        layout.addComponent(jumpToFirstRowButton);
        layout.addComponent(updateLabelButton);
    }
View Full Code Here

public class TextFieldValueGoesMissing extends AbstractTestUI {

    @SuppressWarnings("unchecked")
    @Override
    protected void setup(VaadinRequest request) {
        final VerticalLayout verticalLayout = new VerticalLayout();

        final Label label1 = new Label("1");
        final Label label2 = new Label("2");

        Button button = new Button("Replace label");
        button.addClickListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                if (verticalLayout.getComponentIndex(label1) > -1) {
                    verticalLayout.replaceComponent(label1, label2);
                } else {
                    verticalLayout.replaceComponent(label2, label1);
                }
            }
        });
        verticalLayout.addComponent(button);
        verticalLayout.addComponent(label1);

        Table table = new Table();
        table.addContainerProperty("Field", TextField.class, null);
        Object id = table.addItem();
        TextField tf = new TextField();
        table.getItem(id).getItemProperty("Field").setValue(tf);

        verticalLayout.addComponent(table);

        addComponent(verticalLayout);

    }
View Full Code Here

            sp.setHeight("300px");
            sp.addComponent(new Label("Label"));
            textArea.setSizeFull();
        }
        if (c == Panel.class) {
            VerticalLayout layout = new VerticalLayout();
            layout.setMargin(true);
            ((Panel) cc).setContent(layout);
            containerToComponent.put(cc, layout);
            layout.setVisible(false);
            textArea.setVisible(true);
            return cc;
        }

        return cc;
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.