|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.millstone.base.ui.AbstractComponent | +--org.millstone.base.ui.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 inherited from class org.millstone.base.data.Property |
Property.ConversionException, Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeEvent, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer |
Nested classes inherited from class org.millstone.base.ui.Component |
Component.Listener |
Nested classes inherited from class org.millstone.base.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_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(java.lang.String content)
Creates a new instance of Label with text-contents. |
|
Label(java.lang.String content,
int contentMode)
Creates a new instance of Label with text-contents. |
Method Summary | |
void |
addListener(Property.ValueChangeListener listener)
Add value change listener |
protected void |
fireValueChange()
Emit options change event. |
int |
getContentMode()
Returns the namespace. |
Property |
getPropertyDataSource()
Get viewing data-source property. |
java.lang.String |
getTag()
Get component UIDL tag. |
java.lang.Class |
getType()
Returns the type of the Property. |
java.lang.Object |
getValue()
Get the value of the label. |
boolean |
isReadOnly()
Is the component read-only ? |
void |
paintContent(PaintTarget target)
Paint the content of this component. |
void |
removeListener(Property.ValueChangeListener listener)
Remove value change listener |
void |
setContentMode(int contentMode)
Sets the namespace. |
void |
setPropertyDataSource(Property newDataSource)
Set the property as data-source for viewing. |
void |
setReadOnly(boolean readOnly)
Set the component to read-only. |
void |
setValue(java.lang.Object newValue)
Set the value of the label. |
java.lang.String |
toString()
Returns the value of the Property in human readable textual format. |
void |
valueChange(Property.ValueChangeEvent event)
Listen value change events from data source. |
Methods inherited from class org.millstone.base.ui.AbstractComponent |
addListener, addListener, addListener, addListener, attach, changeVariables, childRequestedRepaint, dependsOn, detach, fireComponentEvent, fireEvent, getApplication, getCaption, getComponentError, getDescription, getDirectDependencies, getErrorMessage, getIcon, getLocale, getParent, getStyle, getWindow, isEnabled, isImmediate, isVisible, paint, removeDirectDependency, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setDescription, setEnabled, setIcon, setImmediate, setLocale, setParent, setStyle, setVisible |
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_DEFAULT
Constructor Detail |
public Label()
public Label(java.lang.String content)
public Label(Property contentSource)
public Label(java.lang.String content, int contentMode)
public Label(Property contentSource, int contentMode)
Method Detail |
public java.lang.String getTag()
getTag
in class AbstractComponent
public void setReadOnly(boolean readOnly)
setReadOnly
in interface Property
setReadOnly
in class AbstractComponent
readOnly
- True to enable read-only mode, False to disable itpublic boolean isReadOnly()
isReadOnly
in interface Property
isReadOnly
in class AbstractComponent
public void paintContent(PaintTarget target) throws PaintException
paintContent
in class AbstractComponent
target
- target UIDL stream where the component should paint
itself to
PaintException
- if the operation failedpublic java.lang.Object getValue()
getValue
in interface Property
public void setValue(java.lang.Object newValue)
setValue
in interface Property
newValue
- New value of the labelpublic java.lang.String toString()
Property
setValue
method if the Property is not in read-only mode.
toString
in interface Property
toString
in class java.lang.Object
String
representation of the value stored in the
Propertypublic java.lang.Class getType()
Property
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
.
getType
in interface Property
public Property getPropertyDataSource()
getPropertyDataSource
in interface Property.Viewer
public void setPropertyDataSource(Property newDataSource)
setPropertyDataSource
in interface Property.Viewer
newDataSource
- the new data source Propertypublic int getContentMode()
public void setContentMode(int contentMode)
public void addListener(Property.ValueChangeListener listener)
addListener
in interface Property.ValueChangeNotifier
listener
- Listener to be added.public void removeListener(Property.ValueChangeListener listener)
removeListener
in interface Property.ValueChangeNotifier
listener
- Listener to be removed.protected void fireValueChange()
public void valueChange(Property.ValueChangeEvent event)
valueChange
in interface Property.ValueChangeListener
event
- value change event objectProperty.ValueChangeListener.valueChange(Property.ValueChangeEvent)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |