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.

ComponentConnector.java 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. @VaadinApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.terminal.gwt.client;
  5. import com.google.gwt.user.client.ui.Widget;
  6. /**
  7. * An interface used by client-side widgets or paintable parts to receive
  8. * updates from the corresponding server-side components in the form of
  9. * {@link UIDL}.
  10. *
  11. * Updates can be sent back to the server using the
  12. * {@link ApplicationConnection#updateVariable()} methods.
  13. */
  14. public interface ComponentConnector extends ServerConnector {
  15. /*
  16. * (non-Javadoc)
  17. *
  18. * @see com.vaadin.terminal.gwt.client.VPaintable#getState()
  19. */
  20. public ComponentState getState();
  21. /**
  22. * Returns the widget for this {@link ComponentConnector}
  23. */
  24. public Widget getWidget();
  25. public LayoutManager getLayoutManager();
  26. /**
  27. * Returns <code>true</code> if the width of this paintable is currently
  28. * undefined. If the width is undefined, the actual width of the paintable
  29. * is defined by its contents.
  30. *
  31. * @return <code>true</code> if the width is undefined, else
  32. * <code>false</code>
  33. */
  34. public boolean isUndefinedWidth();
  35. /**
  36. * Returns <code>true</code> if the height of this paintable is currently
  37. * undefined. If the height is undefined, the actual height of the paintable
  38. * is defined by its contents.
  39. *
  40. * @return <code>true</code> if the height is undefined, else
  41. * <code>false</code>
  42. */
  43. public boolean isUndefinedHeight();
  44. /**
  45. * Returns <code>true</code> if the width of this paintable is currently
  46. * relative. If the width is relative, the actual width of the paintable is
  47. * a percentage of the size allocated to it by its parent.
  48. *
  49. * @return <code>true</code> if the width is undefined, else
  50. * <code>false</code>
  51. */
  52. public boolean isRelativeWidth();
  53. /**
  54. * Returns <code>true</code> if the height of this paintable is currently
  55. * relative. If the height is relative, the actual height of the paintable
  56. * is a percentage of the size allocated to it by its parent.
  57. *
  58. * @return <code>true</code> if the width is undefined, else
  59. * <code>false</code>
  60. */
  61. public boolean isRelativeHeight();
  62. /**
  63. * Returns the parent of this connector. Can be null for only the root
  64. * connector.
  65. *
  66. * @return The parent of this connector, as set by
  67. * {@link #setParent(ComponentContainerConnector)}.
  68. */
  69. public ComponentContainerConnector getParent();
  70. /**
  71. * Sets the parent for this connector. This method should only be called by
  72. * the framework to ensure that the connector hierarchy on the client side
  73. * and the server side are in sync.
  74. * <p>
  75. * Note that calling this method does not fire a
  76. * {@link ConnectorHierarchyChangeEvent}. The event is fired only when the
  77. * whole hierarchy has been updated.
  78. *
  79. * @param parent
  80. * The new parent of the connector
  81. */
  82. public void setParent(ComponentContainerConnector parent);
  83. /**
  84. * Checks if the connector is read only.
  85. *
  86. * @deprecated This belongs in AbstractFieldConnector, see #8514
  87. * @return true
  88. */
  89. @Deprecated
  90. public boolean isReadOnly();
  91. public boolean hasEventListener(String eventIdentifier);
  92. /**
  93. * Return true if parent handles caption, false if the paintable handles the
  94. * caption itself.
  95. *
  96. * <p>
  97. * This should always return true and all components should let the parent
  98. * handle the caption and use other attributes for internal texts in the
  99. * component
  100. * </p>
  101. *
  102. * @return true if caption handling is delegated to the parent, false if
  103. * parent should not be allowed to render caption
  104. */
  105. public boolean delegateCaptionHandling();
  106. }