Skip to content

Commit

Permalink
Added support for deregistering validator for control
Browse files Browse the repository at this point in the history
Fixes controlsfx#1447
Signed-off-by: Amit Kumar Mondal <admin@amitinside.com>
  • Loading branch information
amitjoy committed May 7, 2024
1 parent f6f990b commit c84eba7
Showing 1 changed file with 15 additions and 0 deletions.
Expand Up @@ -327,6 +327,21 @@ public void onChanged(
public <T> boolean registerValidator( final Control c, final Validator<T> validator ) {
return registerValidator(c, true, validator);
}

/**
* Deregisters any registered {@link Validator} for specified control
* @param c control whose validator will be removed
* @return {@code true} if deregistration is successful, otherwisee {@code false}
* @throws NullPointerException if the specified control is {@code null}
*/
public boolean deregisterValidator(final Control c) {
if (controls.contains(c)) {
controls.remove(c);
validationResults.remove(c);
return true;
}
return false;
}

/**
* Returns currently registered controls
Expand Down

0 comments on commit c84eba7

Please sign in to comment.