private void recreateChosen() {
   if (chosen != null) chosenPlace.clear();
   chosen = new ChosenListBox(false);
   chosenPlace.add(chosen);
   chosen.addChosenChangeHandler(getNewHandler());
   chosen.setEnabled(enabled);
   if (dataProvider.isDataGroupable()) updateChosenMap(dataProvider.getLastLoadedFilteredMap());
   else updateChosenList(dataProvider.getLastLoadedFilteredList());
   updateSelection(dataProvider.getSelectedIndex());
 }
 public void update() {
   if (dataProvider.isAsync())
     dataProvider.requestData(
         new Runnable() {
           @Override
           public void run() {
             recreateChosen();
           }
         });
   else recreateChosen();
 }
 public void updateSelectedItem() {
   updateSelection(dataProvider.getSelectedIndex());
   chosen.update();
 }
 public void setSelectedItem(T item) {
   dataProvider.setSelectedItem(item);
   updateSelectedItem();
 }
 public SingleSelectList(SingleSelectListPanelDataProvider<T> dataProvider, T initialValue) {
   initWidget(uiBinder.createAndBindUi(this));
   this.dataProvider = dataProvider;
   dataProvider.setSelectedItem(initialValue);
   update();
 }
 public T getValue() {
   return dataProvider.getValue();
 }