|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.ui.AbstractComponent
com.vaadin.ui.Label
public class Label
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:
Nested Class Summary | |
---|---|
class |
Label.ValueChangeEvent
Value change event |
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractComponent |
---|
AbstractComponent.ComponentErrorEvent, AbstractComponent.ComponentErrorHandler |
Nested classes/interfaces inherited from interface com.vaadin.data.Property |
---|
Property.ConversionException, Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeEvent, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer |
Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
---|
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener |
Nested classes/interfaces inherited from interface com.vaadin.terminal.Paintable |
---|
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener |
Field Summary | |
---|---|
static int |
CONTENT_DEFAULT
The default content mode is plain text. |
static int |
CONTENT_PREFORMATTED
Content mode, where the label contains preformatted text. |
static int |
CONTENT_RAW
Content mode, where the label contains RAW output. |
static int |
CONTENT_TEXT
Content mode, where the label contains only plain text. |
static int |
CONTENT_UIDL
Deprecated. Use CONTENT_XML instead. |
static int |
CONTENT_XHTML
Content mode, where the label contains XHTML. |
static int |
CONTENT_XML
Content mode, where the label contains well-formed or well-balanced XML. |
Fields inherited from interface com.vaadin.terminal.Sizeable |
---|
SIZE_UNDEFINED, UNIT_SYMBOLS, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
Constructor Summary | |
---|---|
Label()
Creates an empty Label. |
|
Label(Property contentSource)
Creates a new instance of Label with text-contents read from given datasource. |
|
Label(Property contentSource,
int contentMode)
Creates a new instance of Label with text-contents read from given datasource. |
|
Label(String content)
Creates a new instance of Label with text-contents. |
|
Label(String content,
int contentMode)
Creates a new instance of Label with text-contents. |
Method Summary | |
---|---|
void |
addListener(Property.ValueChangeListener listener)
Adds the value change listener. |
int |
compareTo(Object other)
Compares the Label to other objects. |
protected void |
fireValueChange()
Emits the options change event. |
int |
getContentMode()
Gets the content mode of the Label. |
Property |
getPropertyDataSource()
Gets the viewing data-source property. |
Class |
getType()
Gets the type of the Property. |
Object |
getValue()
Gets the value of the label. |
boolean |
isReadOnly()
Is the component read-only ? Readonly is not used in label - this returns allways false. |
void |
paintContent(PaintTarget target)
Paints the content of this component. |
void |
removeListener(Property.ValueChangeListener listener)
Removes the value change listener. |
void |
setContentMode(int contentMode)
Sets the content mode of the Label. |
void |
setPropertyDataSource(Property newDataSource)
Sets the property as data-source for viewing. |
void |
setReadOnly(boolean readOnly)
Set the component to read-only. |
void |
setValue(Object newValue)
Set the value of the label. |
String |
toString()
Returns the value of the Property in human readable textual format. |
void |
valueChange(Property.ValueChangeEvent event)
Listens the value change events from data source. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int CONTENT_TEXT
public static final int CONTENT_PREFORMATTED
@Deprecated public static final int CONTENT_UIDL
public static final int CONTENT_XHTML
public static final int CONTENT_XML
public static final int CONTENT_RAW
public static final int CONTENT_DEFAULT
Constructor Detail |
---|
public Label()
public Label(String content)
content
- public Label(Property contentSource)
contentSource
- public Label(String content, int contentMode)
content
- contentMode
- public Label(Property contentSource, int contentMode)
contentSource
- contentMode
- Method Detail |
---|
public void setReadOnly(boolean readOnly)
setReadOnly
in interface Property
setReadOnly
in interface Component
setReadOnly
in class AbstractComponent
readOnly
- True to enable read-only mode, False to disable it.public boolean isReadOnly()
isReadOnly
in interface Property
isReadOnly
in interface Component
isReadOnly
in class AbstractComponent
true
if the component is in read only mode.Component.setReadOnly(boolean)
public void paintContent(PaintTarget target) throws PaintException
paintContent
in class AbstractComponent
target
- the Paint Event.
PaintException
- if the Paint Operation fails.public Object getValue()
getValue
in interface Property
public void setValue(Object newValue)
setValue
in interface Property
newValue
- the New value of the label.public String toString()
Property
setValue
method if
the Property is not in read-only mode.
toString
in interface Property
toString
in class Object
String
representation of the value stored in the
PropertyObject.toString()
public Class getType()
getType
in interface Property
Property.getType()
public Property getPropertyDataSource()
getPropertyDataSource
in interface Property.Viewer
Property.Viewer.getPropertyDataSource()
public void setPropertyDataSource(Property newDataSource)
setPropertyDataSource
in interface Property.Viewer
newDataSource
- the new data source PropertyProperty.Viewer.setPropertyDataSource(com.vaadin.data.Property)
public int getContentMode()
Possible content modes include:
public void setContentMode(int contentMode)
Possible content modes include:
contentMode
- the New content mode of the label.public void addListener(Property.ValueChangeListener listener)
addListener
in interface Property.ValueChangeNotifier
listener
- the Listener to be added.Property.ValueChangeNotifier.addListener(com.vaadin.data.Property.ValueChangeListener)
public void removeListener(Property.ValueChangeListener listener)
removeListener
in interface Property.ValueChangeNotifier
listener
- the Listener to be removed.Property.ValueChangeNotifier.removeListener(com.vaadin.data.Property.ValueChangeListener)
protected void fireValueChange()
public void valueChange(Property.ValueChangeEvent event)
valueChange
in interface Property.ValueChangeListener
event
- value change event objectProperty.ValueChangeListener.valueChange(Property.ValueChangeEvent)
public int compareTo(Object other)
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.
compareTo
in interface Comparable<Object>
other
- the Other object to compare to.
Comparable.compareTo(java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |