Package com.vaadin.ui

Examples of com.vaadin.ui.Select


        // Add some components to the layout
        layout.addComponent(new TextField(null, "Click here"));
        layout.addComponent(new Link("Click here", null));

        Select select = new Select(null, Arrays.asList("Click here"));
        select.select("Click here");
        layout.addComponent(select);

        // Tab content
        VerticalLayout l1 = new VerticalLayout();
        l1.setMargin(true);
View Full Code Here


                        + "     - Click the arrow in the Select\n"
                        + "  --> The opened list correctly shows the new value but the old one is shown in the \"input\" part");
        label.setContentMode(ContentMode.PREFORMATTED);
        layout.addComponent(label);

        final Select select = new Select("Test Select");
        select.setWidth("100px");
        select.setImmediate(true);
        select.setNullSelectionAllowed(false);
        select.addItem("1");
        select.addItem("2");
        select.addItem("3");

        final ObjectProperty<String> valueProperty = new ObjectProperty<String>(
                "1", String.class);
        select.setPropertyDataSource(valueProperty);
        layout.addComponent(select);

        globalValue.addListener(new Property.ValueChangeListener() {
            @Override
            public void valueChange(Property.ValueChangeEvent event) {
View Full Code Here

    @Override
    protected void setup() {
        TextField textField = new TextField("text field");
        textField.setImmediate(true);
        final Select select = new Select("select", Arrays.asList("1", "2", "3",
                "4"));
        textField.addListener(new ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                select.addItem(Long.valueOf(select.size() + 1).toString()); // or
                                                                            // just
                                                                            // select.requestRepaint();
            }
        });
        addComponent(textField);
View Full Code Here

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

        com.vaadin.ui.Select s;

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

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

        for (Iterator<Select> i = listOfAllFields.iterator(); i.hasNext();) {
            s = i.next();
View Full Code Here

        super(8, 1);
        this.parent = parent;
        setSpacing(true);
        setWidth(null);

        Select s = new Select("Basic select");
        s.setId("select" + debugIdCounter++);
        addComponent(s);

        s = new Select("Select with items");
        s.setId("select" + debugIdCounter++);
        createDummyData(s);
        addComponent(s);

        TwinColSelect tws = new TwinColSelect();
        tws.setId("select" + debugIdCounter++);
        createDummyData(tws);
        addComponent(tws);

        OptionGroup og = new OptionGroup();
        og.setId("select" + debugIdCounter++);
        createDummyData(og, 4);
        addComponent(og);

        og = new OptionGroup();
        og.setId("select" + debugIdCounter++);
        createDummyData(og, 4);
        og.setItemEnabled("Foo2", false);
        og.setItemEnabled("Foo3", false);
        addComponent(og);

        NativeSelect ns = new NativeSelect();
        ns.setId("select" + debugIdCounter++);
        createDummyData(ns);
        addComponent(ns);

        createComboBoxWith(null, null, null);
        createComboBoxWith("CB Search", ChameleonTheme.COMBOBOX_SEARCH, null);
        createComboBoxWith("SelectButton",
                ChameleonTheme.COMBOBOX_SELECT_BUTTON, null);

        ListSelect ls = new ListSelect();
        ls.setId("select" + debugIdCounter++);
        createDummyData(ls);
        addComponent(ls);

        s = new Select("Basic select");
        s.setId("select" + debugIdCounter++);
        s.setWidth("100px");
        addComponent(s);

        s = new Select("Select with items");
        s.setWidth("100px");
        s.setId("select" + debugIdCounter++);
        createDummyData(s);
        addComponent(s);

        createComboBoxWith(null, null, "100px");
        createComboBoxWith("CB Search", ChameleonTheme.COMBOBOX_SEARCH, "100px");
View Full Code Here

        return button;
    }

    private Component initSelect(Container containerDataSource, String caption,
            ObjectProperty<?> property) {
        Select select = new Select(caption);
        select.setFilteringMode(FilteringMode.CONTAINS);
        select.setImmediate(true);
        select.setNullSelectionAllowed(false);
        select.setItemCaptionPropertyId(Ticket1506_TestContainer.PROPERTY_2_ID);

        select.setContainerDataSource(containerDataSource);
        select.setPropertyDataSource(property);
        return select;
    }
View Full Code Here

    private Table barTable;
    private Table bazTable;

    @Override
    protected void setup() {
        Select theme = new Select();
        theme.addItem("reindeer");
        theme.addItem("runo");
        theme.addItem("base");
        theme.addItem("liferay");
        theme.setValue("reindeer");
        theme.setNullSelectionAllowed(false);
        theme.setImmediate(true);
        theme.addListener(new ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                setTheme(String.valueOf(event.getProperty().getValue()));
            }
        });
View Full Code Here

        return c;
    }

    /** Create new Select and add it to current component container. */
    public Select select() {
        Select c = new Select();
        c.setImmediate(true);
        add(c);
        return c;
    }
View Full Code Here

    /**
     * Create new Select with given caption and add it to current component
     * container.
     */
    public Select select(String caption) {
        Select c = select();
        c.setCaption(caption);
        return c;
    }
View Full Code Here

    }

    /** Create new Select with given caption and listener. */
    public Select select(String caption,
            Property.ValueChangeListener changeListener) {
        Select c = select(caption);
        c.addListener(changeListener);
        return c;
    }
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.