Examples of ComboBox


Examples of com.vaadin.ui.ComboBox

        return s;
    }

    private ComboBox createCalendarFormatSelect() {
        ComboBox s = new ComboBox("Calendar format");
        s.addContainerProperty("caption", String.class, "");
        s.setItemCaptionPropertyId("caption");

        Item i = s.addItem(DEFAULT_ITEMID);
        i.getItemProperty("caption").setValue("Default by locale");
        i = s.addItem(TimeFormat.Format12H);
        i.getItemProperty("caption").setValue("12H");
        i = s.addItem(TimeFormat.Format24H);
        i.getItemProperty("caption").setValue("24H");

        s.select(DEFAULT_ITEMID);
        s.setImmediate(true);
        s.addValueChangeListener(new ValueChangeListener() {

            private static final long serialVersionUID = 1L;

            @Override
            public void valueChange(ValueChangeEvent event) {
View Full Code Here

Examples of com.vaadin.ui.ComboBox

        TextField text2 = new TextField();
        text2.setCaption("Text2");
        text2.setRequired(true);

        ComboBox combo = new ComboBox();
        combo.setCaption("Combo1");

        CheckBox check = new CheckBox();
        check.setCaption("Check");

        grid.setColumns(2);
View Full Code Here

Examples of com.vaadin.ui.ComboBox

        l.addComponent(tf);

        DateField df = new DateField("DateField");
        l.addComponent(df);

        ComboBox cb = new ComboBox("ComboBox");
        l.addComponent(cb);

        Button btn = new Button("Button");
        l.addComponent(btn);

        NativeButton nbtn = new NativeButton("NativeButton");
        l.addComponent(nbtn);

        CheckBox chkb = new CheckBox("CheckBox");
        l.addComponent(chkb);

        OptionGroup og = createOptionGroup("OptionGroup");
        og.setMultiSelect(false);
        l.addComponent(og);

        final OptionGroup ogm = createOptionGroup("OptionGroup (multiselect)");
        ogm.setMultiSelect(true);
        l.addComponent(ogm);

        btn.addListener(new ClickListener() {

            private int i;

            @Override
            public void buttonClick(ClickEvent event) {
                ogm.addItem("newItem" + i++);

            }
        });

        tf.addListener(focusListener);
        tf.addListener(blurListener);
        df.addListener(focusListener);
        df.addListener(blurListener);
        cb.addListener(focusListener);
        cb.addListener(blurListener);
        btn.addListener(focusListener);
        btn.addListener(blurListener);
        nbtn.addListener(focusListener);
        nbtn.addListener(blurListener);
        chkb.addListener(focusListener);
View Full Code Here

Examples of com.vaadin.ui.ComboBox

        return s;
    }

    private ComboBox createLocaleSelect() {
        ComboBox s = new ComboBox("Locale");
        s.addContainerProperty("caption", String.class, "");
        s.setItemCaptionPropertyId("caption");
        s.setFilteringMode(FilteringMode.CONTAINS);

        for (Locale l : Locale.getAvailableLocales()) {
            if (!s.containsId(l)) {
                Item i = s.addItem(l);
                i.getItemProperty("caption").setValue(getLocaleItemCaption(l));
            }
        }

        s.select(getLocale());
        s.setImmediate(true);
        s.addValueChangeListener(new ValueChangeListener() {

            private static final long serialVersionUID = 1L;

            @Override
            public void valueChange(ValueChangeEvent event) {
View Full Code Here

Examples of com.vaadin.ui.ComboBox

    private void createUI(AbstractOrderedLayout layout) {

        VerticalLayout ol = new VerticalLayout();
        ol.setWidth(null);

        ComboBox cb = new ComboBox("Asiakas");
        cb.setWidth("100%");

        Button b = new Button("View CSV-tiedostoon");

        ol.addComponent(cb);
        ol.addComponent(b);
View Full Code Here

Examples of com.vaadin.ui.ComboBox

        addComponent(role);

        tf = new TextArea("Text", "Hello world");
        tf.setRows(10);
        addComponent(tf);
        type = new ComboBox();
        type.setNullSelectionAllowed(false);
        type.addContainerProperty(CAPTION, String.class, "");

        type.setItemCaptionPropertyId(CAPTION);
View Full Code Here

Examples of com.vaadin.ui.ComboBox

public class InsertComponentInHorizontalLayout extends AbstractTestUI {
    private VerticalLayout layout;
    int added = 1;

    private Component getTestLayout() {
        ComboBox a = new ComboBox("initial");
        Button b = new Button("x", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                layout.markAsDirty();
            }
        });
        final HorizontalLayout hl = new HorizontalLayout(a, b);
        hl.setSpacing(true);
        Button add = new Button(
                "Insert 2 comboboxes between combobox(es) and button 'x'");
        add.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                hl.addComponent(new ComboBox("Added " + added++), 1);
                hl.addComponent(new ComboBox("Added " + added++), 2);
            }
        });
        layout = new VerticalLayout(hl, add);
        return layout;
    }
View Full Code Here

Examples of com.vaadin.ui.ComboBox

                    tf.setCaption(DefaultFieldFactory
                            .createCaptionByPropertyId(propertyId));
                    tf.setWidth("3em");
                    c = tf;
                } else if ("city".equals(propertyId)) {
                    ComboBox cb = new ComboBox();
                    cb.setNullSelectionAllowed(false);
                    cb.addItem("Turku");
                    cb.addItem("New York");
                    cb.addItem("Moscow");
                    cb.setCaption(DefaultFieldFactory
                            .createCaptionByPropertyId(propertyId));
                    c = cb;
                    c.setWidth("200px");
                }
View Full Code Here

Examples of com.vaadin.ui.ComboBox

        Button button = new Button("Click Me");
        button.addClickListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                final FormLayout content = new FormLayout();
                ComboBox cb = new ComboBox();
                cb.addItem("foo");
                cb.addItem("bar");
                content.addComponent(cb);
                window.setContent(content);
                window.setCloseShortcut(KeyCode.ESCAPE);
                UI.getCurrent().addWindow(window);
            }
View Full Code Here

Examples of com.vaadin.ui.ComboBox

        return "Testcase for ComboBox. Test especially edge values(of page changes) when selecting items with keyboard only.";
    }

    @Override
    protected void setup() {
        ComboBox select = new ComboBox("");
        select.setImmediate(true);
        for (int i = 0; i < 100; i++) {
            select.addItem("item " + i);
        }

        final Label value = new Label();

        select.addListener(new ComboBox.ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                System.err
                        .println("Selected " + event.getProperty().getValue());
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.