|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.itmill.toolkit.terminal.Identifiable
com.itmill.toolkit.ui.AbstractComponent
com.itmill.toolkit.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 interface com.itmill.toolkit.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.itmill.toolkit.ui.Component |
|---|
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener |
| Nested classes/interfaces inherited from interface com.itmill.toolkit.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
Formatted content mode, where the contents is XML restricted to the UIDL 1.0 formatting markups. |
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. |
| 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. |
String |
getTag()
Get the component UIDL tag. |
Class |
getType()
Gets the type of the Property. |
Object |
getValue()
Gets the value of the label. |
boolean |
isReadOnly()
Is the component read-only ? |
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 com.itmill.toolkit.terminal.Identifiable |
|---|
getDebugId, getUIID, setDebugId, setUIID |
| 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
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 String getTag()
getTag in class AbstractComponentpublic void setReadOnly(boolean readOnly)
setReadOnly in interface PropertysetReadOnly in interface ComponentsetReadOnly in class AbstractComponentreadOnly - True to enable read-only mode, False to disable it.public boolean isReadOnly()
isReadOnly in interface PropertyisReadOnly in interface ComponentisReadOnly in class AbstractComponenttrue if the component is in read only mode.
public void paintContent(PaintTarget target)
throws PaintException
paintContent in class AbstractComponenttarget - 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.public String toString()
PropertysetValue method
if the Property is not in read-only mode.
toString in interface PropertytoString in class ObjectString representation of the value stored in the
PropertyObject.toString()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.itmill.toolkit.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.ValueChangeNotifierlistener - the Listener to be added.Property.ValueChangeNotifier.addListener(com.itmill.toolkit.data.Property.ValueChangeListener)public void removeListener(Property.ValueChangeListener listener)
removeListener in interface Property.ValueChangeNotifierlistener - the Listener to be removed.Property.ValueChangeNotifier.removeListener(com.itmill.toolkit.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 Comparableother - 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 | |||||||||