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.9KB

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