Package org.jivesoftware.admin
Class TabsTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.jivesoftware.admin.TabsTag
- All Implemented Interfaces:
Serializable,javax.servlet.jsp.tagext.BodyTag,javax.servlet.jsp.tagext.IterationTag,javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.tagext.Tag
public class TabsTag
extends javax.servlet.jsp.tagext.BodyTagSupport
A simple JSP tag for displaying tab information in the admin console. The
SidebarTag is similiar to this one.
Attributes:
bean(required) - the id of the request attribute which is aAdminPageBeaninstance. This class holds information needed to properly render the admin console tabs.css(optional) - the CSS class name used to decorate the LI of the tab.currentcss(optional) - the CSS class name used to decorate the LI of the currently selected tab.
This class assumes there is a request attribute with the name specified by the bean attribute.
This tag prints out minimal HTML. It basically prints an unordered list (UL element) with each LI containing an "A" tag specfied by the body content of this tag. For example, the body should contain a template A tag which will have its values replaced at runtime:
<jive:tabs bean="jivepageinfo"> <br>
<a href="[url]" title="[description]">[name]</a> <br>
</jive:tabs>
Available token are: [id]- the ID of the tab, usually not needed.[name]- the name of the tab, should be thought of as the display name.[url]- the URL of the tab.[description]- the description of the tab, good for mouse rollovers.
- See Also:
-
Field Summary
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContentFields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContextFields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAGFields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdoEndTag()Gets theAdminPageBeaninstance from the request.intDoes nothing, returnsBodyTag.EVAL_BODY_BUFFEREDalways.getBean()The name of the request attribute which holds aAdminPageBeaninstance.getCss()Returns the value of the CSS class to be used for tab decoration.Returns the value of the CSS class to be used for the currently selected LI (tab).Returns whether we are in just links mode.voidSets the name of the request attribute to hold aAdminPageBeaninstance.voidSets the CSS used for tab decoration.voidsetCurrentcss(String currentcss) Sets the CSS class value for the currently selected tab.voidsetJustlinks(Boolean justlinks) Sets whether we are just to display links, no list.Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, release, setBodyContentMethods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
-
Constructor Details
-
TabsTag
public TabsTag()
-
-
Method Details
-
getBean
The name of the request attribute which holds aAdminPageBeaninstance.- Returns:
- the name of the bean
-
setBean
Sets the name of the request attribute to hold aAdminPageBeaninstance.- Parameters:
bean- the name of the bean
-
getCss
Returns the value of the CSS class to be used for tab decoration. If not set will return a blank string.- Returns:
- the CSS
-
setCss
Sets the CSS used for tab decoration.- Parameters:
css- the CSS
-
getCurrentcss
Returns the value of the CSS class to be used for the currently selected LI (tab). If not set will return a blank string.- Returns:
- the CSS class
-
setCurrentcss
Sets the CSS class value for the currently selected tab.- Parameters:
currentcss- the CSS class
-
getJustlinks
Returns whether we are in just links mode.- Returns:
trueif just displaying links, otherwisefalse
-
setJustlinks
Sets whether we are just to display links, no list.- Parameters:
justlinks-trueto just display links, otherwisefalse
-
doStartTag
public int doStartTag() throws javax.servlet.jsp.JspExceptionDoes nothing, returnsBodyTag.EVAL_BODY_BUFFEREDalways.- Specified by:
doStartTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classjavax.servlet.jsp.tagext.BodyTagSupport- Throws:
javax.servlet.jsp.JspException
-
doEndTag
public int doEndTag() throws javax.servlet.jsp.JspExceptionGets theAdminPageBeaninstance from the request. If it doesn't exist then execution is stopped and nothing is printed. If it exists, retrieve values from it and render the tabs. The body content of the tag is assumed to have an A tag in it with tokens to replace (see class description).- Specified by:
doEndTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classjavax.servlet.jsp.tagext.BodyTagSupport- Returns:
Tag.EVAL_PAGEafter rendering the tabs.- Throws:
javax.servlet.jsp.JspException- if an exception occurs while rendering the tabs.
-