Package com.vaadin.ui

Examples of com.vaadin.ui.FormLayout


        row.addComponent(date);

        PropertysetItem item = new PropertysetItem();
        item.addItemProperty("date", new ObjectProperty<Date>(getDefaultDate()));

        FormLayout form = new FormLayout();
        form.setMargin(false);

        FieldGroup binder = new FieldGroup(item);
        form.addComponent(binder.buildAndBind(
                "Picker in read-only field group", "date"));
        binder.setReadOnly(true);

        row.addComponent(form);
    }
View Full Code Here


        w.addComponent(new Button("new form layout",
                new Button.ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        form.setLayout(new FormLayout());

                    }

                }));
View Full Code Here

            Layout main = new VerticalLayout();
            setContent(main);
            main.setSizeUndefined();
            main.setStyleName(Reindeer.PANEL_LIGHT);

            FormLayout form = new FormLayout();
            form.setSizeUndefined();
            date.setResolution(DateField.RESOLUTION_MIN);
            form.addComponent(date);
            form.addComponent(kilomiters);
            form.addComponent(title);
            main.addComponent(form);

        }
View Full Code Here

        return layout;
    }

    private Form createForm(GridLayout parentLayout, String w, String h) {
        FormLayout formLayout = new FormLayout();
        Form form = new Form(formLayout);

        VerticalLayout vl = new VerticalLayout();
        vl.setMargin(true);
        vl.setSizeFull();
        Panel p = new Panel("Form " + w + "x" + h, vl);

        p.setWidth(w);
        p.setHeight(h);

        parentLayout.addComponent(p);
        vl.addComponent(form);
        formLayout.setSizeFull();

        return form;
    }
View Full Code Here

        Button complex = new Button("Open Entry Dialog",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        FormLayout form = new FormLayout();

                        final Window w = new Window("Form Window", form);
                        w.center();
                        w.setModal(modal.getValue());
                        w.setAssistivePrefix(prefix.getValue());
                        w.setAssistivePostfix(postfix.getValue());

                        Label description1 = new Label(
                                "Please fill in your data");
                        form.addComponent(description1);

                        if (!additionalDescription.getValue()) {
                            w.setAssistiveDescription(description1);
                        } else {
                            Label description2 = new Label(
                                    "and press the button save.");
                            form.addComponent(description2);

                            w.setAssistiveDescription(description1,
                                    description2);
                        }

                        w.setTabStopEnabled(tabStop.getValue());
                        w.setTabStopTopAssistiveText(topTabStopMessage
                                .getValue());
                        w.setTabStopBottomAssistiveText(bottomTabStopMessage
                                .getValue());

                        TextField name = new TextField("Name:");
                        form.addComponent(name);

                        form.addComponent(new TextField("Address"));

                        Button saveButton = new Button("Save",
                                new Button.ClickListener() {
                                    @Override
                                    public void buttonClick(ClickEvent event) {
                                        w.close();
                                    }
                                });
                        form.addComponent(saveButton);

                        event.getButton().getUI().addWindow(w);
                        name.focus();

                        if (tabOrder.getValue()) {
View Full Code Here

        LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
        setMainWindow(w);
        setTheme("tests-tickets");
        w.getContent().setSizeUndefined();

        layout1 = new FormLayout();
        layout1.setSizeUndefined();
        layout1.setStyleName("borders");
        Label label = new Label(
                "This should not be wider than this label + reserved error space");
        label.setCaption("A caption");
        layout1.addComponent(label);
        w.addComponent(layout1);

        layout2 = new FormLayout();
        layout2.setWidth("500px");
        layout2.setStyleName("borders");
        label = new Label("This should be 500px wide");
        label.setCaption("A caption");
        layout2.addComponent(label);
View Full Code Here

public class TableInFormLayoutCausesScrolling extends AbstractTestUI {

    @Override
    public void setup(VaadinRequest request) {

        final FormLayout fl = new FormLayout();
        addComponent(fl);

        for (int i = 20; i-- > 0;) {
            fl.addComponent(new TextField());
        }

        final Table table = new Table();
        table.setSelectable(true);
        table.addContainerProperty("item", String.class, "");
        for (int i = 50; i-- > 0;) {
            table.addItem(new String[] { "item" + i }, i);
        }

        fl.addComponent(table);
    }
View Full Code Here

    private FormLayout inner31;
    private FormLayout inner4;

    @Override
    protected void setup(VaadinRequest request) {
        outer = new FormLayout();
        outer.setSizeUndefined();
        outer.setWidth("100%");

        inner1 = new FormLayout();
        inner1.addComponent(new Label("Test"));
        inner1.addComponent(new Label("Test2"));
        outer.addComponent(inner1);

        outer.addComponent(new Label("Test"));
        outer.addComponent(new Label("Test2"));

        inner2 = new FormLayout();
        inner2.addComponent(new Label("Test"));
        inner2.addComponent(new Label("Test2"));
        inner21 = new FormLayout();
        inner21.addComponent(new Label("Test"));
        inner21.addComponent(new Label("Test2"));
        inner2.addComponent(inner21);
        outer.addComponent(inner2);

        inner3 = new FormLayout();
        inner3.addComponent(new Label("Test"));
        inner3.addComponent(new Label("Test2"));
        // this layout never gets spacing or margin
        inner31 = new FormLayout();
        inner31.addComponent(new Label("Test"));
        inner31.addComponent(new Label("Test2"));
        inner31.setSpacing(false);
        inner31.setMargin(false);
        inner3.addComponent(inner31);
        outer.addComponent(inner3);

        inner4 = new FormLayout();
        inner4.addComponent(new Label("Test"));
        inner4.addComponent(new Label("Test2"));
        outer.addComponent(inner4);

        addComponent(outer);
View Full Code Here

    @Override
    protected void setup() {

        setTheme("tests-tickets");

        FormLayout layout = new FormLayout();

        TextField field1 = new TextField("Red style");
        field1.setStyleName("ticket4997-red");
        layout.addComponent(field1);

        TextField field2 = new TextField("Blue style");
        field2.setStyleName("ticket4997-blue");
        layout.addComponent(field2);

        TextField field3 = new TextField("Red-Blue style");
        field3.addStyleName("ticket4997-red");
        field3.addStyleName("ticket4997-blue");
        layout.addComponent(field3);

        TextField field4 = new TextField("Disabled");
        field4.setEnabled(false);
        field4.addStyleName("foobar"); // no visible change, but points out
        // a regression #5377
        layout.addComponent(field4);

        addComponent(layout);
    }
View Full Code Here

        } else {
            mainWindow.removeAllComponents();
        }
        mainWindow.setCaption("Please login");

        FormLayout formLayout = new FormLayout();
        final TextField userField = new TextField("Username");
        userField.setId("user");
        final PasswordField passwordField = new PasswordField("Password");
        passwordField.setId("pwd");
        Button login = new Button("login");
        login.setId("loginButton");
        login.setClickShortcut(KeyCode.ENTER);
        formLayout.addComponent(userField);
        formLayout.addComponent(passwordField);
        formLayout.addComponent(login);
        mainWindow.setContent(formLayout);

        login.addListener(new ClickListener() {
            @Override
            public void buttonClick(final ClickEvent event) {
View Full Code Here

TOP

Related Classes of com.vaadin.ui.FormLayout

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.