org.ujac.web.tag
Class PrintRowTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.ujac.web.tag.BaseTag
              extended by org.ujac.web.tag.PrintRowTag
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, Tag, TemplateContextHolder, RowCellContainer
Direct Known Subclasses:
PrintFooterRowTag, PrintGroupRowTag, PrintGroupTitleRowTag, PrintHeaderRowTag

public class PrintRowTag
extends BaseTag
implements RowCellContainer

Name: PrintRowTag
Description: A custom tag class printing normal rows.

Author:
lauerc
See Also:
Serialized Form

Field Summary
protected  List extraRowsAfter
          The extra rows to print after the data row.
protected  List extraRowsBefore
          The extra rows to print before the data row.
protected  RowCellHolder[] registeredRowCells
          The cell style item map.
protected  PrintTableTag rowContainer
          The surrounding print-table tag.
 
Fields inherited from class org.ujac.web.tag.BaseTag
log
 
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
PrintRowTag()
           
 
Method Summary
protected  String alternateRowStyle()
          Alternates the row style.
protected  boolean checkRowType(Row row)
          Checks the row type.
 int doEndTag()
           
 int doStartTag()
           
protected  String getCellAttributes(String styleClass, String width, String height, String hAlign, String vAlign, int colspan, float paddingLeft, float paddingRight, float paddingTop, float paddingBottom)
          Produces a td/th tag attribute list according to the given attributes.
 String getEvenStyle()
          Getter method for the the property evenStyle.
 String getHeight()
          Getter method for the the property height.
 String getOddStyle()
          Getter method for the the property oddStyle.
 float getPaddingBottom()
          Getter method for the the property paddingBottom.
 float getPaddingLeft()
          Getter method for the the property paddingLeft.
 float getPaddingRight()
          Getter method for the the property paddingRight.
 float getPaddingTop()
          Getter method for the the property paddingTop.
 PrintTableTag getRowContainer()
          Getter method for the the property rowContainer.
 String getStyle()
          Getter method for the the property style.
protected  String getStyleAttribute(String width, String height, String hAlign, String vAlign, float paddingLeft, float paddingRight, float paddingTop, float paddingBottom)
          Produces a td/th tag attribute list according to the given attributes.
 String getValign()
          Getter method for the the property valign.
 void insertExtraRow(ExtraRowHolder extraRow, int insertDirection)
          Inserts a extra row.
protected  boolean isSkipped()
          Getter method for the the property skipped.
protected  PrintTableTag lookupRowContainer()
          Gets the latest row container from the tag stack.
protected  void outputRow()
          Performs the row output.
protected  void outputRow(RowCellHolder[] rowCells, String style, String height, String vAlign, float paddingLeft, float paddingRight, float paddingTop, float paddingBottom)
          Performs the row output.
protected  void printTagStart()
          Prints the tag start code.
 void registerRowCell(RowCellHolder rowCell)
          Registers the given row cell with the print row tag.
 void release()
           
 void setEvenStyle(String evenStyle)
          Setter method for the the property evenStyle.
 void setHeight(String height)
          Setter method for the the property height.
 void setOddStyle(String oddStyle)
          Setter method for the the property oddStyle.
 void setPaddingBottom(float paddingBottom)
          Setter method for the the property paddingBottom.
 void setPaddingLeft(float paddingLeft)
          Setter method for the the property paddingLeft.
 void setPaddingRight(float paddingRight)
          Setter method for the the property paddingRight.
 void setPaddingTop(float paddingTop)
          Setter method for the the property paddingTop.
protected  void setSkipped(boolean skipped)
          Setter method for the the property skipped.
 void setStyle(String style)
          Setter method for the the property style.
 void setValign(String valign)
          Setter method for the the property valign.
 
Methods inherited from class org.ujac.web.tag.BaseTag
clearTagAttributes, getParent, getTagAttribute, getTagAttributes, getTemplateContext, removeTagAttribute, setAttribute, setTagAttribute, writeAttributes
 
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
 

Field Detail

rowContainer

protected PrintTableTag rowContainer
The surrounding print-table tag.


registeredRowCells

protected RowCellHolder[] registeredRowCells
The cell style item map.


extraRowsBefore

protected List extraRowsBefore
The extra rows to print before the data row.


extraRowsAfter

protected List extraRowsAfter
The extra rows to print after the data row.

Constructor Detail

PrintRowTag

public PrintRowTag()
Method Detail

getStyle

public String getStyle()
Getter method for the the property style.

Returns:
The current value of property style.

setStyle

public void setStyle(String style)
Setter method for the the property style.

Parameters:
style - The value to set for the property style.

getEvenStyle

public String getEvenStyle()
Getter method for the the property evenStyle.

Returns:
The current value of property evenStyle.

setEvenStyle

public void setEvenStyle(String evenStyle)
Setter method for the the property evenStyle.

Parameters:
evenStyle - The value to set for the property evenStyle.

getOddStyle

public String getOddStyle()
Getter method for the the property oddStyle.

Returns:
The current value of property oddStyle.

setOddStyle

public void setOddStyle(String oddStyle)
Setter method for the the property oddStyle.

Parameters:
oddStyle - The value to set for the property oddStyle.

getHeight

public String getHeight()
Getter method for the the property height.

Returns:
The current value of property height.

setHeight

public void setHeight(String height)
Setter method for the the property height.

Parameters:
height - The value to set for the property height.

getValign

public String getValign()
Getter method for the the property valign.

Returns:
The current value of property valign.

setValign

public void setValign(String valign)
Setter method for the the property valign.

Parameters:
valign - The value to set for the property valign.

getPaddingLeft

public float getPaddingLeft()
Getter method for the the property paddingLeft.

Returns:
The current value of property paddingLeft.

setPaddingLeft

public void setPaddingLeft(float paddingLeft)
Setter method for the the property paddingLeft.

Parameters:
paddingLeft - The value to set for the property paddingLeft.

getPaddingRight

public float getPaddingRight()
Getter method for the the property paddingRight.

Returns:
The current value of property paddingRight.

setPaddingRight

public void setPaddingRight(float paddingRight)
Setter method for the the property paddingRight.

Parameters:
paddingRight - The value to set for the property paddingRight.

getPaddingTop

public float getPaddingTop()
Getter method for the the property paddingTop.

Returns:
The current value of property paddingTop.

setPaddingTop

public void setPaddingTop(float paddingTop)
Setter method for the the property paddingTop.

Parameters:
paddingTop - The value to set for the property paddingTop.

getPaddingBottom

public float getPaddingBottom()
Getter method for the the property paddingBottom.

Returns:
The current value of property paddingBottom.

setPaddingBottom

public void setPaddingBottom(float paddingBottom)
Setter method for the the property paddingBottom.

Parameters:
paddingBottom - The value to set for the property paddingBottom.

registerRowCell

public void registerRowCell(RowCellHolder rowCell)
Registers the given row cell with the print row tag.

Specified by:
registerRowCell in interface RowCellContainer
Parameters:
rowCell - The row cell to register.

isSkipped

protected boolean isSkipped()
Getter method for the the property skipped.

Returns:
The current value of property skipped.

setSkipped

protected void setSkipped(boolean skipped)
Setter method for the the property skipped.

Parameters:
skipped - The value to set for the property skipped.

getRowContainer

public PrintTableTag getRowContainer()
Getter method for the the property rowContainer.

Returns:
The current value of property rowContainer.

getCellAttributes

protected String getCellAttributes(String styleClass,
                                   String width,
                                   String height,
                                   String hAlign,
                                   String vAlign,
                                   int colspan,
                                   float paddingLeft,
                                   float paddingRight,
                                   float paddingTop,
                                   float paddingBottom)
Produces a td/th tag attribute list according to the given attributes.

Parameters:
styleClass - The style class.
width - The field width.
height - The field height.
hAlign - The horizontal alignment.
vAlign - The vertical alignment.
colspan - The column span.
paddingLeft - The left padding.
paddingRight - The right padding.
paddingTop - The top padding.
paddingBottom - The bottom padding.
Returns:
The generated attribute list string.

getStyleAttribute

protected String getStyleAttribute(String width,
                                   String height,
                                   String hAlign,
                                   String vAlign,
                                   float paddingLeft,
                                   float paddingRight,
                                   float paddingTop,
                                   float paddingBottom)
Produces a td/th tag attribute list according to the given attributes.

Parameters:
width - The field width.
height - The field height.
hAlign - The horizontal alignment.
vAlign - The vertical alignment.
paddingLeft - The left padding.
paddingRight - The right padding.
paddingTop - The top padding.
paddingBottom - The bottom padding.
Returns:
The generated attribute list string.

insertExtraRow

public void insertExtraRow(ExtraRowHolder extraRow,
                           int insertDirection)
Inserts a extra row.

Parameters:
extraRow - The extra row to insert.
insertDirection - The insert direction.

doStartTag

public int doStartTag()
               throws JspException
Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class BaseTag
Throws:
JspException
See Also:
BodyTagSupport.doStartTag()

checkRowType

protected boolean checkRowType(Row row)
Checks the row type.

Parameters:
row - The row to check.
Returns:
true if the row is valid for output, else false.

printTagStart

protected void printTagStart()
Prints the tag start code.


doEndTag

public int doEndTag()
             throws JspException
Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class BodyTagSupport
Throws:
JspException
See Also:
BodyTagSupport.doEndTag()

outputRow

protected void outputRow()
                  throws JspException
Performs the row output.

Throws:
JspException - Thrown in case something went wrong while closing the foreach item.

outputRow

protected void outputRow(RowCellHolder[] rowCells,
                         String style,
                         String height,
                         String vAlign,
                         float paddingLeft,
                         float paddingRight,
                         float paddingTop,
                         float paddingBottom)
                  throws JspException
Performs the row output.

Parameters:
rowCells - The row cells to render.
style - The style class.
height - The field height.
hAlign - The horizontal alignment.
paddingLeft - The left padding.
paddingRight - The right padding.
paddingTop - The top padding.
paddingBottom - The bottom padding.
Throws:
JspException - Thrown in case something went wrong while closing the foreach item.

release

public void release()
Specified by:
release in interface Tag
Overrides:
release in class BaseTag
See Also:
BodyTagSupport.release()

lookupRowContainer

protected PrintTableTag lookupRowContainer()
Gets the latest row container from the tag stack.

Returns:
The latest row container from the tag stack or null.

alternateRowStyle

protected String alternateRowStyle()
Alternates the row style.

Returns:
The style to use for the current row.


Copyright © 2003-2004 UJAC.org. All Rights Reserved.