You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BinderValidationStatusHandler.java 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright 2000-2018 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.data;
  17. import com.vaadin.event.SerializableEventListener;
  18. /**
  19. * Handler for {@link BinderValidationStatus} changes.
  20. * <p>
  21. * {@link Binder#setValidationStatusHandler(BinderValidationStatusHandler)
  22. * Register} an instance of this class to be able to customize validation status
  23. * handling.
  24. * <p>
  25. * The default handler will show
  26. * {@link com.vaadin.ui.AbstractComponent#setComponentError(com.vaadin.server.ErrorMessage)
  27. * an error message} for failed field validations. For bean level validation
  28. * errors it will display the first error message in
  29. * {@link Binder#setStatusLabel(com.vaadin.ui.Label) status label}, if one has
  30. * been set.
  31. *
  32. * @author Vaadin Ltd
  33. *
  34. * @see BinderValidationStatus
  35. * @see Binder#validate()
  36. * @see BindingValidationStatus
  37. *
  38. * @param <BEAN>
  39. * the bean type of binder
  40. *
  41. * @since 8.0
  42. */
  43. @FunctionalInterface
  44. public interface BinderValidationStatusHandler<BEAN>
  45. extends SerializableEventListener {
  46. /**
  47. * Invoked when the validation status has changed in binder.
  48. *
  49. * @param statusChange
  50. * the changed status
  51. */
  52. void statusChange(BinderValidationStatus<BEAN> statusChange);
  53. }