public class FixedMenuItemFactory extends AbstractJspActionFactory<MenuItemAction> implements MenuItemAction
The menu is by default a regular menuitem and is both
visible and enabled. Use the setter method to change
the properties. Changes to the properties are immediately
visible in the menu items returned from the
getActions(InvokationContext)
method.
MenuItemAction.MenuType
Modifier and Type | Field and Description |
---|---|
private MenuItemAction[] |
actions |
private java.lang.String |
clazz |
private boolean |
enabled |
private java.lang.String |
icon |
private java.lang.String |
id |
private java.lang.String |
menuId |
private java.lang.String |
style |
private java.lang.String |
submenuId |
private java.lang.String |
title |
private java.lang.String |
tooltip |
private MenuItemAction.MenuType |
type |
private boolean |
visible |
Constructor and Description |
---|
FixedMenuItemFactory()
Create a new factory instance.
|
Modifier and Type | Method and Description |
---|---|
MenuItemAction[] |
getActions(InvokationContext<? super MenuItemAction> context)
This method may be called one or several times for each request.
|
java.lang.String |
getClazz()
Class attribute to add to the main menu tag.
|
java.lang.String |
getIcon()
Get an absolute reference to an image that will be displayed in the menu.
|
java.lang.String |
getId()
ID attribute of the main menu tag.
|
java.lang.String |
getMenuId()
The ID of the menu where this menu item belongs, or null if
it belongs to the top-level menu.
|
java.lang.String |
getStyle()
Extra CSS style attributes that will be added to the
style attribute of the menu item div. |
java.lang.String |
getSubmenuId()
The ID of a new submenu.
|
java.lang.String |
getTitle()
Get the title of the menu.
|
java.lang.String |
getTooltip()
A tooltip that is shown as a yellow popup when the
user points the mouse at the menu item.
|
MenuItemAction.MenuType |
getType()
The type of menu item.
|
boolean |
isEnabled()
If the menu item should be enabled or disabled.
|
boolean |
isVisible()
If the menu item should be visible or not.
|
void |
setClazz(java.lang.String clazz) |
void |
setEnabled(boolean enabled) |
void |
setEnabled(java.lang.String enabled) |
void |
setIcon(java.lang.String icon) |
void |
setId(java.lang.String id) |
void |
setMenuId(java.lang.String menuId) |
void |
setStyle(java.lang.String style) |
void |
setSubmenuId(java.lang.String submenuId) |
void |
setTitle(java.lang.String title) |
void |
setTooltip(java.lang.String tooltip) |
void |
setType(MenuItemAction.MenuType type) |
void |
setType(java.lang.String type) |
void |
setVisible(boolean visible) |
void |
setVisible(java.lang.String visible) |
prepareContext
getDynamicActionAttributes, getParameter, getScripts, getStylesheets, prepareContext, setParameter, setScript, setStylesheet
private MenuItemAction[] actions
private java.lang.String id
private java.lang.String clazz
private java.lang.String menuId
private java.lang.String submenuId
private java.lang.String icon
private java.lang.String style
private java.lang.String title
private java.lang.String tooltip
private boolean enabled
private boolean visible
private MenuItemAction.MenuType type
public FixedMenuItemFactory()
public MenuItemAction[] getActions(InvokationContext<? super MenuItemAction> context)
ActionFactory
getActions
in interface ActionFactory<MenuItemAction>
context
- The current invokation contextpublic java.lang.String getId()
MenuItemAction
getId
in interface MenuItemAction
public java.lang.String getClazz()
MenuItemAction
getClazz
in interface MenuItemAction
public java.lang.String getIcon()
MenuItemAction
getIcon
in interface MenuItemAction
public java.lang.String getMenuId()
MenuItemAction
getMenuId
in interface MenuItemAction
public java.lang.String getStyle()
MenuItemAction
style
attribute of the menu item div.getStyle
in interface MenuItemAction
public java.lang.String getSubmenuId()
MenuItemAction
MenuItemAction.MenuType.SUBMENU
, and is ignored otherwise.getSubmenuId
in interface MenuItemAction
public java.lang.String getTitle()
MenuItemAction
getTitle
in interface MenuItemAction
public java.lang.String getTooltip()
MenuItemAction
getTooltip
in interface MenuItemAction
public MenuItemAction.MenuType getType()
MenuItemAction
getType
in interface MenuItemAction
public boolean isEnabled()
MenuItemAction
isEnabled
in interface MenuItemAction
public boolean isVisible()
MenuItemAction
isVisible
in interface MenuItemAction
public void setId(java.lang.String id)
public void setClazz(java.lang.String clazz)
@VariableSetter @PathSetter public void setIcon(java.lang.String icon)
public void setMenuId(java.lang.String menuId)
public void setStyle(java.lang.String style)
public void setSubmenuId(java.lang.String submenuId)
public void setTitle(java.lang.String title)
public void setTooltip(java.lang.String tooltip)
public void setEnabled(boolean enabled)
public void setEnabled(java.lang.String enabled)
public void setVisible(boolean visible)
public void setVisible(java.lang.String visible)
public void setType(MenuItemAction.MenuType type)
public void setType(java.lang.String type)