com.ivata.mask.web.tag.html
Class LabelTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.tagext.BodyTagSupport
          extended byorg.apache.struts.taglib.html.BaseHandlerTag
              extended bycom.ivata.mask.web.tag.html.LabelTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class LabelTag
extends org.apache.struts.taglib.html.BaseHandlerTag

Specifies a label for a field. This tag must be contained within a form tag, and will take the resourceFieldPath and bundle from there to locate the correct message for this field.

Since:
ivata masks 0.4 (2003-03-01)
Version:
$Revision: 1.5 $
Author:
Colin MacLeod colin.macleod@ivata.com
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.struts.taglib.html.BaseHandlerTag
accesskey, defaultLocale, indexed, messages, tabindex
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
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
LabelTag()
           
 
Method Summary
 int doEndTag()
           Overridden to reset mask properties.
 int doStartTag()
           Overridden to call MaskProperties initialization.
 java.lang.String getAfterText()
          Text to appear after the label.
 java.util.List getArgs()
           
 java.lang.String getBundle()
           Calls MaskProperties#getBundleMaskProperites.getBundle.
 java.lang.String getClassName()
          If you are using the label to display the correct label to show for a given class (rather than a field), this returns the name of that class.
 java.lang.String getFieldName()
           Name of the field to which this label refers.
 java.lang.String getForField()
           Usually, the 'for' attribute is the same as the fieldName but, in the case where mutliple fields have the same name, it is helpful to specify a unique styleId for each one an hence a unique value for the for attribute in the label.
 java.lang.String getKeySuffix()
           Some fields have multiple label keys, depending on circumstances.
 java.lang.String getLabel()
          Get the current text value of the label.
 MaskProperties getMaskProperties()
           Stores and maintains ivata op specific mask properties.
 java.lang.String getResourceFieldPath()
           Resource path of the field within the application resources.
 java.util.List getTitleArgs()
           
 void setAfterText(java.lang.String afterTextParam)
          Refer to getAfterText().
 void setArgs(java.util.List args)
          Refer to MaskProperties.setLabelArgs(java.util.List).
 void setBundle(java.lang.String bundleParam)
          Refer to MaskProperties.setBundle(java.lang.String).
 void setClassName(java.lang.String classNameParam)
          Refer to getClassName().
 void setFieldName(java.lang.String fieldNameParam)
           >Name of the field to which this tag refers.
 void setForField(java.lang.String forFieldParam)
           Usually, the 'for' attribute is the same as the fieldName but, in the case where multiple fields have the same name, it is helpful to specify a unique styleId for each one an hence a unique value for the for attribute in the label.
 void setKeySuffix(java.lang.String keySuffix)
           Some fields have multiple label keys, depending on circumstances.
 void setLabel(java.lang.String labelParam)
           Called by MaskProperties to set the label.
 void setMaskProperties(MaskProperties maskPropertiesParam)
           Stores and maintains ivata op specific mask properties.
 void setResourceFieldPath(java.lang.String resourceFieldPathParam)
           Resource path of the field within the application resources.
 void setTitleArgs(java.util.List args)
          Refer to MaskProperties.setTitleArgs(java.util.List).
 void setTitleKey(java.lang.String titleKey)
           Set the value of the key used to localize the title tag attribute.
 
Methods inherited from class org.apache.struts.taglib.html.BaseHandlerTag
getAccesskey, getAlt, getAltKey, getDisabled, getElementClose, getIndexed, getLocale, getOnblur, getOnchange, getOnclick, getOndblclick, getOnfocus, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnselect, getReadonly, getStyle, getStyleClass, getStyleId, getTabindex, getTitle, getTitleKey, isXhtml, lookupProperty, message, prepareEventHandlers, prepareFocusEvents, prepareIndex, prepareKeyEvents, prepareMouseEvents, prepareStyles, prepareTextEvents, release, setAccesskey, setAlt, setAltKey, setDisabled, setIndexed, setLocale, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setReadonly, setStyle, setStyleClass, setStyleId, setTabindex, setTitle
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Constructor Detail

LabelTag

public LabelTag()
Method Detail

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException

Overridden to reset mask properties.

Returns:
EVAL_PAGE since we always want to evaluate the page after this tag.
Throws:
javax.servlet.jsp.JspException - if there is an error in the mask properties.

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException

Overridden to call MaskProperties initialization.

Returns:
SKIP_BODY as this tag has no body.
Throws:
javax.servlet.jsp.JspException - if there is a problem writing to the page.

getAfterText

public java.lang.String getAfterText()
Text to appear after the label. You probably don't want this for a list.

Returns:
Returns the after text.

getArgs

public final java.util.List getArgs()

getBundle

public final java.lang.String getBundle()

Calls MaskProperties#getBundleMaskProperites.getBundle.

Returns:
the current value of bundle.

getClassName

public java.lang.String getClassName()
If you are using the label to display the correct label to show for a given class (rather than a field), this returns the name of that class.

Returns:
Returns the class name.

getFieldName

public java.lang.String getFieldName()

Name of the field to which this label refers. This is used in conjunction with the resourceFieldPath to retrieve the correct message resources path.

Returns:
the current value of fieldName.

getForField

public java.lang.String getForField()

Usually, the 'for' attribute is the same as the fieldName but, in the case where mutliple fields have the same name, it is helpful to specify a unique styleId for each one an hence a unique value for the for attribute in the label.

Returns:
the current value of forField.

getKeySuffix

public java.lang.String getKeySuffix()

Some fields have multiple label keys, depending on circumstances. This suffix is appended to the key when retrieving the localized text from the application resources file.

Returns:
the current value of keySuffix.

getLabel

public java.lang.String getLabel()
Get the current text value of the label.

Returns:
Returns the label.

getMaskProperties

public MaskProperties getMaskProperties()

Stores and maintains ivata op specific mask properties.

Returns:
the current value of maskProperties.

getResourceFieldPath

public java.lang.String getResourceFieldPath()

Resource path of the field within the application resources. Resources for fields are retrieved by appending the field name to this path. This attribute is used when the label is not surrounded by a form tag.

Returns:
the current value of resourceFieldPath.

getTitleArgs

public final java.util.List getTitleArgs()

setAfterText

public void setAfterText(java.lang.String afterTextParam)
Refer to getAfterText().

Parameters:
afterTextParam - Refer to getAfterText().

setArgs

public final void setArgs(java.util.List args)
Refer to MaskProperties.setLabelArgs(java.util.List).

Parameters:
args - Refer to MaskProperties.setLabelArgs(java.util.List).

setBundle

public void setBundle(java.lang.String bundleParam)
Refer to MaskProperties.setBundle(java.lang.String).

Parameters:
bundleParam - Refer to MaskProperties.setBundle(java.lang.String).

setClassName

public void setClassName(java.lang.String classNameParam)
Refer to getClassName().

Parameters:
classNameParam - Refer to getClassName().

setFieldName

public void setFieldName(java.lang.String fieldNameParam)

>Name of the field to which this tag refers. This is used in conjunction with the resourceFieldPath to retrieve the correct message resources path.

Parameters:
fieldNameParam - the new value of fieldName.

setForField

public void setForField(java.lang.String forFieldParam)

Usually, the 'for' attribute is the same as the fieldName but, in the case where multiple fields have the same name, it is helpful to specify a unique styleId for each one an hence a unique value for the for attribute in the label.

Parameters:
forFieldParam - the new value of forField.

setKeySuffix

public void setKeySuffix(java.lang.String keySuffix)

Some fields have multiple label keys, depending on circumstances. This suffix is appended to the key when retrieving the localized text from the applicaiton resources file.

Parameters:
keySuffix - the new value of keySuffix.

setLabel

public void setLabel(java.lang.String labelParam)

Called by MaskProperties to set the label.

Parameters:
labelParam - new text to be displayed as the label.

setMaskProperties

public void setMaskProperties(MaskProperties maskPropertiesParam)

Stores and maintains ivata op specific mask properties.

Parameters:
maskPropertiesParam - the new value of maskProperties.

setResourceFieldPath

public void setResourceFieldPath(java.lang.String resourceFieldPathParam)

Resource path of the field within the application resources. Resources for fields are retrieved by appending the field name to this path. This attribute is used when the label is not surrounded by a form tag.

Parameters:
resourceFieldPathParam - the new value of resourceFieldPath.

setTitleArgs

public final void setTitleArgs(java.util.List args)
Refer to MaskProperties.setTitleArgs(java.util.List).

Parameters:
args - Refer to MaskProperties.setTitleArgs(java.util.List).

setTitleKey

public final void setTitleKey(java.lang.String titleKey)

Set the value of the key used to localize the title tag attribute.

Parameters:
titleKey - the new value of titleKey.


Copyright © 2001-2005 ivata limited. All Rights Reserved.