|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.rhq.enterprise.gui.legacy.taglib.display.TemplateTag
org.rhq.enterprise.gui.legacy.taglib.display.TablePropertyTag
org.rhq.enterprise.gui.legacy.taglib.display.TableTag
public class TableTag
This tag takes a list of objects and creates a table to display those objects. With the help of column tags, you simply provide the name of properties (get Methods) that are called against the objects in your list that gets displayed [[reword that...]]
This tag works very much like the struts iterator tag, most of the attributes have the same name and functionality as the struts tag. Simple Usage:
name property scope length offset pageSize decorator HTML Pass-through Attributes There are a number of additional attributes that just get passed through to the underlying HTML table declaration. With the exception of the following few default values, if these attributes are not provided, they will not be displayed as part of the
| Field Summary | |
|---|---|
protected Hashtable |
nextRow
|
protected Hashtable |
previousRow
|
| 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 | |
|---|---|
TableTag()
|
|
| Method Summary | |
|---|---|
void |
addColumn(ColumnTag obj)
Called by interior column tags to help this tag figure out how it is supposed to display the information in the List it is supposed to display |
protected String |
autoLink(String data)
This takes the string that is passed in, and "auto-links" it, it turns email addresses into hyperlinks, and also turns things that looks like URLs into hyperlinks as well. |
int |
doAfterBody()
Make the next collection element available and loop, or finish the iterations if there are no more elements. |
int |
doEndTag()
Draw the table. |
int |
doStartTag()
When the tag starts, we just initialize some of our variables, and do a little bit of error checking to make sure that the user is not trying to give us parameters that we don't expect. |
protected void |
evaluateAttributes()
|
protected StringBuffer |
generateRow(Object row,
int rowcnt)
Format the row as HTML. |
String |
getOnlyForProperty()
|
String |
getPostfix()
|
protected String |
getTableAttributes()
Takes all the table pass-through arguments and bundles them up as a string that gets tacked on to the end of the table tag declaration. |
protected String |
getTableFooter()
Generates table footer with links for export commands. |
protected String |
getTableHeader()
Generates the table header, including the first row of the table which displays the titles of the various columns. |
List |
getViewableData()
This returns a list of all of the data that will be displayed on the page via the table tag. |
protected String |
group(String value,
int group)
This takes a cloumn value and grouping index as the argument. |
protected boolean |
isFirstIteration()
Is this the first iteration? |
protected Decorator |
loadDecorator()
If the user has specified a decorator, then this method takes care of creating the decorator (and checking to make sure it is a subclass of the TableDecorator object). |
Object |
lookup(javax.servlet.jsp.PageContext pageContext,
String name,
String scope)
This functionality is borrowed from struts, but I've removed some struts specific features so that this tag can be used both in a struts application, and outside of one. |
Object |
lookup(javax.servlet.jsp.PageContext pageContext,
String name,
String property,
String scope,
boolean useDecorator)
This functionality is borrowed from struts, but I've removed some struts specific features so that this tag can be used both in a struts application, and outside of one. |
void |
release()
|
void |
setFooter(String string)
Sets the content of the footer. |
void |
setOnlyForProperty(String onlyForProperty)
|
void |
setPostfix(String postfix)
|
void |
setProperty(String name,
String value)
Called by the setProperty tag to override some default behavior or text string. |
| Methods inherited from class org.rhq.enterprise.gui.legacy.taglib.display.TablePropertyTag |
|---|
getAction, getAlign, getBackground, getBgcolor, getBorder, getCellpadding, getCellspacing, getDecorator, getDisplay, getEmptyMsg, getExport, getFrame, getHeight, getHspace, getIncludeTotals, getItems, getLength, getNowrapHeader, getOffset, getParamId, getParamName, getParamProperty, getParamScope, getProperty, getRules, getScope, getStyleClass, getStyleId, getSummary, getVar, getVspace, getWidth, isLeftSidebar, isPadRows, isRightSidebar, setAction, setAlign, setBackground, setBgcolor, setBorder, setCellpadding, setCellspacing, setDecorator, setDisplay, setEmptyMsg, setExport, setFrame, setHeight, setHspace, setIncludeTotals, setItems, setLeftSidebar, setLength, setNowrapHeader, setOffset, setPadRows, setParamId, setParamName, setParamProperty, setParamScope, setProperty, setRightSidebar, setRules, setScope, setStyleClass, setStyleId, setSummary, setVar, setVspace, setWidth |
| Methods inherited from class org.rhq.enterprise.gui.legacy.taglib.display.TemplateTag |
|---|
write, write, write |
| 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 |
|---|
protected Hashtable previousRow
protected Hashtable nextRow
| Constructor Detail |
|---|
public TableTag()
| Method Detail |
|---|
public void release()
release in interface javax.servlet.jsp.tagext.Tagrelease in class javax.servlet.jsp.tagext.BodyTagSupportpublic void addColumn(ColumnTag obj)
obj - an internal tag describing a column in this tableview
public int doStartTag()
throws javax.servlet.jsp.JspException
doStartTag in interface javax.servlet.jsp.tagext.TagdoStartTag in class javax.servlet.jsp.tagext.BodyTagSupportjavax.servlet.jsp.JspException
public int doAfterBody()
throws javax.servlet.jsp.JspException
doAfterBody in interface javax.servlet.jsp.tagext.IterationTagdoAfterBody in class javax.servlet.jsp.tagext.BodyTagSupportjavax.servlet.jsp.JspException - if a JSP exception has occurred
public int doEndTag()
throws javax.servlet.jsp.JspException
doEndTag in interface javax.servlet.jsp.tagext.TagdoEndTag in class javax.servlet.jsp.tagext.BodyTagSupportjavax.servlet.jsp.JspExceptionpublic List getViewableData() throws javax.servlet.jsp.JspException
The list that is returned from here is not the original list, but it does contain references to the same objects in the original list, so that means that we can sort and reorder the list, but we can't mess with the data objects in the list.
javax.servlet.jsp.JspExceptionprotected StringBuffer generateRow(Object row, int rowcnt) throws javax.servlet.jsp.JspException
row - The list object to format as HTML.
javax.servlet.jsp.JspExceptionprotected String getTableHeader() throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspExceptionprotected String getTableFooter() throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspExceptionprotected String group(String value, int group)
protected String getTableAttributes()
Note that we override some default behavior, specifically:
width defaults to 100% if not provided border defaults to 0 if not provided cellspacing defaults to 1 if not provided cellpadding defaults to 2 if not provided
public Object lookup(javax.servlet.jsp.PageContext pageContext, String name, String scope) throws javax.servlet.jsp.JspException
null instead.
pageContext - Page context to be searchedname - Name of the bean to be retrievedscope - Scope to be searched (page, request, session, application) or null to use
findAttribute() instead
javax.servlet.jsp.JspException - if an invalid scope name is requestedpublic Object lookup(javax.servlet.jsp.PageContext pageContext, String name, String property, String scope, boolean useDecorator) throws javax.servlet.jsp.JspException
pageContext - Page context to be searchedname - Name of the bean to be retrievedproperty - Name of the property to be retrieved, or null to retrieve the bean itselfscope - Scope to be searched (page, request, session, application) or null to use
findAttribute() instead
javax.servlet.jsp.JspException - if an invalid scope name is requested
javax.servlet.jsp.JspException - if the specified bean is not found
javax.servlet.jsp.JspException - if accessing this property causes an IllegalAccessException, IllegalArgumentException,
InvocationTargetException, or NoSuchMethodExceptionprotected Decorator loadDecorator() throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspExceptionprotected String autoLink(String data)
public void setProperty(String name, String value)
public void setFooter(String string)
string - footer contentprotected boolean isFirstIteration()
true if this is the first iteration
protected void evaluateAttributes()
throws javax.servlet.jsp.JspTagException
javax.servlet.jsp.JspTagExceptionpublic String getPostfix()
public void setPostfix(String postfix)
public String getOnlyForProperty()
public void setOnlyForProperty(String onlyForProperty)
onlyForProperty - the onlyForProperty to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||