Package com.vaadin.ui

Examples of com.vaadin.ui.Select


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

    private void createUI(GridLayout layout) {
        Select s = new Select("Select");
        s.addItem("Item 1");
        s.addItem("Item 2");
        layout.addComponent(s);
    }
View Full Code Here


                        s1.addItem("Excel sheet");
                        s1.addItem("CSV plain text");
                        s1.setValue("Excel sheet");
                        s1.setImmediate(true);

                        s2 = new Select();
                        s2.addItem("Separate by comma (,)");
                        s2.addItem("Separate by colon (:)");
                        s2.addItem("Separate by semicolon (;)");
                        s2.setEnabled(false);
View Full Code Here

        l.setTargetHeight(200);
        l.setTargetWidth(500);
        l.setTargetBorder(Link.TARGET_BORDER_MINIMAL);
        main.addComponent(l);

        final Select se = new Select();
        se.setCaption("VALITSET TÄSTÄ");
        se.addItem("valinta1");
        se.addItem("Valinta 2");

        Button b = new Button("refresh view", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                createNewView();
View Full Code Here

            public void buttonClick(ClickEvent event) {
                up.interruptUpload();
            }
        });

        uploadBufferSelector = new Select("StreamVariable type");
        uploadBufferSelector.setImmediate(true);
        uploadBufferSelector.addItem("memory");
        uploadBufferSelector.setValue("memory");
        uploadBufferSelector.addItem("tempfile");
        uploadBufferSelector
View Full Code Here

            result = new TextField();
            result.setCaption("TextField component " + caption);
            break;
        case 3:
            // Select
            result = new Select("Select " + caption);
            result.setCaption("Select component " + caption);
            ((Select) result).addItem("First item");
            ((Select) result).addItem("Second item");
            ((Select) result).addItem("Third item");
            break;
View Full Code Here

        });

        //
        // Select listeners
        //
        s1 = new Select("Select 1");
        main.addComponent(s1);
        s1.setImmediate(true);
        s1.setNewItemsAllowed(true);

        s1.addItem("first");
View Full Code Here

        panel.setCaption(getCaption("panel"));
        return panel;
    }

    Component getSelect() {
        return new Select(getCaption("select"), getSelectOptions());
    }
View Full Code Here

                }));
    }

    @SuppressWarnings("deprecation")
    private Select createSelect() {
        Select select = new Select();
        select.addContainerProperty(PROPERTY_ID, String.class, "");
        select.setItemCaptionPropertyId(PROPERTY_ID);

        Item item1 = select.addItem("1");
        item1.getItemProperty(PROPERTY_ID).setValue("1");
        Item item2 = select.addItem("2");
        item2.getItemProperty(PROPERTY_ID).setValue("2");

        select.setNullSelectionAllowed(true);

        return select;
    }
View Full Code Here

        final LegacyWindow main = new LegacyWindow("#1804");
        setMainWindow(main);

        com.vaadin.ui.Select s;

        s = new Select("Select with null selection allowed; required=true");
        s.setNullSelectionAllowed(true);
        s.setRequired(true);
        listOfAllFields.add(s);

        s = new Select("Select with null selection NOT allowed; required=true");
        s.setNullSelectionAllowed(false);
        s.setRequired(true);
        listOfAllFields.add(s);

        s = new Select("Testcase from the ticket #1804");
        s.setNullSelectionAllowed(false);
        s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id"));
        s.addValidator(new EmptyStringValidator(
                "Selection required for test-field"));
        s.setRequired(true);
        listOfAllFields.add(s);

        s = new Select("Testcase from the ticket #1804, but without validator");
        s.setNullSelectionAllowed(false);
        s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id"));
        s.setRequired(true);
        listOfAllFields.add(s);

        s = new Select(
                "Testcase from the ticket #1804, but with required=false");
        s.setNullSelectionAllowed(false);
        s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id"));
        s.addValidator(new EmptyStringValidator(
                "Selection required for test-field"));
        listOfAllFields.add(s);

        s = new Select(
                "Testcase from the ticket #1804, but without validator and with required=false");
        s.setNullSelectionAllowed(false);
        s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id"));
        listOfAllFields.add(s);

        s = new Select(
                "Required=true, custom error message, null selection not allowed");
        s.setRequired(true);
        s.setNullSelectionAllowed(false);
        s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id"));
        s.setValue(null);
View Full Code Here

        LegacyWindow main = new LegacyWindow("The Main Window!!!");
        setMainWindow(main);
        Form form = new Form();
        VerticalLayout formLayout = new VerticalLayout();
        form.setLayout(formLayout);
        Select formSelect = new Select("hello");
        Select select = new Select("hello");
        form.setEnabled(false);
        select.setEnabled(false);
        formLayout.addComponent(formSelect);

        VerticalLayout l2 = new VerticalLayout();
        l2.addComponent(new Select("hello"));
        l2.setEnabled(false);

        form.setCaption("Form");
        main.addComponent(form);
        l2.setCaption("VerticalLayout");
        main.addComponent(l2);
        main.addComponent(select);
        main.addComponent(new Select("Enabled=true select"));
    }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Select

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.