com.vaadin.client
Class VCaption

java.lang.Object
  extended by HTML
      extended by com.vaadin.client.VCaption
Direct Known Subclasses:
VTabsheet.TabCaption

public class VCaption
extends HTML


Field Summary
static java.lang.String CLASSNAME
           
 
Constructor Summary
VCaption(ApplicationConnection client)
          Deprecated. all captions should be associated with a paintable widget and be updated from shared state, not UIDL
VCaption(ComponentConnector component, ApplicationConnection client)
          Creates a caption for a ComponentConnector.
 
Method Summary
static java.lang.String getCaptionOwnerPid(Element e)
           
 int getHeight()
           
 ComponentConnector getOwner()
          Returns Paintable for which this Caption belongs to.
static java.lang.String getOwnerPid(Element el)
           
 int getRenderedWidth()
           
 int getRequiredWidth()
           
protected  com.google.gwt.user.client.Element getTextElement()
           
 TooltipInfo getTooltipInfo()
          Returns the tooltip that should be shown for the caption
 boolean isCaptionAsHtml()
          Checks whether captions are rendered as HTML.
static boolean isNeeded(com.vaadin.shared.AbstractComponentState state)
           
static boolean mightChange(StateChangeEvent event)
          Checks whether anything in a given state change might cause the caption to change.
protected  void onAttach()
           
 void onBrowserEvent(Event event)
           
protected  void onDetach()
           
 void setAlignment(java.lang.String alignment)
           
 void setCaptionAsHtml(boolean captionAsHtml)
          Sets whether the caption is rendered as HTML.
static void setCaptionText(Element captionElement, com.vaadin.shared.AbstractComponentState state)
          Sets the text of the given caption element to the caption found in the state.
static void setCaptionText(HasHTML widget, com.vaadin.shared.AbstractComponentState state)
          Sets the text of the given widget to the caption found in the state.
 void setMaxWidth(int maxWidth)
           
 void setTooltipInfo(TooltipInfo tooltipInfo)
          Sets the tooltip that should be shown for the caption
 boolean shouldBePlacedAfterComponent()
           
 boolean updateCaption()
          Updates the caption from UIDL.
 boolean updateCaptionWithoutOwner(java.lang.String caption, boolean disabled, boolean hasDescription, boolean hasError, java.lang.String iconURL)
          Deprecated. 
 boolean updateCaptionWithoutOwner(java.lang.String caption, boolean disabled, boolean hasDescription, boolean hasError, java.lang.String iconURL, java.lang.String iconAltText)
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASSNAME

public static final java.lang.String CLASSNAME
See Also:
Constant Field Values
Constructor Detail

VCaption

@Deprecated
public VCaption(ApplicationConnection client)
Deprecated. all captions should be associated with a paintable widget and be updated from shared state, not UIDL

Creates a caption that is not linked to a ComponentConnector. When using this constructor, getOwner() returns null.

Parameters:
client - ApplicationConnection

VCaption

public VCaption(ComponentConnector component,
                ApplicationConnection client)
Creates a caption for a ComponentConnector.

Parameters:
component - owner of caption, not null
client - ApplicationConnection
Method Detail

onAttach

protected void onAttach()

onDetach

protected void onDetach()

updateCaption

public boolean updateCaption()
Updates the caption from UIDL. This method may only be called when the caption has an owner - otherwise, use #updateCaptionWithoutOwner(UIDL, String, boolean, boolean).

Returns:
true if the position where the caption should be placed has changed

updateCaptionWithoutOwner

@Deprecated
public boolean updateCaptionWithoutOwner(java.lang.String caption,
                                                    boolean disabled,
                                                    boolean hasDescription,
                                                    boolean hasError,
                                                    java.lang.String iconURL)
Deprecated. 


updateCaptionWithoutOwner

@Deprecated
public boolean updateCaptionWithoutOwner(java.lang.String caption,
                                                    boolean disabled,
                                                    boolean hasDescription,
                                                    boolean hasError,
                                                    java.lang.String iconURL,
                                                    java.lang.String iconAltText)
Deprecated. 


onBrowserEvent

public void onBrowserEvent(Event event)

isNeeded

public static boolean isNeeded(com.vaadin.shared.AbstractComponentState state)

mightChange

public static boolean mightChange(StateChangeEvent event)
Checks whether anything in a given state change might cause the caption to change.

Parameters:
event - the state change event to check
Returns:
true if the caption might have changed; otherwise false

getOwner

public ComponentConnector getOwner()
Returns Paintable for which this Caption belongs to.

Returns:
owner Widget

shouldBePlacedAfterComponent

public boolean shouldBePlacedAfterComponent()

getRenderedWidth

public int getRenderedWidth()

getRequiredWidth

public int getRequiredWidth()

getHeight

public int getHeight()

setAlignment

public void setAlignment(java.lang.String alignment)

setMaxWidth

public void setMaxWidth(int maxWidth)

setTooltipInfo

public void setTooltipInfo(TooltipInfo tooltipInfo)
Sets the tooltip that should be shown for the caption

Parameters:
tooltipInfo - The tooltip that should be shown or null if no tooltip should be shown

getTooltipInfo

public TooltipInfo getTooltipInfo()
Returns the tooltip that should be shown for the caption

Returns:
The tooltip to show or null if no tooltip should be shown

getTextElement

protected com.google.gwt.user.client.Element getTextElement()

getCaptionOwnerPid

public static java.lang.String getCaptionOwnerPid(Element e)

getOwnerPid

public static java.lang.String getOwnerPid(Element el)

setCaptionAsHtml

public void setCaptionAsHtml(boolean captionAsHtml)
Sets whether the caption is rendered as HTML.

Default is false

Parameters:
captionAsHtml - true if the captions are rendered as HTML, false if rendered as plain text

isCaptionAsHtml

public boolean isCaptionAsHtml()
Checks whether captions are rendered as HTML.

Default is false

Returns:
true if the captions are rendered as HTML, false if rendered as plain text

setCaptionText

public static void setCaptionText(Element captionElement,
                                  com.vaadin.shared.AbstractComponentState state)
Sets the text of the given caption element to the caption found in the state.

Uses AbstractComponentState.captionAsHtml to determine whether to set the caption as html or plain text

Parameters:
captionElement - the target element
state - the state from which to read the caption text and mode
Since:
7.4

setCaptionText

public static void setCaptionText(HasHTML widget,
                                  com.vaadin.shared.AbstractComponentState state)
Sets the text of the given widget to the caption found in the state.

Uses AbstractComponentState.captionAsHtml to determine whether to set the caption as html or plain text

Parameters:
widget - the target widget
state - the state from which to read the caption text and mode
Since:
7.4


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.