net.sf.springlayout.web.layout.taglib
Class AbstractHtmlAttributesTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.springframework.web.servlet.tags.RequestContextAwareTag
          extended by org.springframework.web.servlet.tags.HtmlEscapingAwareTag
              extended by net.sf.springlayout.web.layout.taglib.LayoutBindTag
                  extended by net.sf.springlayout.web.layout.taglib.AbstractFieldTag
                      extended by net.sf.springlayout.web.layout.taglib.AbstractHtmlAttributesTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag, javax.servlet.jsp.tagext.TryCatchFinally
Direct Known Subclasses:
AbstractHtmlInputAttributesTag, DisplayTag, FieldLabelTag

public abstract class AbstractHtmlAttributesTag
extends AbstractFieldTag

Class to contain HTML attributes common to all tags.

Author:
Adam Boas Created on 19/07/2006
See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_ATTRIBUTE
          The name of the 'class' attribute.
protected  java.lang.String cssErrorClass
          The value of the 'class' attribute applied when an there is a validation error.
static java.lang.String DIR_ATTRIBUTE
          The name of the 'dir' attribute.
static java.lang.String LANG_ATTRIBUTE
          The name of the 'lang' attribute.
protected  java.lang.String mode
          The 'mode' which this tag should operated in.
static java.lang.String ONCHANGE_ATTRIBUTE
          The name of the 'onchange' attribute.
static java.lang.String ONCLICK_ATTRIBUTE
          The name of the 'onclick' attribute.
static java.lang.String ONDBLCLICK_ATTRIBUTE
          The name of the 'ondblclick' attribute.
static java.lang.String ONKEYDOWN_ATTRIBUTE
          The name of the 'onkeydown' attribute.
static java.lang.String ONKEYPRESS_ATTRIBUTE
          The name of the 'onkeypress' attribute.
static java.lang.String ONKEYUP_ATTRIBUTE
          The name of the 'onkeyup' attribute.
static java.lang.String ONMOUSEDOWN_ATTRIBUTE
          The name of the 'onmousedown' attribute.
static java.lang.String ONMOUSEMOVE_ATTRIBUTE
          The name of the 'onmousemove' attribute.
static java.lang.String ONMOUSEOUT_ATTRIBUTE
          The name of the 'onmouseout' attribute.
static java.lang.String ONMOUSEOVER_ATTRIBUTE
          The name of the 'onmouseover' attribute.
static java.lang.String ONMOUSEUP_ATTRIBUTE
          The name of the 'onmouseup' attribute.
protected  java.util.Map prependMap
          The Map of attribute names to values which should be prepended when building the common htmlAttributes.
static java.lang.String STYLE_ATTRIBUTE
          The name of the 'style' attribute.
static java.lang.String TABINDEX_ATTRIBUTE
          The name of the 'tabindex' attribute.
static java.lang.String TITLE_ATTRIBUTE
          The name of the 'title' attribute.
 
Fields inherited from class net.sf.springlayout.web.layout.taglib.AbstractFieldTag
config, emptyDisplayString, fieldInstance
 
Fields inherited from class net.sf.springlayout.web.layout.taglib.LayoutBindTag
ignoreNestedPath, path, pathIfNestedNull, previousStatus, status
 
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
AbstractHtmlAttributesTag()
          No arg constructor which builds a new hashMap for prepending HTML attributes.
 
Method Summary
protected  void appendAllApplicableCssClasses(java.lang.StringBuffer cssBuffer, boolean readonly)
          Appends the appropriate CssClasses to the tag, this includes base class for the field type, mandatory and error classes if appropriate
protected  void appendAttribute(java.lang.StringBuffer attributeBuffer, java.lang.String attributeName, java.lang.String attributeValue)
          Convenience method to append the attribute name value pair to the StringBuffer provided.
 void appendCommonHtmlAttributes(java.lang.StringBuffer attributeBuffer)
          Appends the general HTML Attributes available to all Tags to the StringBuffer provided.
 int doFieldStartTag()
          Called in sub classes
protected abstract  java.lang.String getBaseCssClass()
           
 java.lang.String getCssClass()
           
protected  boolean isDisabled()
           
 void setCssClass(java.lang.String cssClass)
          Sets the cssClass for this AbstractFieldTag.
 void setCssErrorClass(java.lang.String cssErrorClass)
          Sets the cssErrorClass for this AbstractFieldTag.
 void setCssStyle(java.lang.String cssStyle)
          Sets the cssStyle for this AbstractFieldTag.
 void setDir(java.lang.String dir)
          Sets the dir for this AbstractFieldTag.
 void setLang(java.lang.String lang)
          Sets the lang for this AbstractFieldTag.
 void setMode(java.lang.String mode)
          Sets the mode for this AbstractHtmlAttributesTag.
 void setOnchange(java.lang.String onchange)
          Sets the onchange for this AbstractHtmlInputAttributesTag.
 void setOnclick(java.lang.String onclick)
          Sets the onclick for this AbstractFieldTag.
 void setOndblclick(java.lang.String ondblclick)
          Sets the ondblclick for this AbstractFieldTag.
 void setOnkeydown(java.lang.String onkeydown)
          Sets the onkeydown for this AbstractFieldTag.
 void setOnkeypress(java.lang.String onkeypress)
          Sets the onkeypress for this AbstractFieldTag.
 void setOnkeyup(java.lang.String onkeyup)
          Sets the onkeyup for this AbstractFieldTag.
 void setOnmousedown(java.lang.String onmousedown)
          Sets the onmousedown for this AbstractFieldTag.
 void setOnmousemove(java.lang.String onmousemove)
          Sets the onmousemove for this AbstractFieldTag.
 void setOnmouseout(java.lang.String onmouseout)
          Sets the onmouseout for this AbstractFieldTag.
 void setOnmouseover(java.lang.String onmouseover)
          Sets the onmouseover for this AbstractFieldTag.
 void setOnmouseup(java.lang.String onmouseup)
          Sets the onmouseup for this AbstractFieldTag.
 void setTabindex(java.lang.String tabindex)
          Sets the tabindex for this AbstractFieldTag.
 void setTitle(java.lang.String title)
          Sets the title for this AbstractFieldTag.
 
Methods inherited from class net.sf.springlayout.web.layout.taglib.AbstractFieldTag
addToFieldSet, appendEditModeOutput, appendReadOnlyOutput, doStartTagInternal, getFieldDefinition, getGroupSize, getOutput, getWrappedCommand, isGroupedField, setEmptyDisplayString, setOutput
 
Methods inherited from class net.sf.springlayout.web.layout.taglib.LayoutBindTag
doEndTag, doFinally, getEditor, getErrors, getPath, getProperty, isIgnoreNestedPath, setIgnoreNestedPath, setPath
 
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
isHtmlEscape, setHtmlEscape
 
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prependMap

protected java.util.Map prependMap
The Map of attribute names to values which should be prepended when building the common htmlAttributes.


CLASS_ATTRIBUTE

public static final java.lang.String CLASS_ATTRIBUTE
The name of the 'class' attribute.

See Also:
Constant Field Values

STYLE_ATTRIBUTE

public static final java.lang.String STYLE_ATTRIBUTE
The name of the 'style' attribute.

See Also:
Constant Field Values

LANG_ATTRIBUTE

public static final java.lang.String LANG_ATTRIBUTE
The name of the 'lang' attribute.

See Also:
Constant Field Values

TITLE_ATTRIBUTE

public static final java.lang.String TITLE_ATTRIBUTE
The name of the 'title' attribute.

See Also:
Constant Field Values

DIR_ATTRIBUTE

public static final java.lang.String DIR_ATTRIBUTE
The name of the 'dir' attribute.

See Also:
Constant Field Values

TABINDEX_ATTRIBUTE

public static final java.lang.String TABINDEX_ATTRIBUTE
The name of the 'tabindex' attribute.

See Also:
Constant Field Values

ONCLICK_ATTRIBUTE

public static final java.lang.String ONCLICK_ATTRIBUTE
The name of the 'onclick' attribute.

See Also:
Constant Field Values

ONCHANGE_ATTRIBUTE

public static final java.lang.String ONCHANGE_ATTRIBUTE
The name of the 'onchange' attribute.

See Also:
Constant Field Values

ONDBLCLICK_ATTRIBUTE

public static final java.lang.String ONDBLCLICK_ATTRIBUTE
The name of the 'ondblclick' attribute.

See Also:
Constant Field Values

ONMOUSEDOWN_ATTRIBUTE

public static final java.lang.String ONMOUSEDOWN_ATTRIBUTE
The name of the 'onmousedown' attribute.

See Also:
Constant Field Values

ONMOUSEUP_ATTRIBUTE

public static final java.lang.String ONMOUSEUP_ATTRIBUTE
The name of the 'onmouseup' attribute.

See Also:
Constant Field Values

ONMOUSEOVER_ATTRIBUTE

public static final java.lang.String ONMOUSEOVER_ATTRIBUTE
The name of the 'onmouseover' attribute.

See Also:
Constant Field Values

ONMOUSEMOVE_ATTRIBUTE

public static final java.lang.String ONMOUSEMOVE_ATTRIBUTE
The name of the 'onmousemove' attribute.

See Also:
Constant Field Values

ONMOUSEOUT_ATTRIBUTE

public static final java.lang.String ONMOUSEOUT_ATTRIBUTE
The name of the 'onmouseout' attribute.

See Also:
Constant Field Values

ONKEYPRESS_ATTRIBUTE

public static final java.lang.String ONKEYPRESS_ATTRIBUTE
The name of the 'onkeypress' attribute.

See Also:
Constant Field Values

ONKEYUP_ATTRIBUTE

public static final java.lang.String ONKEYUP_ATTRIBUTE
The name of the 'onkeyup' attribute.

See Also:
Constant Field Values

ONKEYDOWN_ATTRIBUTE

public static final java.lang.String ONKEYDOWN_ATTRIBUTE
The name of the 'onkeydown' attribute.

See Also:
Constant Field Values

cssErrorClass

protected java.lang.String cssErrorClass
The value of the 'class' attribute applied when an there is a validation error.


mode

protected java.lang.String mode
The 'mode' which this tag should operated in. If unset will operate in Read or Edit depending on the value in the request parameter. If over-ridden here the tag will always function in the mode specified no matter what mode is requested by the page.

Constructor Detail

AbstractHtmlAttributesTag

public AbstractHtmlAttributesTag()
No arg constructor which builds a new hashMap for prepending HTML attributes.

Method Detail

setCssClass

public void setCssClass(java.lang.String cssClass)
Sets the cssClass for this AbstractFieldTag.

Parameters:
cssClass - Sets the cssClass for this AbstractFieldTag.

setCssErrorClass

public void setCssErrorClass(java.lang.String cssErrorClass)
Sets the cssErrorClass for this AbstractFieldTag.

Parameters:
cssErrorClass - Sets the cssErrorClass for this AbstractFieldTag.

setCssStyle

public void setCssStyle(java.lang.String cssStyle)
Sets the cssStyle for this AbstractFieldTag.

Parameters:
cssStyle - Sets the cssStyle for this AbstractFieldTag.

setDir

public void setDir(java.lang.String dir)
Sets the dir for this AbstractFieldTag.

Parameters:
dir - Sets the dir for this AbstractFieldTag.

setLang

public void setLang(java.lang.String lang)
Sets the lang for this AbstractFieldTag.

Parameters:
lang - Sets the lang for this AbstractFieldTag.

setOnclick

public void setOnclick(java.lang.String onclick)
Sets the onclick for this AbstractFieldTag.

Parameters:
onclick - Sets the onclick for this AbstractFieldTag.

setOnchange

public void setOnchange(java.lang.String onchange)
Sets the onchange for this AbstractHtmlInputAttributesTag.

Parameters:
onchange - The onchange for this AbstractHtmlInputAttributesTag.

setOndblclick

public void setOndblclick(java.lang.String ondblclick)
Sets the ondblclick for this AbstractFieldTag.

Parameters:
ondblclick - Sets the ondblclick for this AbstractFieldTag.

setOnkeydown

public void setOnkeydown(java.lang.String onkeydown)
Sets the onkeydown for this AbstractFieldTag.

Parameters:
onkeydown - Sets the onkeydown for this AbstractFieldTag.

setOnkeypress

public void setOnkeypress(java.lang.String onkeypress)
Sets the onkeypress for this AbstractFieldTag.

Parameters:
onkeypress - Sets the onkeypress for this AbstractFieldTag.

setOnkeyup

public void setOnkeyup(java.lang.String onkeyup)
Sets the onkeyup for this AbstractFieldTag.

Parameters:
onkeyup - Sets the onkeyup for this AbstractFieldTag.

setOnmousedown

public void setOnmousedown(java.lang.String onmousedown)
Sets the onmousedown for this AbstractFieldTag.

Parameters:
onmousedown - Sets the onmousedown for this AbstractFieldTag.

setOnmousemove

public void setOnmousemove(java.lang.String onmousemove)
Sets the onmousemove for this AbstractFieldTag.

Parameters:
onmousemove - Sets the onmousemove for this AbstractFieldTag.

setOnmouseout

public void setOnmouseout(java.lang.String onmouseout)
Sets the onmouseout for this AbstractFieldTag.

Parameters:
onmouseout - Sets the onmouseout for this AbstractFieldTag.

setOnmouseover

public void setOnmouseover(java.lang.String onmouseover)
Sets the onmouseover for this AbstractFieldTag.

Parameters:
onmouseover - Sets the onmouseover for this AbstractFieldTag.

setOnmouseup

public void setOnmouseup(java.lang.String onmouseup)
Sets the onmouseup for this AbstractFieldTag.

Parameters:
onmouseup - Sets the onmouseup for this AbstractFieldTag.

setTabindex

public void setTabindex(java.lang.String tabindex)
Sets the tabindex for this AbstractFieldTag.

Parameters:
tabindex - Sets the tabindex for this AbstractFieldTag.

setMode

public void setMode(java.lang.String mode)
Sets the mode for this AbstractHtmlAttributesTag.

Parameters:
mode - Sets the mode for this AbstractHtmlAttributesTag.

setTitle

public void setTitle(java.lang.String title)
Sets the title for this AbstractFieldTag.

Parameters:
title - Sets the title for this AbstractFieldTag.

doFieldStartTag

public int doFieldStartTag()
                    throws javax.servlet.jsp.JspTagException
Description copied from class: AbstractFieldTag
Called in sub classes

Specified by:
doFieldStartTag in class AbstractFieldTag
Returns:
Throws:
javax.servlet.jsp.JspTagException

appendCommonHtmlAttributes

public void appendCommonHtmlAttributes(java.lang.StringBuffer attributeBuffer)
Appends the general HTML Attributes available to all Tags to the StringBuffer provided.

Parameters:
attributeBuffer - the StringBuffer to append the HTML Attributes to.

appendAttribute

protected void appendAttribute(java.lang.StringBuffer attributeBuffer,
                               java.lang.String attributeName,
                               java.lang.String attributeValue)
Convenience method to append the attribute name value pair to the StringBuffer provided.

Parameters:
attributeBuffer - StringBuffer to append the name value pair to.
attributeName - name to append
attributeValue - value to append

getBaseCssClass

protected abstract java.lang.String getBaseCssClass()

appendAllApplicableCssClasses

protected void appendAllApplicableCssClasses(java.lang.StringBuffer cssBuffer,
                                             boolean readonly)
Appends the appropriate CssClasses to the tag, this includes base class for the field type, mandatory and error classes if appropriate

Parameters:
cssBuffer - stringBuffer to append classes to
readonly - indicates if the field is currently in readonly mode.

getCssClass

public java.lang.String getCssClass()
Returns:
cssClass

isDisabled

protected boolean isDisabled()


Copyright © 2005-2007 Spring Layout Team. All Rights Reserved.