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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright 2000-2016 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. public interface HasValueChangeMode extends Component {
  23. /**
  24. * Sets the mode how the TextField triggers {@link ValueChangeEvent}s.
  25. *
  26. * @param valueChangeMode
  27. * the new mode
  28. *
  29. * @see ValueChangeMode
  30. */
  31. public void setValueChangeMode(ValueChangeMode valueChangeMode);
  32. /**
  33. * Returns the currently set {@link ValueChangeMode}.
  34. *
  35. * @return the mode used to trigger {@link ValueChangeEvent}s.
  36. *
  37. * @see ValueChangeMode
  38. */
  39. public ValueChangeMode getValueChangeMode();
  40. /**
  41. * Sets how often {@link ValueChangeEvent}s are triggered when the
  42. * {@link ValueChangeMode} is set to either {@link ValueChangeMode#LAZY} or
  43. * {@link ValueChangeMode#TIMEOUT}.
  44. *
  45. * @param valueChangeTimeout
  46. * timeout in milliseconds, must be greater or equal to 0
  47. * @throws IllegalArgumentException
  48. * if given timeout is smaller than 0
  49. *
  50. * @see ValueChangeMode
  51. */
  52. public void setValueChangeTimeout(int valueChangeTimeout);
  53. /**
  54. * Returns the currently set timeout, in milliseconds, for how often
  55. * {@link ValueChangeEvent}s are triggered if the current
  56. * {@link ValueChangeMode} is set to either {@link ValueChangeMode#LAZY} or
  57. * {@link ValueChangeMode#TIMEOUT}.
  58. *
  59. * @return the timeout in milliseconds of how often
  60. * {@link ValueChangeEvent}s are triggered.
  61. */
  62. public int getValueChangeTimeout();
  63. }