Package com.vaadin.ui

Examples of com.vaadin.ui.ListSelect


    protected AbstractSelect createCompatibleSelect(
            Class<? extends AbstractSelect> fieldType) {
        AbstractSelect select;
        if (fieldType.isAssignableFrom(ListSelect.class)) {
            select = new ListSelect();
            select.setMultiSelect(false);
        } else if (fieldType.isAssignableFrom(NativeSelect.class)) {
            select = new NativeSelect();
        } else if (fieldType.isAssignableFrom(OptionGroup.class)) {
            select = new OptionGroup();
View Full Code Here


        addComponent(row);

        NativeSelect select = new NativeSelect("Drop Down Select");
        row.addComponent(select);

        ListSelect list = new ListSelect("List Select");
        list.setNewItemsAllowed(true);
        row.addComponent(list);

        TwinColSelect tcs = new TwinColSelect("TwinCol Select");
        tcs.setLeftColumnCaption("Left Column");
        tcs.setRightColumnCaption("Right Column");
        tcs.setNewItemsAllowed(true);
        row.addComponent(tcs);

        TwinColSelect tcs2 = new TwinColSelect("Sized TwinCol Select");
        tcs2.setLeftColumnCaption("Left Column");
        tcs2.setRightColumnCaption("Right Column");
        tcs2.setNewItemsAllowed(true);
        tcs2.setWidth("280px");
        tcs2.setHeight("200px");
        row.addComponent(tcs2);

        for (int i = 1; i <= 10; i++) {
            select.addItem("Option " + i);
            list.addItem("Option " + i);
            tcs.addItem("Option " + i);
            tcs2.addItem("Option " + i);
        }
    }
View Full Code Here

        }

        private Map<Object, ListSelect> workoutIdToList = new HashMap<Object, ListSelect>();

        private Field<?> getSecondaryTypesList(Object itemId) {
            ListSelect list = workoutIdToList.get(itemId);
            if (list == null) {
                list = new ListSelect();
                list.setMultiSelect(true);
                list.addItem("Item1");
                list.addItem("Item2");
                list.addItem("Item3");
                list.addItem("Item4");
                list.addItem("Item5");
                // list.setContainerDataSource(trainingTypes);
                list.setRows(4);
                workoutIdToList.put(itemId, list);
            }
            return list;
        }
View Full Code Here

        GridLayout gl = new GridLayout();
        gl.setHeight(null);
        gl.setWidth(100, Unit.PERCENTAGE);
        windowLayout.addComponent(gl);

        ListSelect listSelect = new ListSelect();
        listSelect.setWidth(100, Unit.PERCENTAGE);
        gl.addComponent(listSelect);
        gl.setMargin(true);

        final Button testButton = new Button("Open Window",
                new Button.ClickListener() {
View Full Code Here

public class ListSelectAllowNewItem extends TestBase {

    @Override
    protected void setup() {
        ListSelect select = new ListSelect("Select", Arrays.asList("Option 1",
                "Option 2"));
        select.setImmediate(true);
        select.setNewItemsAllowed(true);
        addComponent(select);
    }
View Full Code Here

public class ListSelectPrimaryStylename extends TestBase {

    @Override
    protected void setup() {
        final ListSelect list = new ListSelect("Caption", Arrays.asList(
                "Option 1", "Option 2", "Option 3"));
        list.setPrimaryStyleName("my-list");
        addComponent(list);

        addComponent(new Button("Change primary stylename",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        list.setPrimaryStyleName("my-second-list");
                    }
                }));

    }
View Full Code Here

                ContentMode.HTML));
        ArrayList<String> list = new ArrayList<String>();
        for (int i = 1; i <= 25; i++) {
            list.add("Option #" + i);
        }
        ListSelect listSelect = new ListSelect(null, list);
        listSelect.setNullSelectionAllowed(false);
        listSelect.setMultiSelect(true);
        listSelect.setImmediate(false);
        listSelect.setRows(5);
        listSelect.setItemCaptionMode(AbstractSelect.ItemCaptionMode.ID);
        listSelect.setId("listselect");
        addComponent(listSelect);
        Button button = new Button("Press Me");
        button.setId("button");
        addComponent(button);
    }
View Full Code Here

        addComponent(cbs);

        layout = new HorizontalLayout();
        layout.setSpacing(true);
        layout.addComponent(createSelect(
                new ListSelect("List Select, enabled"), true));
        layout.addComponent(createSelect(
                new ListSelect("List Select, disabled"), false));

        layout.addComponent(createSelect(new NativeSelect(
                "Native Select, enabled"), true));
        layout.addComponent(createSelect(new NativeSelect(
                "Native Select, disabled"), false));
View Full Code Here

        DateField f3 = new DateField("3");
        f3.setTabIndex(index++);
        ComboBox cb = new ComboBox("4");
        cb.setTabIndex(index++);

        ListSelect lss = new ListSelect("5");
        lss.addItem("foo");
        lss.addItem("Bar");
        lss.setTabIndex(index++);

        NativeSelect ns = new NativeSelect("6");
        ns.addItem("foo");
        ns.addItem("bar");
        ns.setTabIndex(index++);
View Full Code Here

        pl = createPanelLayout();
        p = new Panel("ListBox", pl);
        p.setStyleName(Reindeer.PANEL_LIGHT);
        h.addComponent(p);
        ListSelect l = new ListSelect("ITEM_CAPTION_MODE_PROPERTY");
        l.setContainerDataSource(cont);
        l.setItemCaptionPropertyId("Asd");
        l.setItemCaptionMode(ComboBox.ITEM_CAPTION_MODE_PROPERTY);
        pl.addComponent(l);
        l = new ListSelect("ITEM_CAPTION_MODE_ITEM");
        l.setContainerDataSource(cont);
        l.setItemCaptionMode(ComboBox.ITEM_CAPTION_MODE_ITEM);
        pl.addComponent(l);
    }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.ListSelect

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.