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 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /*
  2. * Copyright 2011 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.terminal.gwt.client;
  17. import com.google.gwt.dom.client.Element;
  18. import com.google.gwt.user.client.ui.Widget;
  19. import com.vaadin.shared.ComponentState;
  20. /**
  21. * An interface used by client-side widgets or paintable parts to receive
  22. * updates from the corresponding server-side components in the form of
  23. * {@link UIDL}.
  24. *
  25. * Updates can be sent back to the server using the
  26. * {@link ApplicationConnection#updateVariable()} methods.
  27. */
  28. public interface ComponentConnector extends ServerConnector {
  29. /*
  30. * (non-Javadoc)
  31. *
  32. * @see com.vaadin.terminal.gwt.client.VPaintable#getState()
  33. */
  34. @Override
  35. public ComponentState getState();
  36. /**
  37. * Returns the widget for this {@link ComponentConnector}
  38. */
  39. public Widget getWidget();
  40. public LayoutManager getLayoutManager();
  41. /**
  42. * Returns <code>true</code> if the width of this paintable is currently
  43. * undefined. If the width is undefined, the actual width of the paintable
  44. * is defined by its contents.
  45. *
  46. * @return <code>true</code> if the width is undefined, else
  47. * <code>false</code>
  48. */
  49. public boolean isUndefinedWidth();
  50. /**
  51. * Returns <code>true</code> if the height of this paintable is currently
  52. * undefined. If the height is undefined, the actual height of the paintable
  53. * is defined by its contents.
  54. *
  55. * @return <code>true</code> if the height is undefined, else
  56. * <code>false</code>
  57. */
  58. public boolean isUndefinedHeight();
  59. /**
  60. * Returns <code>true</code> if the width of this paintable is currently
  61. * relative. If the width is relative, the actual width of the paintable is
  62. * a percentage of the size allocated to it by its parent.
  63. *
  64. * @return <code>true</code> if the width is undefined, else
  65. * <code>false</code>
  66. */
  67. public boolean isRelativeWidth();
  68. /**
  69. * Returns <code>true</code> if the height of this paintable is currently
  70. * relative. If the height is relative, the actual height of the paintable
  71. * is a percentage of the size allocated to it by its parent.
  72. *
  73. * @return <code>true</code> if the width is undefined, else
  74. * <code>false</code>
  75. */
  76. public boolean isRelativeHeight();
  77. /**
  78. * Checks if the connector is read only.
  79. *
  80. * @deprecated This belongs in AbstractFieldConnector, see #8514
  81. * @return true
  82. */
  83. @Deprecated
  84. public boolean isReadOnly();
  85. public boolean hasEventListener(String eventIdentifier);
  86. /**
  87. * Return true if parent handles caption, false if the paintable handles the
  88. * caption itself.
  89. *
  90. * <p>
  91. * This should always return true and all components should let the parent
  92. * handle the caption and use other attributes for internal texts in the
  93. * component
  94. * </p>
  95. *
  96. * @return true if caption handling is delegated to the parent, false if
  97. * parent should not be allowed to render caption
  98. */
  99. public boolean delegateCaptionHandling();
  100. /**
  101. * Sets the enabled state of the widget associated to this connector.
  102. *
  103. * @param widgetEnabled
  104. * true if the widget should be enabled, false otherwise
  105. */
  106. public void setWidgetEnabled(boolean widgetEnabled);
  107. /**
  108. * Gets the tooltip info for the given element.
  109. *
  110. * @param element
  111. * The element to lookup a tooltip for
  112. * @return The tooltip for the element or null if no tooltip is defined for
  113. * this element.
  114. */
  115. public TooltipInfo getTooltipInfo(Element element);
  116. }