Package com.vaadin.ui

Examples of com.vaadin.ui.ComboBox.addItem()


    protected void setup() {
        ComboBox cb = new ComboBox();
        cb.addContainerProperty("caption", String.class, null);
        cb.addContainerProperty("icon", Resource.class, null);
        for (int i = 1; i < 200 + 1; i++) {
            Item item = cb.addItem(i);
            item.getItemProperty("caption").setValue("Item " + i);
            item.getItemProperty("icon").setValue(
                    new ThemeResource("../runo/icons/16/users.png"));
        }
        cb.setItemIconPropertyId("icon");
View Full Code Here


        combobox.setDescription("ComboBox with more than 10 elements in it's dropdown list.");

        combobox.setImmediate(true);

        for (int i = 1; i <= ITEM_COUNT; i++) {
            combobox.addItem(String.format(ITEM_NAME_TEMPLATE, i));
        }

        combobox.addValueChangeListener(new ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
View Full Code Here

    }

    private ComboBox createComboBox(String caption) {
        ComboBox cb = new ComboBox(caption);
        cb.setImmediate(true);
        cb.addItem(1);
        cb.setItemCaption(1, "icon test");
        cb.setItemIcon(1, new ThemeResource("menubar/img/checked.png"));
        return cb;
    }
View Full Code Here

    private ComboBox getComboBox(String caption, boolean addNullItem, String id) {
        ComboBox cb = new ComboBox(caption);
        cb.setImmediate(true);
        if (addNullItem) {
            cb.addItem("Null item");
            cb.setNullSelectionItemId("Null item");
        }
        cb.addItem("Value 1");
        cb.addItem("Value 2");
        cb.addItem("Value 3");
View Full Code Here

        cb.setImmediate(true);
        if (addNullItem) {
            cb.addItem("Null item");
            cb.setNullSelectionItemId("Null item");
        }
        cb.addItem("Value 1");
        cb.addItem("Value 2");
        cb.addItem("Value 3");

        cb.setId(id);
View Full Code Here

        if (addNullItem) {
            cb.addItem("Null item");
            cb.setNullSelectionItemId("Null item");
        }
        cb.addItem("Value 1");
        cb.addItem("Value 2");
        cb.addItem("Value 3");

        cb.setId(id);

        return cb;
View Full Code Here

            cb.addItem("Null item");
            cb.setNullSelectionItemId("Null item");
        }
        cb.addItem("Value 1");
        cb.addItem("Value 2");
        cb.addItem("Value 3");

        cb.setId(id);

        return cb;
    }
View Full Code Here

    }

    private void addComboBox(AbstractLayout layout) {
        ComboBox box = new ComboBox();
        for (int i = 0; i < 100; i++) {
            box.addItem("item " + i);
        }
        box.setPageLength(10);
        box.setNullSelectionAllowed(false);
        layout.addComponent(box);
    }
View Full Code Here

        box.setNewItemHandler(new NewItemHandler() {
            @Override
            public void addNewItem(String newItemCaption) {
                String value = addedItems.getValue();
                addedItems.setValue(value + newItemCaption + "\n");
                box.addItem(newItemCaption);
            }
        });
        box.setImmediate(true);
        addComponent(box);
    }
View Full Code Here

        {
            ComboBox cb = new ComboBox();
            cb.addContainerProperty("icon", Resource.class, null);
            cb.setItemIconPropertyId("icon");

            Item item = cb.addItem("FI");
            item.getItemProperty("icon").setValue(
                    new ThemeResource("../tests-tickets/icons/fi.gif"));
            item = cb.addItem("SE");
            item.getItemProperty("icon").setValue(
                    new ThemeResource("../tests-tickets/icons/se.gif"));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.