|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
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.hyperic.hq.ui.taglib.display.TemplateTag
org.hyperic.hq.ui.taglib.display.TablePropertyTag
org.hyperic.hq.ui.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 java.util.Hashtable |
nextRow
|
protected java.util.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 java.lang.String |
autoLink(java.lang.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 java.lang.StringBuffer |
generateRow(java.lang.Object row,
int rowcnt)
Format the row as HTML. |
protected java.lang.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 java.lang.String |
getTableFooter()
Generates table footer with links for export commands. |
protected java.lang.String |
getTableHeader()
Generates the table header, including the first row of the table which displays the titles of the various columns. |
java.util.List |
getViewableData()
This returns a list of all of the data that will be displayed on the page via the table tag. |
protected java.lang.String |
group(java.lang.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). |
java.lang.Object |
lookup(javax.servlet.jsp.PageContext pageContext,
java.lang.String name,
java.lang.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. |
java.lang.Object |
lookup(javax.servlet.jsp.PageContext pageContext,
java.lang.String name,
java.lang.String property,
java.lang.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(java.lang.String string)
Sets the content of the footer. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Called by the setProperty tag to override some default behavior or text string. |
protected void |
sortDataIfNeeded(java.util.List viewableData)
This method will sort the data in either ascending or decending order based on the user clicking on the column headers. |
Methods inherited from class org.hyperic.hq.ui.taglib.display.TemplateTag |
---|
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 java.util.Hashtable previousRow
protected java.util.Hashtable nextRow
Constructor Detail |
---|
public TableTag()
Method Detail |
---|
public void release()
release
in interface javax.servlet.jsp.tagext.Tag
release
in class javax.servlet.jsp.tagext.BodyTagSupport
public void addColumn(ColumnTag obj)
obj
- an internal tag describing a column in this tableviewpublic int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
public int doAfterBody() throws javax.servlet.jsp.JspException
doAfterBody
in interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
- if a JSP exception has occurredpublic int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
public java.util.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.JspException
protected void sortDataIfNeeded(java.util.List viewableData)
viewableData
- The list passed into this mehtod will be sorted.protected java.lang.StringBuffer generateRow(java.lang.Object row, int rowcnt) throws javax.servlet.jsp.JspException
row
- The list object to format as HTML.
javax.servlet.jsp.JspException
protected java.lang.String getTableHeader() throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException
protected java.lang.String getTableFooter() throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException
protected java.lang.String group(java.lang.String value, int group)
protected java.lang.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 java.lang.Object lookup(javax.servlet.jsp.PageContext pageContext, java.lang.String name, java.lang.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 java.lang.Object lookup(javax.servlet.jsp.PageContext pageContext, java.lang.String name, java.lang.String property, java.lang.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.JspException
protected java.lang.String autoLink(java.lang.String data)
public void setProperty(java.lang.String name, java.lang.String value)
public void setFooter(java.lang.String string)
string
- footer contentprotected boolean isFirstIteration()
true
if this is the first iterationprotected void evaluateAttributes() throws javax.servlet.jsp.JspTagException
javax.servlet.jsp.JspTagException
|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |