Label component for showing non-editable short texts. The label content can be set to the modes specified by the final members CONTENT_*
The contents of the label may contain simple formatting:
<b> Bold
<i> Italic
<u> Underlined
<br/> Linebreak
<ul><li>item 1</li><li>item 2</li></ul> List of items
The b , i , u and li tags can contain all the tags in the list recursively.
3.0
Inheritance Path. java.lang.Object-> com.itmill.toolkit.ui.AbstractComponent -> com.itmill.toolkit.ui.Label
Content mode, where the label contains RAW output. Output is not required to comply to with XML. In Web Adapter output is inserted inside the resulting HTML document as-is. This is useful for some specific purposes where possibly broken HTML content needs to be shown, but in most cases XHTML mode should be preferred.
Content mode, where the label contains only plain text. The getValue() result is coded to XML when painting.
Content mode, where the label contains XHTML. Contents is then enclosed in DIV elements having namespace of "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd".
Content mode, where the label contains well-formed or well-balanced XML. Each of the root elements must have their default namespace specified.
Parameters
listener
Listener to be added.
Add value change listener
Parameters
other
Other object to compare to
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Compare Label to other objects.
Labels can be compared to other labels for sorting label contents. This is especially handy for sorting table columns.
In RAW, PREFORMATTED and TEXT modes, the label contents are compared as is. In XML, UIDL and XHTML modes, only CDATA is compared and tags ignored. If the other object is not a Label, its toString() return value is used in comparison.
Parameters
Content mode of the label.
Get the content mode of the Label.
Possible content modes include:
CONTENT_TEXT Content mode, where the label contains only plain text. The getValue() result is coded to XML when painting.
CONTENT_PREFORMATTED Content mode, where the label contains preformatted text.
CONTENT_UIDL Formatted content mode, where the contents is XML restricted to the UIDL 1.0 formatting markups.
CONTENT_XHTML Content mode, where the label contains XHTML. Contents is then enclosed in DIV elements having namespace of "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd".
CONTENT_XML Content mode, where the label contains well-formed or well-balanced XML. Each of the root elements must have their default namespace specified.
CONTENT_RAW Content mode, where the label contains RAW output. Output is not required to comply to with XML. In Web Adapter output is inserted inside the resulting HTML document as-is. This is useful for some specific purposes where possibly broken HTML content needs to be shown, but in most cases XHTML mode should be preferred.
Parameters
type of the Property
Returns the type of the Property. The methods
getValue
and
setValue
must be compatible with this type: one
must be able to safely cast the value returned from
getValue
to the given type and pass any variable
assignable to this type as an argument to
setValue
.
Parameters
Value of the label
Get the value of the label. Value of the label is the XML contents of the label.
Parameters
True iff the component is in read only mode
Is the component read-only ? Readonly is not used in label - this returns allways false.
Parameters
listener
Listener to be removed.
Remove value change listener
Parameters
contentMode
New content mode of the label.
Set the content mode of the Label.
Possible content modes include:
CONTENT_TEXT Content mode, where the label contains only plain text. The getValue() result is coded to XML when painting.
CONTENT_PREFORMATTED Content mode, where the label contains preformatted text.
CONTENT_UIDL Formatted content mode, where the contents is XML restricted to the UIDL 1.0 formatting markups.
CONTENT_XHTML Content mode, where the label contains XHTML. Contents is then enclosed in DIV elements having namespace of "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd".
CONTENT_XML Content mode, where the label contains well-formed or well-balanced XML. Each of the root elements must have their default namespace specified.
CONTENT_RAW Content mode, where the label contains RAW output. Output is not required to comply to with XML. In Web Adapter output is inserted inside the resulting HTML document as-is. This is useful for some specific purposes where possibly broken HTML content needs to be shown, but in most cases XHTML mode should be preferred.
Parameters
readOnly
True to enable read-only mode, False to disable it
Set the component to read-only. Readonly is not used in label.
Parameters
newValue
New value of the label
Set the value of the label. Value of the label is the XML contents of the label.
Parameters
String
representation of the value stored in the
Property
Returns the value of the Property in human readable textual format.
The return value should be assignable to the
setValue
method if the Property is not in read-only mode.
Listen value change events from data source.