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.

HasValueChangeMode.java 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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.ui;
  17. import com.vaadin.data.HasValue.ValueChangeEvent;
  18. import com.vaadin.shared.ui.ValueChangeMode;
  19. /**
  20. * Implemented by components which support value change modes.
  21. *
  22. * @since 8.0
  23. */
  24. public interface HasValueChangeMode extends Component {
  25. /**
  26. * Sets the mode how the TextField triggers {@link ValueChangeEvent}s.
  27. *
  28. * @param valueChangeMode
  29. * the new mode
  30. *
  31. * @see ValueChangeMode
  32. */
  33. public void setValueChangeMode(ValueChangeMode valueChangeMode);
  34. /**
  35. * Returns the currently set {@link ValueChangeMode}.
  36. *
  37. * @return the mode used to trigger {@link ValueChangeEvent}s.
  38. *
  39. * @see ValueChangeMode
  40. */
  41. public ValueChangeMode getValueChangeMode();
  42. /**
  43. * Sets how often {@link ValueChangeEvent}s are triggered when the
  44. * {@link ValueChangeMode} is set to either {@link ValueChangeMode#LAZY} or
  45. * {@link ValueChangeMode#TIMEOUT}.
  46. *
  47. * @param valueChangeTimeout
  48. * timeout in milliseconds, must be greater or equal to 0
  49. * @throws IllegalArgumentException
  50. * if given timeout is smaller than 0
  51. *
  52. * @see ValueChangeMode
  53. */
  54. public void setValueChangeTimeout(int valueChangeTimeout);
  55. /**
  56. * Returns the currently set timeout, in milliseconds, for how often
  57. * {@link ValueChangeEvent}s are triggered if the current
  58. * {@link ValueChangeMode} is set to either {@link ValueChangeMode#LAZY} or
  59. * {@link ValueChangeMode#TIMEOUT}.
  60. *
  61. * @return the timeout in milliseconds of how often
  62. * {@link ValueChangeEvent}s are triggered.
  63. */
  64. public int getValueChangeTimeout();
  65. }