net.windward.tags
Class HtmlTag
net.windward.tags.BaseTag
|
+--net.windward.tags.HtmlTag
- public class HtmlTag
- extends BaseTag
Output formatting based on a node. This tag represents a <wr:html ...> in the template. The full usage is
<wr:html select="./name"/> which will read the text in the referenced node and intelligently
parse it for known html tags. It will then apply the formatting of the html tags. Three major items to keep in mind:
1) It only understands a small subset of html and will ignore any other tags, 2) This can be used for any report
type - not just html reports, and 3) This formatting change only holds until there is another formatting change in
the template - and the start of a paragraph is always a formatting change.
The full list of attributes is:
- select - required - the node whose text will be substituted in.
- display - optional - can be the text notEmpty, notNull, always, or a string that is evaluated to be true or false.
If displayed is false, then if the out tag is the only item in a paragraph, the paragraph will be deleted.
- notEmpty - only displayed if the select is a string.
- notNull - displayed if the select exists, even if null or 0 length string value.
- always - displayed even if the select returns nothing.
- true/false(evaluate) - displayed if the value evaluates to true. If it evaluates to false it is not displayed
even if there is a non-null value for the select.
The html it understands is:
- <b> and </b> - bold on and off
- <br> - line break (not a paragraph break).
- <font color="13579a" size="12" face="Courier"> - font control. Color, size, and face are all optional
(although without at least one it makes no sense). Color must be in hex (no preceeding #) and size is in points.
- <i> and </i> - italic on and off
- <p> - paragraph break. Note: </p> is not recognized.
- <sub> and </sub> - subscript on and off
- <sup> and </sup> - superscript on and off
- <u> and </u> - underline on and off
It is an error to enter <wr:html select="./name"> ... </wr:html>
This tag follows the jstl example of c:out and x:out.
- Version:
- 2.0 November 1, 2003
| Fields inherited from class net.windward.tags.BaseTag |
CHART, COLUMN, DISPLAY_ALWAYS, DISPLAY_NOT_EMPTY, DISPLAY_NOT_NULL, ELSE, END_FOREACH, END_IF, END_LINK, END_MATRIX, ESCAPE, FOREACH, FUNCTION, HTML, IF, IMPORT, LINK, MATRIX, OUT, PROP_COMMENT, PROP_DATASOURCE, PROP_DEFAULT, PROP_DISPLAY, PROP_ENABLED, PROP_INPUT, PROP_PATTERN, PROP_TITLE, PROP_TYPE, PROP_VAR, PROP_WRAP, QUERY, ROW, SET, TAG_DISPLAY_DEFAULT, TAG_DISPLAY_SELECT, TAG_DISPLAY_TAG, TYPE_BITMAP, TYPE_BOTH, TYPE_CURRENCY, TYPE_DATE, TYPE_NUMBER, TYPE_PERCENT, TYPE_TIME, WRAP_BEHIND, WRAP_FRONT, WRAP_INLINE, WRAP_SQUARE |
|
Constructor Summary |
HtmlTag(java.util.Map map,
boolean selfContained,
boolean ignoreErrors)
Create a html element using the passed in map values. |
|
Method Summary |
net.windward.document.Element |
dup(boolean sameRefId)
Makes a duplicate of this object. |
int |
getXmlType()
Returns which type of xml element this is. |
java.lang.String |
toDisplay(int type)
How this node is displayed on the page when in a field. |
java.lang.String |
toString()
Returns this object as a string in the format "html:...". |
java.lang.String |
toText()
Converts this node back in to it's string representation in the document |
| Methods inherited from class net.windward.tags.BaseTag |
containsAttribute, factory, factory, getAttribute, getAttributes, getBean, getDatasource, getIntAttribute, getLevel, getMode, getNode, getType, setLevel, setNode, toTagText |
HtmlTag
public HtmlTag(java.util.Map map,
boolean selfContained,
boolean ignoreErrors)
throws TagException
- Create a html element using the passed in map values.
- Parameters:
map - Must have a select entry.selfContained - Must be true.ignoreErrors - - Throws:
TagException - thrown if illegal parameters passed in.
toText
public java.lang.String toText()
throws TagException
- Converts this node back in to it's string representation in the document
- Overrides:
toText in class BaseTag
- Returns:
- <wr:html ... /> type string.
toDisplay
public java.lang.String toDisplay(int type)
- How this node is displayed on the page when in a field.
- Overrides:
toDisplay in class BaseTag
- Parameters:
type - One of the DISPLAY_* constants- Returns:
- title, end of select, or <cmd> type string.
dup
public net.windward.document.Element dup(boolean sameRefId)
- Makes a duplicate of this object. A deep clone is done so the new object shares nothing
with the original object.
- Parameters:
sameRefId - - Returns:
- The new duplicate of this object
getXmlType
public int getXmlType()
- Returns which type of xml element this is.
- Overrides:
getXmlType in class BaseTag
- Returns:
- NODE_HTML
toString
public java.lang.String toString()
- Returns this object as a string in the format "html:...".
- Returns:
- A String listing this element.
Copyright © 2002 - 2008 Windward Reports - All Rights Reserved. java reporting software