Package net.sf.basedb.clients.web.taglib
Class Icon
- java.lang.Object
-
- javax.servlet.jsp.tagext.TagSupport
-
- net.sf.basedb.clients.web.taglib.StylableTag
-
- net.sf.basedb.clients.web.taglib.Icon
-
- All Implemented Interfaces:
Serializable
,DynamicAttributes
,IterationTag
,JspTag
,Tag
,DynamicActionAttributes
public class Icon extends StylableTag
This tag is used to make it easier to display icons on a BASE web page.Example:
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> <base:icon image="required.png" />
Syntax:
<base:icon id=... clazz=... style=... image=... tooltip=... visible=... tabindex=... >
Tag attributes Attribute Default value Required Description id - no The ID of the icon. The value of this attribute goes directly into the standard id
attribute. This means that if you need a reference to the note object in your own JavaScript code, you may for example use the following code:icon = document.getElementById('<id>');
clazz icon no The value if this attribute goes directly into the standard HTML class
attribute. This allows you to apply different styles to different icons.style - no The value if this attribute goes directly into the standard HTML style
attribute. This allows you to apply different styles to different icons.image yes The name of the image to display. The image must be in the /images
directory. Only include the filename, not the path. This taglib will find the correct path from the current jsp page.tooltip no A short explanation that will show up as a tooltip. visible true no If the note should be visible or not. tabindex 0 no Tab index value to control the focus order. Use -1 to disable tabbing to the icon. - Version:
- 2.0
- Author:
- Nicklas
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
enabled
If the icon should be enabled or not (if an onclick has been set).private String
href
If present, the icon is enclosed with an <a> tag that opens the given url in a new window.private String
image
The filename of the image.private Page
page
The parent <base:page> tag.private static long
serialVersionUID
private int
tabIndex
private String
tooltip
An optional tooltip.private boolean
visible
If the icon should be visible or not.-
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 Icon()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
doEndTag()
int
doStartTag()
String
getHref()
String
getImage()
int
getTabindex()
String
getTooltip()
boolean
isEnabled()
boolean
isVisible()
void
setEnabled(boolean enabled)
void
setHref(String href)
void
setImage(String image)
void
setTabindex(int tabIndex)
void
setTooltip(String tooltip)
void
setVisible(boolean visible)
-
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
-
page
private Page page
The parent <base:page> tag.
-
image
private String image
The filename of the image.
-
tooltip
private String tooltip
An optional tooltip.
-
visible
private boolean visible
If the icon should be visible or not.
-
href
private String href
If present, the icon is enclosed with an <a> tag that opens the given url in a new window.
-
enabled
private boolean enabled
If the icon should be enabled or not (if an onclick has been set).
-
tabIndex
private int tabIndex
-
-
Method Detail
-
setImage
public void setImage(String image)
-
getImage
public String getImage()
-
setVisible
public void setVisible(boolean visible)
-
isVisible
public boolean isVisible()
-
setEnabled
public void setEnabled(boolean enabled)
-
isEnabled
public boolean isEnabled()
-
setTooltip
public void setTooltip(String tooltip)
-
getTooltip
public String getTooltip()
-
setHref
public void setHref(String href)
- Since:
- 3.12
-
getHref
public String getHref()
- Since:
- 3.12
-
setTabindex
public void setTabindex(int tabIndex)
- Since:
- 3.2
-
getTabindex
public int getTabindex()
- Since:
- 3.2
-
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
-
-