com.cc.framework.taglib.base
Class OptionsTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended bycom.cc.framework.taglib.base.OptionsTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class OptionsTag
extends javax.servlet.jsp.tagext.TagSupport

Tag handler for the options Tag. The tag generates the option list with the help of a data model for a <html:select>- or <forms:select>-tag. The tag can thereby process some of the basic data types of the framework.

Since:
1.0
Version:
$Revision: 1.35 $
Author:
Harald Schulz
See Also:
Serialized Form

Field Summary
private  OptionListDesignModel designModel
          The design model
private  org.apache.commons.logging.Log log
          Commons Logging instance.
private  java.lang.String name
          Field name
private static long serialVersionUID
          Serial Version UID
private static java.lang.Class strutsSelectTag
          Select Tag of the struts framework
 
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
OptionsTag()
          Constructor
 
Method Summary
 int doEndTag()
           
 int doStartTag()
           
 OptionListDesignModel getDesignModel()
          Retrieves or creates the design model
protected  java.lang.Object lookupBean()
          Retrieves the bean which holds the Display Data or Control Instance
 void release()
           
 void setEmpty(java.lang.String empty)
          Specifies the label of an additional empty-entry.
 void setFilter(java.lang.String filter)
          The automatic HTML coding of the column contents can be activated or disabled with the filter-attribute.
 void setImagemap(java.lang.String mapName)
          Specifies the name of an image map which must be saved in the request.
 void setKeyProperty(java.lang.String keyProperty)
          Specifies the name of the property which returns the key of the option.
 void setLabelProperty(java.lang.String labelProperty)
          Specifies the name of the property which supplies the display text of the option.
 void setLocalize(java.lang.String localize)
          If this flag is set to true the framework interprets all labels as resource identifiers and localize them.
 void setMaxlength(java.lang.String maxlength)
          Specifies the maximum number of characters that are displayed for the option elements
 void setName(java.lang.String name)
          Specifies the name of the Java-Bean.
 void setPageContext(javax.servlet.jsp.PageContext pc)
           
 void setProperty(java.lang.String property)
          Specifies the name of the property using which the Java-Bean is to be accessed.
 void setRoot(java.lang.String value)
          Specifies whether the root node of the tree structure (Level 0) should be displayed or whether the display should first start at the next tree level (Level 1).
 void setStyle(java.lang.String style)
          An HTML-style can be directly specified with this attribute.
 void setStyleClass(java.lang.String styleClass)
          The HTML-class attribute of the element can be specified with this attribute.
 void setTooltipProperty(java.lang.String tooltipProperty)
          Specifies the name of the property which supplies the tooltip text of the option.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial Version UID

See Also:
Constant Field Values

strutsSelectTag

private static java.lang.Class strutsSelectTag
Select Tag of the struts framework


log

private transient org.apache.commons.logging.Log log
Commons Logging instance.


name

private java.lang.String name
Field name


designModel

private OptionListDesignModel designModel
The design model

Constructor Detail

OptionsTag

public OptionsTag()
Constructor

Method Detail

release

public void release()
See Also:
Tag.release()

setPageContext

public void setPageContext(javax.servlet.jsp.PageContext pc)
See Also:
Tag.setPageContext(PageContext pc)

getDesignModel

public OptionListDesignModel getDesignModel()
Retrieves or creates the design model

Returns:
OptionListDesignModel

lookupBean

protected java.lang.Object lookupBean()
                               throws javax.servlet.jsp.JspException
Retrieves the bean which holds the Display Data or Control Instance

Returns:
Bean (Control instance or DataModel)
Throws:
javax.servlet.jsp.JspException - Is thrown when the bean could not be found

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Throws:
javax.servlet.jsp.JspException
See Also:
Tag.doStartTag()

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Throws:
javax.servlet.jsp.JspException
See Also:
Tag.doEndTag()

setName

public void setName(java.lang.String name)
Specifies the name of the Java-Bean. The Java-Bean must be stored in the given scope. When the tag is surrounded by a Struts <html:form> tag, no Bean Name need be specified. In this case, the Java-Bean is drawn via a property of the Struts Form Bean.

Parameters:
name - The name to set

setProperty

public void setProperty(java.lang.String property)
                 throws javax.servlet.jsp.JspException
Specifies the name of the property using which the Java-Bean is to be accessed. This is generally only necessary when the Java-Bean is associated with a Struts Form Bean.

Parameters:
property - The name of the property
Throws:
javax.servlet.jsp.JspException

setStyle

public void setStyle(java.lang.String style)
An HTML-style can be directly specified with this attribute.

Parameters:
style - The style to set

setStyleClass

public void setStyleClass(java.lang.String styleClass)
The HTML-class attribute of the element can be specified with this attribute.

Parameters:
styleClass - The styleClass to set

setEmpty

public void setEmpty(java.lang.String empty)
Specifies the label of an additional empty-entry. What is involved here is an entry with an empty key. This is always required when the null-value is also to be offered in the list.

Parameters:
empty - The text to display for the user to make a selection like ""

setKeyProperty

public void setKeyProperty(java.lang.String keyProperty)
Specifies the name of the property which returns the key of the option. Note: Valid Java designator/label for a property which has to be implemented from the elements of the collection

Parameters:
keyProperty - The keyProperty to set

setLabelProperty

public void setLabelProperty(java.lang.String labelProperty)
Specifies the name of the property which supplies the display text of the option.

Parameters:
labelProperty - The labelProperty to set

setTooltipProperty

public void setTooltipProperty(java.lang.String tooltipProperty)
Specifies the name of the property which supplies the tooltip text of the option.

Parameters:
tooltipProperty - The tooltip Property to set

setMaxlength

public void setMaxlength(java.lang.String maxlength)
                  throws javax.servlet.jsp.JspException
Specifies the maximum number of characters that are displayed for the option elements

Parameters:
maxlength - The maximum number of characters
Throws:
javax.servlet.jsp.JspException - If the Argument can't be converted to integer

setFilter

public void setFilter(java.lang.String filter)
               throws javax.servlet.jsp.JspException
The automatic HTML coding of the column contents can be activated or disabled with the filter-attribute. The default is true

Parameters:
filter - true if the column content should be HTML encoded.
Throws:
javax.servlet.jsp.JspException - If the Argument can't be converted to boolean

setLocalize

public void setLocalize(java.lang.String localize)
                 throws javax.servlet.jsp.JspException
If this flag is set to true the framework interprets all labels as resource identifiers and localize them. If the flag is set to false the labels are treated as string literals without localization.

Parameters:
localize - Localization setting for the option list
Throws:
javax.servlet.jsp.JspException - If the Argument can't be converted to boolean

setImagemap

public void setImagemap(java.lang.String mapName)
                 throws javax.servlet.jsp.JspException
Specifies the name of an image map which must be saved in the request. The values that the option list getKey() method returns are mapped to the entries of this image map. The mapping is done with the help of the regular expression, which is assigned to every entry of the image map.

Parameters:
mapName - The ImageMap to assign
Throws:
javax.servlet.jsp.JspException - If the ImageMap can not be found

setRoot

public void setRoot(java.lang.String value)
             throws javax.servlet.jsp.JspException
Specifies whether the root node of the tree structure (Level 0) should be displayed or whether the display should first start at the next tree level (Level 1).

Parameters:
value - false if the root element should not be displayed
Throws:
javax.servlet.jsp.JspException - if the argument can not be converted to a boolean value


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.