Package com.vaadin.ui

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


        lss.addItem("Bar");
        lss.setTabIndex(index++);

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

        OptionGroup og = new OptionGroup("7");
        og.addItem("foo");
        og.addItem("bar");
View Full Code Here


            }
        });

        NativeSelect nativeSelect = new NativeSelect("NativeSelect");
        form.addField("Native Select", nativeSelect);
        nativeSelect.addItem("Value 1");

        // in #4103, the Select component was behaving differently from others
        form.addField("Select", new Select("Select"));

        Select select2 = new Select("Select 2");
View Full Code Here

            }
        });

        for (String itemCaption : options.keySet()) {
            Object itemId = new Object();
            Item i = select.addItem(itemId);
            i.getItemProperty(CAPTION).setValue(itemCaption);
            i.getItemProperty(VALUE).setValue(options.get(itemCaption));
            if (itemCaption.equals(initialValue)) {
                select.setValue(itemId);
            }
View Full Code Here

            vAlign.setItemCaption(new Integer(Bits.ALIGNMENT_VERTICAL_CENTER),
                    "center");
            vAlign.addItem(new Integer(Bits.ALIGNMENT_BOTTOM));
            vAlign.setItemCaption(new Integer(Bits.ALIGNMENT_BOTTOM), "bottom");

            hAlign.addItem(new Integer(Bits.ALIGNMENT_LEFT));
            hAlign.setItemCaption(new Integer(Bits.ALIGNMENT_LEFT), "left");
            hAlign.addItem(new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER));
            hAlign.setItemCaption(
                    new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER), "center");
            hAlign.addItem(new Integer(Bits.ALIGNMENT_RIGHT));
View Full Code Here

            vAlign.addItem(new Integer(Bits.ALIGNMENT_BOTTOM));
            vAlign.setItemCaption(new Integer(Bits.ALIGNMENT_BOTTOM), "bottom");

            hAlign.addItem(new Integer(Bits.ALIGNMENT_LEFT));
            hAlign.setItemCaption(new Integer(Bits.ALIGNMENT_LEFT), "left");
            hAlign.addItem(new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER));
            hAlign.setItemCaption(
                    new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER), "center");
            hAlign.addItem(new Integer(Bits.ALIGNMENT_RIGHT));
            hAlign.setItemCaption(new Integer(Bits.ALIGNMENT_RIGHT), "right");
View Full Code Here

            hAlign.addItem(new Integer(Bits.ALIGNMENT_LEFT));
            hAlign.setItemCaption(new Integer(Bits.ALIGNMENT_LEFT), "left");
            hAlign.addItem(new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER));
            hAlign.setItemCaption(
                    new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER), "center");
            hAlign.addItem(new Integer(Bits.ALIGNMENT_RIGHT));
            hAlign.setItemCaption(new Integer(Bits.ALIGNMENT_RIGHT), "right");

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

            controls.addComponent(new Label("layout alignment"));
            final NativeSelect lAlign = new NativeSelect();
            controls.addComponent(lAlign);
            lAlign.setNullSelectionAllowed(false);
            lAlign.addItem(new Integer(Bits.ALIGNMENT_LEFT));
            lAlign.setItemCaption(new Integer(Bits.ALIGNMENT_LEFT), "left");
            lAlign.addItem(new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER));
            lAlign.setItemCaption(
                    new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER), "center");
            lAlign.addItem(new Integer(Bits.ALIGNMENT_RIGHT));
View Full Code Here

            final NativeSelect lAlign = new NativeSelect();
            controls.addComponent(lAlign);
            lAlign.setNullSelectionAllowed(false);
            lAlign.addItem(new Integer(Bits.ALIGNMENT_LEFT));
            lAlign.setItemCaption(new Integer(Bits.ALIGNMENT_LEFT), "left");
            lAlign.addItem(new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER));
            lAlign.setItemCaption(
                    new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER), "center");
            lAlign.addItem(new Integer(Bits.ALIGNMENT_RIGHT));
            lAlign.setItemCaption(new Integer(Bits.ALIGNMENT_RIGHT), "right");
View Full Code Here

            lAlign.addItem(new Integer(Bits.ALIGNMENT_LEFT));
            lAlign.setItemCaption(new Integer(Bits.ALIGNMENT_LEFT), "left");
            lAlign.addItem(new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER));
            lAlign.setItemCaption(
                    new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER), "center");
            lAlign.addItem(new Integer(Bits.ALIGNMENT_RIGHT));
            lAlign.setItemCaption(new Integer(Bits.ALIGNMENT_RIGHT), "right");

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

                "Pop", "Alternative", "Blues", "Jazz", "Hip Hop",
                "Electronica", "Punk", "Hard Rock", "Dance", "R'n'B", "Gospel",
                "Country" };
        for (int i = 0; i < 1000; i++) {
            NativeSelect s = new NativeSelect();
            s.addItem("1 star");
            s.addItem("2 stars");
            s.addItem("3 stars");
            s.addItem("4 stars");
            s.addItem("5 stars");
            s.select(i % 5 + " stars");
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.