@Override
  @SuppressWarnings({"unchecked"})
  public void setSelectedItem(Object anItem) {
    T i = (T) anItem;

    if (checker.isValueCorrect(i)) {
      selected = i;
      fireContentsChanged(this, -1, -1);
    }
  }
 @SuppressWarnings({"unchecked"})
 public ComboBoxEditorModel(IValueChecker<T> checker, T selected) {
   this.checker = checker;
   if (selected != null && checker.isValueCorrect(selected)) {
     this.selected = selected;
   } else {
     // Automatically select the first component
     this.selected = getElementAt(0);
   }
 }