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
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=... >
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:
|
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:
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
If the icon should be enabled or not (if an onclick has been set).private String
If present, the icon is enclosed with an <a> tag that opens the given url in a new window.private String
The filename of the image.private Page
The parent <base:page> tag.private static final long
private int
private String
An optional tooltip.private boolean
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
-
Method Summary
Modifier and TypeMethodDescriptionint
doEndTag()
int
getHref()
getImage()
int
boolean
boolean
void
setEnabled
(boolean enabled) void
void
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 Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
page
The parent <base:page> tag. -
image
The filename of the image. -
tooltip
An optional tooltip. -
visible
private boolean visibleIf the icon should be visible or not. -
href
If present, the icon is enclosed with an <a> tag that opens the given url in a new window. -
enabled
private boolean enabledIf the icon should be enabled or not (if an onclick has been set). -
tabIndex
private int tabIndex
-
-
Constructor Details
-
Icon
public Icon()
-
-
Method Details
-
setImage
-
getImage
-
setVisible
public void setVisible(boolean visible) -
isVisible
public boolean isVisible() -
setEnabled
public void setEnabled(boolean enabled) -
isEnabled
public boolean isEnabled() -
setTooltip
-
getTooltip
-
setHref
- Since:
- 3.12
-
getHref
- Since:
- 3.12
-
setTabindex
public void setTabindex(int tabIndex) - Since:
- 3.2
-
getTabindex
public int getTabindex()- Since:
- 3.2
-
doStartTag
- Specified by:
doStartTag
in interfaceTag
- Overrides:
doStartTag
in classTagSupport
- Throws:
JspException
-
doEndTag
- Specified by:
doEndTag
in interfaceTag
- Overrides:
doEndTag
in classTagSupport
- Throws:
JspException
-