Class TabControl
- java.lang.Object
-
- javax.servlet.jsp.tagext.TagSupport
-
- net.sf.basedb.clients.web.taglib.StylableTag
-
- net.sf.basedb.clients.web.taglib.tab.TabControl
-
- All Implemented Interfaces:
Serializable
,DynamicAttributes
,IterationTag
,JspTag
,Tag
,DynamicActionAttributes
,Renderer<TabAction>
public class TabControl extends StylableTag implements Renderer<TabAction>
This is the main tag for the tab control. It must always be present as the outermost tag. Use one or moreTab
tags to define each tab inside the tabcontrol.Syntax:
<t:tabcontrol id=... clazz=... subclass=... style=... contentstyle=... active=... position=... notabs=true|false extensions=... >
Tag attributes Attribute Default value Required Description id - yes The ID of the tab control. The value of this attribute goes directly into the standard id
attribute. This means that if you need a reference to the tab control object in your own JavaScript code, you may for example use the following code:tabcontrol = document.getElementById('<id>');
clazz tabcontrol no The value if this attribute goes directly into the standard HTML class
attribute. This allows you to apply different styles to different tables.subclass - no Additional classes to put in the HTML class attribute. Doesn't replace the main class attribute. style - no The value if this attribute goes directly into the standard HTML style
attribute. This allows you to apply different styles to different tabcontrols.contentstyle - no The value if this attribute goes directly into the standard HTML style
attribute for the content section. This allows you to apply different styles to different tabcontrols.active - no The id of the tab that should be active to begin with. If no value is specified the first tab is automatically made active. position top no The position of the tabs in relation to the content. The default value is to display the tabs at the top. The only other allowed value is bottom
.notabs false no If the tabcontrol should display tabs or not. If false the tab control will not output any HTML except the contents of the active tab. extensions - no An ExtensionsInvoker
forTabAction
extensions. All actions will be rendered by this tabcontrol after all the normally defined tags have been rendered. Since BASE 2.17.- Version:
- 2.0
- Author:
- Nicklas
- See Also:
Tab
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private String
active
The ID attribute of the active tab.static int
BOTTOM
Tabs are at the bottom of the tab control.private StringBuilder
content
The HTML for the contents of the tabs.private String
contentStyle
Optionalstyle
attribute for the content sectionprivate ExtensionsInvoker<TabAction>
extensions
private String
initialTab
The ID of the tab that is initially active.private boolean
noTabs
If the tabs should be displayed or not.private int
numTabs
The number of tabs.private int
position
The position of the tabs.private boolean
remember
If it should try to remember the last active tab on the pageprivate static long
serialVersionUID
private StringBuilder
tabs
The HTML for the tabs.static int
TOP
Tabs are at the top of the tab control.-
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
-
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
Constructors Constructor Description TabControl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
addTab(TabAction tab)
int
doEndTag()
int
doStartTag()
String
getActive()
String
getContentstyle()
void
render(TabAction action)
Render the action in the client application.void
setActive(String active)
void
setContentstyle(String contentStyle)
void
setExtensions(ExtensionsInvoker<TabAction> extensions)
void
setNotabs(boolean noTabs)
void
setPosition(String position)
void
setRemember(boolean remember)
-
Methods inherited from class net.sf.basedb.clients.web.taglib.StylableTag
addDynamicAttributes, addIdAndStyles, getClazz, getDynamicActionAttributes, getDynamicAttribute, getFullClass, getIdPrefix, getStyle, getSubclass, initDefaultAttributes, setClazz, setDynamicAttribute, setMoreDynamicAttributes, setPageContext, setStyle, setSubclass
-
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setParent, setValue
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
contentStyle
private String contentStyle
Optionalstyle
attribute for the content section
-
active
private String active
The ID attribute of the active tab.
-
position
private int position
The position of the tabs.
-
remember
private boolean remember
If it should try to remember the last active tab on the page
-
noTabs
private boolean noTabs
If the tabs should be displayed or not.
-
extensions
private ExtensionsInvoker<TabAction> extensions
-
initialTab
private String initialTab
The ID of the tab that is initially active.
-
numTabs
private int numTabs
The number of tabs.
-
tabs
private StringBuilder tabs
The HTML for the tabs.
-
content
private StringBuilder content
The HTML for the contents of the tabs.
-
TOP
public static final int TOP
Tabs are at the top of the tab control.- See Also:
- Constant Field Values
-
BOTTOM
public static final int BOTTOM
Tabs are at the bottom of the tab control.- See Also:
- Constant Field Values
-
-
Method Detail
-
setContentstyle
public void setContentstyle(String contentStyle)
-
getContentstyle
public String getContentstyle()
-
setActive
public void setActive(String active)
-
getActive
public String getActive()
-
setPosition
public void setPosition(String position)
-
setExtensions
public void setExtensions(ExtensionsInvoker<TabAction> extensions)
-
setRemember
public void setRemember(boolean remember)
-
setNotabs
public void setNotabs(boolean noTabs)
-
addTab
void addTab(TabAction tab)
-
doStartTag
public int doStartTag() throws JspException
- Specified by:
doStartTag
in interfaceTag
- Overrides:
doStartTag
in classTagSupport
- Throws:
JspException
-
doEndTag
public int doEndTag() throws JspException
- Specified by:
doEndTag
in interfaceTag
- Overrides:
doEndTag
in classTagSupport
- Throws:
JspException
-
-