Пример #1
0
 private void columnsChanged(final ItemListener listener) {
   final String currentID = ((Column) this.comboColonnePourRecherche.getSelectedItem()).getID();
   fillColumnCombo(listener);
   final ListComboBoxModel comboModel =
       (ListComboBoxModel) this.comboColonnePourRecherche.getModel();
   // no selection since the model was just emptied
   assert this.comboColonnePourRecherche.getSelectedIndex() == -1
       && this.comboColonnePourRecherche.getSelectedItem() == null;
   // try to reselect the same column if it's still there
   for (final Object o : comboModel.getList()) {
     final Column col = (Column) o;
     if (CompareUtils.equals(col.getID(), currentID))
       this.comboColonnePourRecherche.setSelectedItem(o);
   }
   if (comboModel.getSelectedItem() == null) selectAllColumnsItem();
 }