org.apache.beehive.netui.tags.html
Class LabelBase

Object
  extended by TagSupport
      extended by BodyTagSupport
          extended by AbstractClassicTag
              extended by HtmlBaseTag
                  extended by LabelBase
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag, HtmlConstants, IFormattable, IAttributeConsumer, IHtmlAttrs, IHtmlCore, IHtmlEvents, IHtmlI18n, INetuiTag
Direct Known Subclasses:
Label, Span

public abstract class LabelBase
extends HtmlBaseTag
implements IFormattable

This is a base class providing implementation for both the Label and FormLabel.

See Also:
Serialized Form

Field Summary
protected  Object _defaultValue
           
protected  boolean _escapeWhiteSpace
           
protected  boolean _formatDefaultValue
           
protected  boolean _formatterErrors
           
protected  Object _value
           
protected static String DEFAULT_NULL_TEXT
           
 
Fields inherited from class AbstractClassicTag
DefaultNamingChain, EMPTY_STRING, NETUI_UNIQUE_CNT
 
Fields inherited from class BodyTagSupport
bodyContent
 
Fields inherited from class TagSupport
id, pageContext
 
Fields inherited from interface HtmlConstants
ABBR, ACCEPT, ACCESSKEY, ACTION, ALIGN, ALINK, ALT, ANCHOR, AREA, AXIS, BACKGROUND, BASE, BGCOLOR, BODY, BORDER, BR, BUTTON, CAPTION, CELLPADDING, CELLSPACING, CHAR, CHAROFF, CHARSET, CHECKED, CLASS, COLS, COLSPAN, COORDS, DIR, DISABLED, DIV, ENCTYPE, FOR, FORM, FORM_GET, FORM_POST, FRAME, HEADERS, HEIGHT, HREF, HREFLANG, HSPACE, HTML, ID, IMAGE, INPUT, INPUT_BUTTON, INPUT_CHECKBOX, INPUT_FILE, INPUT_HIDDEN, INPUT_IMAGE, INPUT_PASSWORD, INPUT_RADIO, INPUT_RESET, INPUT_SUBMIT, INPUT_TEXT, ISMAP, LABEL, LANG, LANGUAGE, LINK, LONGDESC, MAXLENGTH, METHOD, NAME, ONBLUR, ONCHANGE, ONCLICK, ONDBLCLICK, ONFOCUS, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONLOAD, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, ONRESET, ONSELECT, ONSUBMIT, ONUNLOAD, OPTION, READONLY, REL, REV, ROWS, ROWSPAN, RULES, SCOPE, SCRIPT, SELECT, SHAPE, SIZE, SPAN, SRC, STYLE, SUMMARY, TABINDEX, TABLE, TARGET, TBODY, TD, TEXT, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TYPE, USEMAP, VALIGN, VALUE, VLINK, VSPACE, WIDTH
 
Fields inherited from interface BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
LabelBase()
           
 
Method Summary
 void addFormatter(FormatTag.Formatter formatter)
          Adds a FormatTag.Formatter to the Label's set of formatters
protected  void filter(String value, AbstractRenderAppender writer, boolean markupHTMLSpaceReturn)
          Filter the specified string for characters that are senstive to HTML interpreters, returning the string with these characters replaced by the corresponding character entities.
 void formatterHasError()
          Indicate that a formatter has reported an error so the formatter should output it's body text.
protected  String formatText(Object text)
           
protected  void localRelease()
          Release any acquired resources.
 void setDefaultValue(Object defaultValue)
          Set the default value of this Label.
 void setEscapeWhiteSpaceForHtml(boolean escapeWhiteSpace)
          Sets a boolean flag indicating if we will escape white space for HTML.
 void setFormatDefaultValue(boolean formatDisplay)
          Boolean indicating whether the formatter should be applied to the defaultValue.
 void setValue(Object value)
          Sets the text of the Label.
 
Methods inherited from class HtmlBaseTag
getJavaScriptAttribute, getOnClick, getState, getTagId, renderDefaultNameAndId, renderNameAndId, setAttribute, setDir, setLang, setOnClick, setOnDblClick, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setStateAttribute, setStyle, setStyleClass, setTagId, setTitle
 
Methods inherited from class AbstractClassicTag
applyNamingChain, getErrorsReport, getIdForTagId, getNamingChain, getNearestForm, getNextId, getScriptReporter, getTagName, getUserLocale, hasErrors, qualifyAttribute, registerTagError, registerTagError, reportAndExit, reportErrors, rewriteName, setNonEmptyValueAttribute, setRequiredValueAttribute, write
 
Methods inherited from class BodyTagSupport
doAfterBody, doEndTag, doInitBody, doStartTag, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface Tag
getParent, setPageContext, setParent
 

Field Detail

DEFAULT_NULL_TEXT

protected static final String DEFAULT_NULL_TEXT
See Also:
Constant Field Values

_defaultValue

protected Object _defaultValue

_value

protected Object _value

_escapeWhiteSpace

protected boolean _escapeWhiteSpace

_formatterErrors

protected boolean _formatterErrors

_formatDefaultValue

protected boolean _formatDefaultValue
Constructor Detail

LabelBase

public LabelBase()
Method Detail

setDefaultValue

public void setDefaultValue(Object defaultValue)
Set the default value of this Label. This can be an expression. If the default value is an expression all formatters will be applied, otherwise the default value will be output without being formatted.

Parameters:
defaultValue - the default value

setFormatDefaultValue

public void setFormatDefaultValue(boolean formatDisplay)
Boolean indicating whether the formatter should be applied to the defaultValue. The default is "false" meaning formatters will not be applied.

Parameters:
formatDisplay - Apply formatting to the default value.

setValue

public void setValue(Object value)
Sets the text of the Label.

Parameters:
value - the Label value or expression.

setEscapeWhiteSpaceForHtml

public void setEscapeWhiteSpaceForHtml(boolean escapeWhiteSpace)
Sets a boolean flag indicating if we will escape white space for HTML. If this is true the white space charcters ' ' will be converted into " " and '\n' converted into "
". The result is that in HTML white space will be represented correctly. If this is false then white space will be output as it is found in the value.

Parameters:
escapeWhiteSpace - boolean indicating if we are escaping for white space.

addFormatter

public void addFormatter(FormatTag.Formatter formatter)
Adds a FormatTag.Formatter to the Label's set of formatters

Specified by:
addFormatter in interface IFormattable
Parameters:
formatter - a FormatTag.Formatter added by a child FormatTag.

formatterHasError

public void formatterHasError()
Indicate that a formatter has reported an error so the formatter should output it's body text.

Specified by:
formatterHasError in interface IFormattable

filter

protected void filter(String value,
                      AbstractRenderAppender writer,
                      boolean markupHTMLSpaceReturn)
Filter the specified string for characters that are senstive to HTML interpreters, returning the string with these characters replaced by the corresponding character entities.

Parameters:
value - The string to be filtered and returned
markupHTMLSpaceReturn - convert space characters and return characters to &nbsp; and <br /> marketup for html.

localRelease

protected void localRelease()
Release any acquired resources.

Overrides:
localRelease in class HtmlBaseTag

formatText

protected String formatText(Object text)
                     throws JspException
Throws:
JspException