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.

VariableOwner.java 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. @VaadinApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.terminal;
  5. import java.io.Serializable;
  6. import java.util.Map;
  7. /**
  8. * <p>
  9. * Listener interface for UI variable changes. The user communicates with the
  10. * application using the so-called <i>variables</i>. When the user makes a
  11. * change using the UI the terminal trasmits the changed variables to the
  12. * application, and the components owning those variables may then process those
  13. * changes.
  14. * </p>
  15. *
  16. * @author Vaadin Ltd.
  17. * @version
  18. * @VERSION@
  19. * @since 3.0
  20. */
  21. public interface VariableOwner extends Serializable {
  22. /**
  23. * Called when one or more variables handled by the implementing class are
  24. * changed.
  25. *
  26. * @param source
  27. * the Source of the variable change. This is the origin of the
  28. * event. For example in Web Adapter this is the request.
  29. * @param variables
  30. * the Mapping from variable names to new variable values.
  31. */
  32. public void changeVariables(Object source, Map<String, Object> variables);
  33. /**
  34. * <p>
  35. * Tests if the variable owner is enabled or not. The terminal should not
  36. * send any variable changes to disabled variable owners.
  37. * </p>
  38. *
  39. * @return <code>true</code> if the variable owner is enabled,
  40. * <code>false</code> if not
  41. */
  42. public boolean isEnabled();
  43. /**
  44. * <p>
  45. * Tests if the variable owner is in immediate mode or not. Being in
  46. * immediate mode means that all variable changes are required to be sent
  47. * back from the terminal immediately when they occur.
  48. * </p>
  49. *
  50. * <p>
  51. * <strong>Note:</strong> <code>VariableOwner</code> does not include a set-
  52. * method for the immediateness property. This is because not all
  53. * VariableOwners wish to offer the functionality. Such VariableOwners are
  54. * never in the immediate mode, thus they always return <code>false</code>
  55. * in {@link #isImmediate()}.
  56. * </p>
  57. *
  58. * @return <code>true</code> if the component is in immediate mode,
  59. * <code>false</code> if not.
  60. */
  61. public boolean isImmediate();
  62. /**
  63. * VariableOwner error event.
  64. */
  65. public interface ErrorEvent extends Terminal.ErrorEvent {
  66. /**
  67. * Gets the source VariableOwner.
  68. *
  69. * @return the variable owner.
  70. */
  71. public VariableOwner getVariableOwner();
  72. }
  73. }