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

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