Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for deregistering validator for control #1448

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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