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.

Connector.java 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. @VaadinApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.terminal.gwt.client;
  5. import com.vaadin.terminal.gwt.client.communication.SharedState;
  6. /**
  7. * Interface implemented by all client side classes that can be communicate with
  8. * the server. Classes implementing this interface are initialized by the
  9. * framework when needed and have the ability to communicate with the server.
  10. *
  11. * @author Vaadin Ltd
  12. * @version @VERSION@
  13. * @since 7.0.0
  14. */
  15. public interface Connector {
  16. /**
  17. * TODO
  18. *
  19. * @param uidl
  20. * @param client
  21. */
  22. public void updateFromUIDL(UIDL uidl, ApplicationConnection client);
  23. /**
  24. * Gets the current shared state of the connector.
  25. *
  26. * @return state
  27. */
  28. public SharedState getState();
  29. /**
  30. * Sets a new state for the connector.
  31. *
  32. * @param state
  33. * The new state
  34. *
  35. */
  36. public void setState(SharedState state);
  37. /**
  38. * Returns the id for this connector. This must always be what has been set
  39. * using {@link #setId(String)}.
  40. *
  41. * @return The id for the connector.
  42. */
  43. public String getId();
  44. /**
  45. * Sets the id for the connector. This method is called once by the
  46. * framework when the connector is initialized and should never be called
  47. * otherwise.
  48. * <p>
  49. * The connector id is used to map the server and the client side together.
  50. * It is unique in this Root and assigned by the framework.
  51. * </p>
  52. *
  53. * @param id
  54. * The id of the connector.
  55. */
  56. public void setId(String id);
  57. /**
  58. * Gets ApplicationConnection instance that created this connector.
  59. *
  60. * @return The ApplicationConnection as set by
  61. * {@link #setConnection(ApplicationConnection)}
  62. */
  63. public ApplicationConnection getConnection();
  64. /**
  65. * Sets the reference to ApplicationConnection. This method is called by the
  66. * framework when the connector is created and should never be called
  67. * otherwise.
  68. *
  69. * @param connection
  70. * The ApplicationConnection that created this connector
  71. */
  72. public void setConnection(ApplicationConnection connection);
  73. /**
  74. * Tests whether the component is enabled or not. A user can not interact
  75. * with disabled components. Disabled components are rendered in a style
  76. * that indicates the status, usually in gray color. Children of a disabled
  77. * component are also disabled.
  78. *
  79. * @return true if the component is enabled, false otherwise
  80. */
  81. // public boolean isEnabled();
  82. /**
  83. *
  84. * Called once when the connection and id has been set.
  85. *
  86. * Note that the shared state is not yet available during init().
  87. */
  88. public void init();
  89. }