org.figure8.join.control.taglib
Class CssRowTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.figure8.join.control.taglib.ContextTag
              extended by org.figure8.join.control.taglib.CssRowTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class CssRowTag
extends ContextTag

Use this custom tag for rendering different styles for table rows depending if the row index is pair or unpair. The row index must be stored into a scoped bean, this tag retrieves it, evaluates it and write to ouput the correct CSS style to render.

Version:
$Revision: 1.2 $
Author:
Laurent Broudoux
See Also:
Serialized Form

Field Summary
 
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
CssRowTag()
           
 
Method Summary
 int doStartTag()
          Retrieve bean from pageContext using specified scope.
 java.lang.String getEven()
           
 java.lang.String getName()
           
 java.lang.String getOdd()
           
 java.lang.String getScope()
           
 void release()
          Release all allocated resources.
 void setEven(java.lang.String even)
           
 void setName(java.lang.String name)
           
 void setOdd(java.lang.String odd)
           
 void setScope(java.lang.String scope)
           
 
Methods inherited from class org.figure8.join.control.taglib.ContextTag
findBeanInScope, storeBeanInScope
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doEndTag, 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

CssRowTag

public CssRowTag()
Method Detail

getName

public java.lang.String getName()
Returns:
Name of the bean to evaluate.

setName

public void setName(java.lang.String name)
Parameters:
name - The name of the bean to evaluate.

getScope

public java.lang.String getScope()
Returns:
The scope where we can find the bean name.

setScope

public void setScope(java.lang.String scope)
Parameters:
scope - The scope where we can find the bean name.

getOdd

public java.lang.String getOdd()
Returns:
The CSS class to apply if bean is odd

setOdd

public void setOdd(java.lang.String odd)
Parameters:
odd - The CSS class to apply if bean is odd

getEven

public java.lang.String getEven()
Returns:
The CSS class to apply if bean is even

setEven

public void setEven(java.lang.String even)
Parameters:
even - The CSS class to apply if bean is even

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Retrieve bean from pageContext using specified scope. Then test if it is castable into an Integer ; eval this int value ant writer to JSP the class="X" string where X is either the even or the odd class.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
JSP execution code for continuing evaluation (SKIP_BODY)
Throws:
javax.servlet.jsp.JspException - if mandatory parameters are not provided, or exception occurs...

release

public void release()
Release all allocated resources.

Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class javax.servlet.jsp.tagext.BodyTagSupport


Copyright © 2005-2008 Join. All Rights Reserved.