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

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