|
||||||||||
| 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 Label.ContentMode
The contents of the label may contain simple formatting:
| Nested Class Summary | |
|---|---|
static class |
Label.ContentMode
Content modes defining how the client should interpret a Label's value. |
static 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.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeEvent, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T>, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer |
| Nested classes/interfaces inherited from interface com.vaadin.terminal.VariableOwner |
|---|
VariableOwner.ErrorEvent |
| Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
|---|
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener, Component.RepaintRequestEvent, Component.RepaintRequestListener |
| Nested classes/interfaces inherited from interface com.vaadin.terminal.Sizeable |
|---|
Sizeable.Unit |
| Field Summary | |
|---|---|
static Label.ContentMode |
CONTENT_DEFAULT
Deprecated. From 7.0, use Label.ContentMode.DEFAULT instead |
static Label.ContentMode |
CONTENT_PREFORMATTED
Deprecated. From 7.0, use Label.ContentMode.PREFORMATTED instead |
static Label.ContentMode |
CONTENT_RAW
Deprecated. From 7.0, use Label.ContentMode.RAW instead |
static Label.ContentMode |
CONTENT_TEXT
Deprecated. From 7.0, use Label.ContentMode.TEXT instead |
static Label.ContentMode |
CONTENT_XHTML
Deprecated. From 7.0, use Label.ContentMode.XHTML instead |
static Label.ContentMode |
CONTENT_XML
Deprecated. From 7.0, use Label.ContentMode.XML instead |
| Fields inherited from interface com.vaadin.terminal.Sizeable |
|---|
SIZE_UNDEFINED, 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,
Label.ContentMode 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,
Label.ContentMode contentMode)
Creates a new instance of Label with text-contents. |
|
| Method Summary | |
|---|---|
void |
addListener(Property.ValueChangeListener listener)
Adds the value change listener. |
void |
changeVariables(Object source,
Map<String,Object> variables)
Called when one or more variables handled by the implementing class are changed. |
int |
compareTo(Object other)
Compares the Label to other objects. |
protected void |
fireValueChange()
Emits the options change event. |
Label.ContentMode |
getContentMode()
Gets the content mode of the Label. |
Property |
getPropertyDataSource()
Gets the viewing data-source property. |
String |
getStringValue()
Returns the value of the Property in human readable textual
format. |
Class |
getType()
Gets the type of the Property. |
Object |
getValue()
Gets the value of the label. |
void |
paintContent(PaintTarget target)
Paints the content of this component. |
void |
removeListener(Property.ValueChangeListener listener)
Removes the value change listener. |
void |
setContentMode(Label.ContentMode contentMode)
Sets the content mode of the Label. |
void |
setPropertyDataSource(Property newDataSource)
Sets the property as data-source for viewing. |
void |
setValue(Object newValue)
Set the value of the label. |
String |
toString()
Deprecated. use the data source value or getStringValue()
instead |
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 |
| Methods inherited from interface com.vaadin.data.Property |
|---|
isReadOnly, setReadOnly |
| Methods inherited from interface com.vaadin.terminal.VariableOwner |
|---|
isEnabled, isImmediate |
| Methods inherited from interface com.vaadin.ui.Component |
|---|
addListener, addListener, addStyleName, attach, detach, getApplication, getCaption, getDebugId, getIcon, getLocale, getParent, getRoot, getState, getStyleName, isEnabled, isReadOnly, isVisible, removeListener, removeListener, removeStyleName, requestRepaint, setCaption, setDebugId, setEnabled, setIcon, setParent, setReadOnly, setStyleName, setVisible, updateState |
| Methods inherited from interface com.vaadin.terminal.gwt.server.ClientConnector |
|---|
isConnectorEnabled, retrievePendingRpcCalls |
| Methods inherited from interface com.vaadin.terminal.gwt.client.Connector |
|---|
getConnectorId |
| Methods inherited from interface com.vaadin.terminal.gwt.server.RpcTarget |
|---|
getRpcManager |
| Methods inherited from interface com.vaadin.terminal.Sizeable |
|---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setSizeFull, setSizeUndefined, setWidth, setWidth |
| Field Detail |
|---|
@Deprecated public static final Label.ContentMode CONTENT_TEXT
Label.ContentMode.TEXT instead@Deprecated public static final Label.ContentMode CONTENT_PREFORMATTED
Label.ContentMode.PREFORMATTED instead@Deprecated public static final Label.ContentMode CONTENT_XHTML
Label.ContentMode.XHTML instead@Deprecated public static final Label.ContentMode CONTENT_XML
Label.ContentMode.XML instead@Deprecated public static final Label.ContentMode CONTENT_RAW
Label.ContentMode.RAW instead@Deprecated public static final Label.ContentMode CONTENT_DEFAULT
Label.ContentMode.DEFAULT instead| Constructor Detail |
|---|
public Label()
public Label(String content)
content - public Label(Property contentSource)
contentSource -
public Label(String content,
Label.ContentMode contentMode)
content - contentMode -
public Label(Property contentSource,
Label.ContentMode contentMode)
contentSource - contentMode - | Method Detail |
|---|
public void paintContent(PaintTarget target)
throws PaintException
paintContent in interface Vaadin6Componenttarget - the Paint Event.
PaintException - if the Paint Operation fails.public Object getValue()
getValue in interface Propertypublic void setValue(Object newValue)
setValue in interface PropertynewValue - the New value of the label.@Deprecated public String toString()
getStringValue()
instead
toString in class ObjectObject.toString()public String getStringValue()
Property in human readable textual
format.
This method exists to help migration from previous Vaadin versions by
providing a simple replacement for toString(). However, it is
normally better to use the value of the label directly.
public Class getType()
getType in interface PropertyProperty.getType()public Property getPropertyDataSource()
getPropertyDataSource in interface Property.ViewerProperty.Viewer.getPropertyDataSource()public void setPropertyDataSource(Property newDataSource)
setPropertyDataSource in interface Property.ViewernewDataSource - the new data source PropertyProperty.Viewer.setPropertyDataSource(com.vaadin.data.Property)public Label.ContentMode getContentMode()
Label.ContentModepublic void setContentMode(Label.ContentMode contentMode)
contentMode - the New content mode of the label.Label.ContentModepublic void addListener(Property.ValueChangeListener listener)
addListener in interface Property.ValueChangeNotifierlistener - the Listener to be added.Property.ValueChangeNotifier.addListener(com.vaadin.data.Property.ValueChangeListener)public void removeListener(Property.ValueChangeListener listener)
removeListener in interface Property.ValueChangeNotifierlistener - 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.ValueChangeListenerevent - 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)
public void changeVariables(Object source,
Map<String,Object> variables)
VariableOwner
changeVariables in interface VariableOwnersource - the Source of the variable change. This is the origin of the
event. For example in Web Adapter this is the request.variables - the Mapping from variable names to new variable values.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||