Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

AbstractConnector.java 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package com.vaadin.terminal.gwt.client.ui;
  2. import com.vaadin.terminal.gwt.client.ApplicationConnection;
  3. import com.vaadin.terminal.gwt.client.Connector;
  4. public abstract class AbstractConnector implements Connector {
  5. private ApplicationConnection connection;
  6. private String id;
  7. /*
  8. * (non-Javadoc)
  9. *
  10. * @see com.vaadin.terminal.gwt.client.VPaintable#getConnection()
  11. */
  12. public final ApplicationConnection getConnection() {
  13. return connection;
  14. }
  15. private final void setConnection(ApplicationConnection connection) {
  16. this.connection = connection;
  17. }
  18. /*
  19. * (non-Javadoc)
  20. *
  21. * @see com.vaadin.terminal.gwt.client.Connector#getId()
  22. */
  23. public String getId() {
  24. return id;
  25. }
  26. private void setId(String id) {
  27. this.id = id;
  28. }
  29. /**
  30. *
  31. * Called once by the framework to initialize the connector.
  32. *
  33. * Custom widgets should not override this method, override init instead;
  34. *
  35. * Note that the shared state is not yet available at this point.
  36. */
  37. public final void doInit(String connectorId,
  38. ApplicationConnection connection) {
  39. setConnection(connection);
  40. setId(connectorId);
  41. init();
  42. }
  43. /**
  44. * Called when the connector has been initialized. Override this method to
  45. * perform initialization of the connector.
  46. */
  47. // FIXME: It might make sense to make this abstract to force users to use
  48. // init instead of constructor, where connection and id has not yet been
  49. // set.
  50. protected void init() {
  51. }
  52. }