Example usage for com.vaadin.v7.ui AbstractSelect removeAllItems

List of usage examples for com.vaadin.v7.ui AbstractSelect removeAllItems

Introduction

In this page you can find the example usage for com.vaadin.v7.ui AbstractSelect removeAllItems.

Prototype

@Override
public boolean removeAllItems() throws UnsupportedOperationException 

Source Link

Document

Removes all items from the container.

Usage

From source file:de.symeda.sormas.ui.utils.FieldHelper.java

License:Open Source License

public static void updateItems(AbstractSelect select, List<?> items) {
    Object value = select.getValue();
    boolean readOnly = select.isReadOnly();
    select.setReadOnly(false);/*from   w w  w.  ja  va 2s  .  c o  m*/
    select.removeAllItems();
    if (items != null) {
        select.addItems(items);
    }
    select.setValue(value);
    select.setReadOnly(readOnly);
}

From source file:de.symeda.sormas.ui.utils.FieldHelper.java

License:Open Source License

public static void removeItems(AbstractSelect select) {
    boolean readOnly = select.isReadOnly();
    select.setReadOnly(false);/*from   w ww .  j a v  a  2  s .c  o  m*/
    select.removeAllItems();
    select.setReadOnly(readOnly);
}