net.mlw.vlh.web.tag
Class DefaultRowTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.tagext.BodyTagSupport
          extended bynet.mlw.vlh.web.tag.ConfigurableTag
              extended bynet.mlw.vlh.web.tag.DefaultRowTag
All Implemented Interfaces:
Attributeable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, Serializable, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
DefaultHeaderTag, InvertedRowTag

public class DefaultRowTag
extends ConfigurableTag

This tag creates a table. It is ment to be used along with vlh:root tag. If the valuelist is empty, render only header.

Version:
$Revision: 1.37 $ $Date: 2005/12/15 12:49:12 $
Author:
Matthew L. Wilson, Andrej Zachar
See Also:
Serialized Form

Field Summary
protected  String bean
          The name and type of the bean put in the pageContext.
protected  Object beanInPageScope
           
protected  int currentRowNumber
           
 
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
DefaultRowTag()
           
 
Method Summary
 void addColumnInfo(ColumnInfo column)
          Adds a column to this table.
 int doAfterBody()
           
 int doEndTag()
           
 int doStartTag()
           
 String getBeanName()
          Gets the name of the bean put in the pageContext.
protected  List getColumns()
          Returns list of ColumnInfo objects.
 int getCurrentRowNumber()
          Gets the current row in the iteration.
 DisplayProvider getDisplayProvider()
           
 ValueListSpaceTag getRootTag()
           
 String getRowStyleClass()
           
protected  void init()
          Initialization is called at the beginning of doStart.
protected  boolean isEnabledHeader()
          This option could be overwritten by disableHeader (default set to false)
 boolean isNestedHeader()
           
protected  int processIteration()
          Produces one row.
 void release()
          Called on a Tag handler to release state.
protected  void renderHeaderCell(StringBuffer sb, ColumnInfo columnInfo, TableInfo tableInfo, ValueListInfo vlInfo, Map parameters)
          Renders header cell.
protected  void renderHeaderRow(StringBuffer sb, List columns, TableInfo tableInfo, ValueListInfo vlInfo, Map parameters)
          Renders header row.
protected  void renderNestedHeader(StringBuffer sb, ColumnInfo columnInfo, TableInfo tableInfo, ValueListInfo vlInfo, Map parameters)
           
 void setBean(String bean)
          Sets the name of the bean put in the pageContext.
 void setDisableHeader(boolean disableHeader)
           
 void setDisplay(String display)
           
 void setFocusRowNumber(String focusRowNumber)
           
 void setNestedHeader(boolean nestedHeader)
          Set how to render the header in case of nested value list (the default is true).
 
Methods inherited from class net.mlw.vlh.web.tag.ConfigurableTag
appendClassCellAttribute, getAttributes, getCellAttributes, resetAttributes, setAttributes, setCellAttribute
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
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

currentRowNumber

protected int currentRowNumber

beanInPageScope

protected Object beanInPageScope

bean

protected String bean
The name and type of the bean put in the pageContext.

Constructor Detail

DefaultRowTag

public DefaultRowTag()
Method Detail

init

protected void init()
             throws javax.servlet.jsp.JspException
Initialization is called at the beginning of doStart. Subclasses have to call either super.init() or super.doStart().

Throws:
javax.servlet.jsp.JspException

doStartTag

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

doAfterBody

public int doAfterBody()
                throws javax.servlet.jsp.JspException
Throws:
javax.servlet.jsp.JspException
See Also:
IterationTag.doAfterBody()

renderHeaderRow

protected void renderHeaderRow(StringBuffer sb,
                               List columns,
                               TableInfo tableInfo,
                               ValueListInfo vlInfo,
                               Map parameters)
                        throws javax.servlet.jsp.JspException
Renders header row. Subclasses can overide or extend the method to provide different behaviour.

Parameters:
sb -
tableInfo -
vlInfo -
parameters -
Throws:
javax.servlet.jsp.JspException

renderHeaderCell

protected void renderHeaderCell(StringBuffer sb,
                                ColumnInfo columnInfo,
                                TableInfo tableInfo,
                                ValueListInfo vlInfo,
                                Map parameters)
                         throws javax.servlet.jsp.JspException
Renders header cell. Subclasses can overide or extend the method to provide different behaviour.

Parameters:
sb -
columnInfo -
tableInfo -
vlInfo -
parameters -
Throws:
javax.servlet.jsp.JspException

renderNestedHeader

protected void renderNestedHeader(StringBuffer sb,
                                  ColumnInfo columnInfo,
                                  TableInfo tableInfo,
                                  ValueListInfo vlInfo,
                                  Map parameters)
                           throws javax.servlet.jsp.JspException
Throws:
javax.servlet.jsp.JspException

isEnabledHeader

protected boolean isEnabledHeader()
This option could be overwritten by disableHeader (default set to false)

Returns:
true when at least one column's title is not null. false all titles are null.

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class ConfigurableTag
Throws:
javax.servlet.jsp.JspException
See Also:
Tag.doStartTag()

processIteration

protected int processIteration()
                        throws javax.servlet.jsp.JspException
Produces one row.

Returns:
Throws:
javax.servlet.jsp.JspException - is an error occurs.
See Also:
Tag.doEndTag()

getRootTag

public final ValueListSpaceTag getRootTag()
                                   throws javax.servlet.jsp.JspException
Throws:
javax.servlet.jsp.JspException

getDisplayProvider

public DisplayProvider getDisplayProvider()
                                   throws javax.servlet.jsp.JspException
Returns:
Returns the displayProvider.
Throws:
javax.servlet.jsp.JspException

setDisplay

public void setDisplay(String display)
                throws javax.servlet.jsp.JspException
Throws:
javax.servlet.jsp.JspException

getCurrentRowNumber

public int getCurrentRowNumber()
Gets the current row in the iteration.

Returns:
The current row in the iteration.

addColumnInfo

public void addColumnInfo(ColumnInfo column)
Adds a column to this table.

Parameters:
column - The Column to add.

getColumns

protected List getColumns()
Returns list of ColumnInfo objects.

Returns:
Returns the columns.

setBean

public void setBean(String bean)
Sets the name of the bean put in the pageContext.

Parameters:
bean - The name of the bean put in the pageContext.

getBeanName

public String getBeanName()
Gets the name of the bean put in the pageContext.

Returns:
The name of the bean put in the pageContext.

setFocusRowNumber

public void setFocusRowNumber(String focusRowNumber)
Parameters:
focusRowNumber - (0 is considered to be first row) The focusRowNumber to set.

setDisableHeader

public void setDisableHeader(boolean disableHeader)
Parameters:
disableHeader - The disableHeader to set.

isNestedHeader

public boolean isNestedHeader()
Returns:
Returns the nestedHeader.
See Also:
setNestedHeader(boolean)

setNestedHeader

public void setNestedHeader(boolean nestedHeader)
Set how to render the header in case of nested value list (the default is true).

Parameters:
nestedHeader - false - the header of the nested value list is rendered as a part of the top value list true - the header is rendered for each nested valuelist

getRowStyleClass

public String getRowStyleClass()
                        throws javax.servlet.jsp.JspException
Returns:
style
Throws:
javax.servlet.jsp.JspException

release

public void release()
Called on a Tag handler to release state. The page compiler guarantees that JSP page implementation objects will invoke this method on all tag handlers, but there may be multiple invocations on doStartTag and doEndTag in between.

Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class ConfigurableTag
See Also:
Tag.release()


Copyright © 2003-2006 mlavilson. All Rights Reserved.