Package com.vaadin.tests.components.select

Source Code of com.vaadin.tests.components.select.FocusListenerBreaksDropdownMenu

package com.vaadin.tests.components.select;

import com.vaadin.event.FieldEvents;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.ComboBox;

public class FocusListenerBreaksDropdownMenu extends TestBase {

    @Override
    protected void setup() {
        final ComboBox comboBox = new ComboBox();
        for (int i = 0; i < 5; ++i) {
            comboBox.addItem("Item " + i);
        }

        comboBox.addListener(new FieldEvents.FocusListener() {
            @Override
            public void focus(FieldEvents.FocusEvent event) {
                comboBox.addItem();
            }
        });

        comboBox.setImmediate(true);
        addComponent(comboBox);
    }

    @Override
    protected String getDescription() {
        return "Clicking the dropdown arrow on a not-already-focused ComboBox "
                + "breaks the dropdown list if a FocusListener adds or removes items";
    }

    @Override
    protected Integer getTicketNumber() {
        return 8321;
    }

}
TOP

Related Classes of com.vaadin.tests.components.select.FocusListenerBreaksDropdownMenu

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.