| java.lang.Object org.millstone.base.ui.AbstractComponent org.millstone.base.ui.Label
Label | public class Label extends AbstractComponent implements Property,Property.Viewer,Property.ValueChangeListener,Property.ValueChangeNotifier,Comparable(Code) | | 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.
author: IT Mill Ltd. version: 3.1.1 since: 3.0 |
Field Summary | |
final public static int | CONTENT_DEFAULT | final public static int | CONTENT_PREFORMATTED Content mode, where the label contains preformatted text. | final public static int | CONTENT_RAW Content mode, where the label contains RAW output. | final public static int | CONTENT_TEXT Content mode, where the label contains only plain text. | final public static int | CONTENT_UIDL Formatted content mode, where the contents is XML restricted to the
UIDL 1.0 formatting markups. | final public static int | CONTENT_XHTML Content mode, where the label contains XHTML. | final public static int | CONTENT_XML Content mode, where the label contains well-formed or well-balanced XML. |
Constructor Summary | |
public | Label() Creates an empty Label. | public | Label(String content) Creates a new instance of Label with text-contents. | public | Label(Property contentSource) Creates a new instance of Label with text-contents read from given datasource. | public | Label(String content, int contentMode) Creates a new instance of Label with text-contents. | public | Label(Property contentSource, int contentMode) Creates a new instance of Label with text-contents read from given datasource. |
CONTENT_DEFAULT | final public static int CONTENT_DEFAULT(Code) | | The default content mode is plain text
|
CONTENT_PREFORMATTED | final public static int CONTENT_PREFORMATTED(Code) | | Content mode, where the label contains preformatted text.
|
CONTENT_RAW | final public static int CONTENT_RAW(Code) | | 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_TEXT | final public static int CONTENT_TEXT(Code) | | Content mode, where the label contains only plain text. The getValue()
result is coded to XML when painting.
|
CONTENT_UIDL | final public static int CONTENT_UIDL(Code) | | Formatted content mode, where the contents is XML restricted to the
UIDL 1.0 formatting markups.
|
CONTENT_XHTML | final public static int CONTENT_XHTML(Code) | | 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 | final public static int CONTENT_XML(Code) | | Content mode, where the label contains well-formed or well-balanced XML.
Each of the root elements must have their default namespace specified.
|
Label | public Label()(Code) | | Creates an empty Label.
|
Label | public Label(String content)(Code) | | Creates a new instance of Label with text-contents.
|
Label | public Label(Property contentSource)(Code) | | Creates a new instance of Label with text-contents read from given datasource.
|
Label | public Label(String content, int contentMode)(Code) | | Creates a new instance of Label with text-contents.
|
Label | public Label(Property contentSource, int contentMode)(Code) | | Creates a new instance of Label with text-contents read from given datasource.
|
compareTo | public int compareTo(Object other)(Code) | | 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.
See Also: java.lang.Comparable.compareTo(java.lang.Object) 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. |
fireValueChange | protected void fireValueChange()(Code) | | Emit options change event.
|
getContentMode | public int getContentMode()(Code) | | 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.
Content mode of the label. |
getPropertyDataSource | public Property getPropertyDataSource()(Code) | | Get viewing data-source property.
|
getTag | public String getTag()(Code) | | Get component UIDL tag.
Component UIDL tag as string. |
getValue | public Object getValue()(Code) | | Get the value of the label.
Value of the label is the XML contents of the label.
Value of the label |
isReadOnly | public boolean isReadOnly()(Code) | | Is the component read-only ?
Readonly is not used in label - this returns allways false.
True iff the component is in read only mode |
setContentMode | public void setContentMode(int contentMode)(Code) | | 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: contentMode - New content mode of the label. |
setPropertyDataSource | public void setPropertyDataSource(Property newDataSource)(Code) | | Set the property as data-source for viewing.
|
setReadOnly | public void setReadOnly(boolean readOnly)(Code) | | Set the component to read-only.
Readonly is not used in label.
Parameters: readOnly - True to enable read-only mode, False to disable it |
setValue | public void setValue(Object newValue)(Code) | | Set the value of the label.
Value of the label is the XML contents of the label.
Parameters: newValue - New value of the label |
valueChange | public void valueChange(Property.ValueChangeEvent event)(Code) | | Listen value change events from data source.
See Also: org.millstone.base.data.Property.ValueChangeListener.valueChange(Property.ValueChangeEvent) |
Methods inherited from org.millstone.base.ui.AbstractComponent | public void addListener(RepaintRequestListener listener)(Code)(Java Doc) public void addListener(Class eventType, Object object, Method method)(Code)(Java Doc) public void addListener(Class eventType, Object object, String methodName)(Code)(Java Doc) public void addListener(Component.Listener listener)(Code)(Java Doc) public void attach()(Code)(Java Doc) public void changeVariables(Object source, Map variables)(Code)(Java Doc) public void childRequestedRepaint(Collection alreadyNotified)(Code)(Java Doc) public void dependsOn(VariableOwner depended)(Code)(Java Doc) public void detach()(Code)(Java Doc) protected void fireComponentErrorEvent()(Code)(Java Doc) protected void fireComponentEvent()(Code)(Java Doc) protected void fireEvent(Component.Event event)(Code)(Java Doc) public Application getApplication()(Code)(Java Doc) public String getCaption()(Code)(Java Doc) public ErrorMessage getComponentError()(Code)(Java Doc) public Object getData()(Code)(Java Doc) public String getDescription()(Code)(Java Doc) public Set getDirectDependencies()(Code)(Java Doc) public ErrorMessage getErrorMessage()(Code)(Java Doc) public Resource getIcon()(Code)(Java Doc) public Locale getLocale()(Code)(Java Doc) public Component getParent()(Code)(Java Doc) public String getStyle()(Code)(Java Doc) abstract public String getTag()(Code)(Java Doc) public Window getWindow()(Code)(Java Doc) public boolean isEnabled()(Code)(Java Doc) public boolean isImmediate()(Code)(Java Doc) public boolean isReadOnly()(Code)(Java Doc) public boolean isVisible()(Code)(Java Doc) final public void paint(PaintTarget target) throws PaintException(Code)(Java Doc) public void paintContent(PaintTarget target) throws PaintException(Code)(Java Doc) public void removeDirectDependency(VariableOwner depended)(Code)(Java Doc) public void removeListener(RepaintRequestListener listener)(Code)(Java Doc) public void removeListener(Class eventType, Object target)(Code)(Java Doc) public void removeListener(Class eventType, Object target, Method method)(Code)(Java Doc) public void removeListener(Class eventType, Object target, String methodName)(Code)(Java Doc) public void removeListener(Component.Listener listener)(Code)(Java Doc) public void requestRepaint()(Code)(Java Doc) public void requestRepaintRequests()(Code)(Java Doc) public void setCaption(String caption)(Code)(Java Doc) public void setComponentError(ErrorMessage componentError)(Code)(Java Doc) public void setData(Object data)(Code)(Java Doc) public void setDescription(String description)(Code)(Java Doc) public void setEnabled(boolean enabled)(Code)(Java Doc) public void setIcon(Resource icon)(Code)(Java Doc) public void setImmediate(boolean immediate)(Code)(Java Doc) public void setLocale(Locale locale)(Code)(Java Doc) public void setParent(Component parent)(Code)(Java Doc) public void setReadOnly(boolean readOnly)(Code)(Java Doc) public void setStyle(String style)(Code)(Java Doc) public void setVisible(boolean visible)(Code)(Java Doc)
|
|
|