Class Menuitem
- java.lang.Object
-
- javax.servlet.jsp.tagext.TagSupport
-
- net.sf.basedb.clients.web.taglib.StylableTag
-
- net.sf.basedb.clients.web.taglib.menu.Menuitem
-
- All Implemented Interfaces:
Serializable
,DynamicAttributes
,IterationTag
,JspTag
,Tag
,DynamicActionAttributes
public class Menuitem extends StylableTag
This tag defines a menu item inside a drop-down menu. This tag can only be used inside aMenu
tag, which should contain at least one of these tags.Syntax:
<m:menuitem id=... clazz=... subclass=... style=... title=... url=... tooltip=... enabled=... icon=... visible=... >
Tag attributes Attribute Default value Required Description id - no The ID of the menuitem. The value of this attribute goes directly into the standard HTML id
attribute. This means that if you need a reference to the menuitem object in your own JavaScript code, you may for example use the following code:menuitem = document.getElementById('<id>');
style - no The value if this attribute goes directly into the standard HTML style
attribute. This allows you to apply different styles to different menu items.title - yes The text that should be displayed in the menu for this menuitem. url - no The URL to open when the user selects the menu item. The url is by default opened in the main window. If 'data-target' is specified, it is instead opened in a named window and if 'data-popup' is specified it is opened in a popup window. data-target - no Set this to a window name and the given url will be opened in that window instead. data-popup - no To open the given url in a popup window, set this attribute to a comma-separated list with three values: a window name, the width and the height of the popup window. Example: data-popup="Logout, 300, 200"
.tooltip - no An optional tooltip that is shown as a popup text while the user is pointing the mouse over the menuitem. Not supported by all browsers. enabled true no Use false
to display a disabled (greyed-out) menu item.visible true no Use false
to hide this menu item entirely.icon - no The filename of an icon to display before the title. The icon must be placed in the /images
directory. Do not include any path information in the icon attribute.- Version:
- 2.0
- Author:
- Nicklas
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
enabled
If the menu item is enabled.private String
icon
An icon to display.private Menu
menu
The parent Menu.private static long
serialVersionUID
private String
title
The title of the menu item.private String
tooltip
A tooltip explaining the menu item.private boolean
visible
If the menu item is visible.-
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 Menuitem()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
doStartTag()
String
getIcon()
String
getTitle()
String
getTooltip()
boolean
isEnabled()
boolean
isVisible()
void
setDynamic(Iterator<DynamicActionAttribute> dynamicAttributes)
void
setEnabled(boolean enabled)
void
setIcon(String icon)
void
setTitle(String title)
void
setTooltip(String tooltip)
void
setUrl(String url)
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, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setParent, setValue
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
menu
private Menu menu
The parent Menu.
-
title
private String title
The title of the menu item.
-
tooltip
private String tooltip
A tooltip explaining the menu item.
-
enabled
private boolean enabled
If the menu item is enabled.
-
visible
private boolean visible
If the menu item is visible.
-
icon
private String icon
An icon to display.
-
-
Method Detail
-
setTitle
public void setTitle(String title)
-
getTitle
public String getTitle()
-
setUrl
public void setUrl(String url)
-
setTooltip
public void setTooltip(String tooltip)
-
getTooltip
public String getTooltip()
-
setEnabled
public void setEnabled(boolean enabled)
-
isEnabled
public boolean isEnabled()
-
setVisible
public void setVisible(boolean visible)
-
isVisible
public boolean isVisible()
-
setIcon
public void setIcon(String icon)
-
getIcon
public String getIcon()
-
setDynamic
public void setDynamic(Iterator<DynamicActionAttribute> dynamicAttributes)
-
doStartTag
public int doStartTag() throws JspException
- Specified by:
doStartTag
in interfaceTag
- Overrides:
doStartTag
in classTagSupport
- Throws:
JspException
-
-