Beispiel #1
0
 private void removeTextListener(final AbstractField<?> field) {
   if (!(field instanceof TextChangeNotifier)) {
     return;
   }
   for (final Object listener : field.getListeners(TextChangeEvent.class)) {
     if (listener instanceof ChangeListener) {
       ((TextChangeNotifier) field).removeTextChangeListener((ChangeListener) listener);
     }
   }
 }
  /** Removes all listeners from the bound fields and unbinds properties. */
  public void unbind() {
    // wrap in array list to avoid CME
    for (Field<?> field : new ArrayList<Field<?>>(getFields())) {
      field.removeValueChangeListener(this);
      if (field instanceof TextChangeNotifier) {
        final TextChangeNotifier abstractTextField = (TextChangeNotifier) field;
        abstractTextField.removeTextChangeListener(this);
      }

      unbind(field);
    }
    fieldsWithInitiallyDisabledValidation.clear();
  }