Class FixedMenuItemFactory
java.lang.Object
net.sf.basedb.clients.web.extensions.AbstractJspFactory
net.sf.basedb.clients.web.extensions.AbstractJspActionFactory<MenuItemAction>
net.sf.basedb.clients.web.extensions.menu.FixedMenuItemFactory
- All Implemented Interfaces:
DynamicActionAttributes
,MenuItemAction
,Action
,ActionFactory<MenuItemAction>
public class FixedMenuItemFactory
extends AbstractJspActionFactory<MenuItemAction>
implements MenuItemAction
A simple implementation of a menu item action factory that
creates the same fixed menu item for all users
not using any context information.
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.
- Version:
- 2.7
- Author:
- nicklas
- Last modified
- $Date:2008-03-20 12:15:25 +0100 (Thu, 20 Mar 2008) $
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.sf.basedb.clients.web.extensions.menu.MenuItemAction
MenuItemAction.MenuType
-
Field Summary
Modifier and TypeFieldDescriptionprivate MenuItemAction[]
private String
private boolean
private String
private String
private String
private String
private String
private String
private String
private MenuItemAction.MenuType
private boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetActions
(InvokationContext<? super MenuItemAction> context) This method may be called one or several times for each request.getClazz()
Class attribute to add to the main menu tag.getIcon()
Get an absolute reference to an image that will be displayed in the menu.getId()
ID attribute of the main menu tag.The ID of the menu where this menu item belongs, or null if it belongs to the top-level menu.getStyle()
Extra CSS style attributes that will be added to thestyle
attribute of the menu item div.The ID of a new submenu.getTitle()
Get the title of the menu.A tooltip that is shown as a yellow popup when the user points the mouse at the menu item.getType()
The type of menu item.boolean
If the menu item should be enabled or disabled.boolean
If the menu item should be visible or not.void
void
setEnabled
(boolean enabled) void
setEnabled
(String enabled) void
void
void
void
void
setSubmenuId
(String submenuId) void
void
setTooltip
(String tooltip) void
void
void
setVisible
(boolean visible) void
setVisible
(String visible) Methods inherited from class net.sf.basedb.clients.web.extensions.AbstractJspActionFactory
prepareContext
Methods inherited from class net.sf.basedb.clients.web.extensions.AbstractJspFactory
getDynamicActionAttributes, getParameter, getScripts, getStylesheets, prepareContext, setParameter, setScript, setStylesheet
-
Field Details
-
actions
-
id
-
clazz
-
icon
-
style
-
title
-
tooltip
-
enabled
private boolean enabled -
visible
private boolean visible -
type
-
-
Constructor Details
-
FixedMenuItemFactory
public FixedMenuItemFactory()Create a new factory instance.
-
-
Method Details
-
getActions
Description copied from interface:ActionFactory
This method may be called one or several times for each request. This is decided by the extension point. If, for example, the extension point is a pure single-item extension point then this method is probably only called once. If the extension point is a per-item extension point in a list context, then this method may be called once for every item in the list. The context parameter contains all information about the context of the extension point, including the current item, if any.- Specified by:
getActions
in interfaceActionFactory<MenuItemAction>
- Parameters:
context
- The current invokation context- Returns:
- An array of actions that should be added to the extension point. Returns null or an empty array if there are no actions in the current context.
-
getId
Description copied from interface:MenuItemAction
ID attribute of the main menu tag. You need to set this value to reference the menu item in a javascript.- Specified by:
getId
in interfaceMenuItemAction
- Returns:
- The ID, or null
-
getClazz
Description copied from interface:MenuItemAction
Class attribute to add to the main menu tag.- Specified by:
getClazz
in interfaceMenuItemAction
-
getIcon
Description copied from interface:MenuItemAction
Get an absolute reference to an image that will be displayed in the menu. It is recommended that the image is 9 pixels wide and 12 pixels high to line up with the icons used by the BASE core menus.- Specified by:
getIcon
in interfaceMenuItemAction
- Returns:
- A reference to an image, or null if no image should be used
-
getMenuId
Description copied from interface:MenuItemAction
The ID of the menu where this menu item belongs, or null if it belongs to the top-level menu.- Specified by:
getMenuId
in interfaceMenuItemAction
-
getStyle
Description copied from interface:MenuItemAction
Extra CSS style attributes that will be added to thestyle
attribute of the menu item div.- Specified by:
getStyle
in interfaceMenuItemAction
- Returns:
- Style attributes, or null
-
getTitle
Description copied from interface:MenuItemAction
Get the title of the menu.- Specified by:
getTitle
in interfaceMenuItemAction
-
getTooltip
Description copied from interface:MenuItemAction
A tooltip that is shown as a yellow popup when the user points the mouse at the menu item.- Specified by:
getTooltip
in interfaceMenuItemAction
- Returns:
- The tooltip or null to not display any tooltip
-
getType
Description copied from interface:MenuItemAction
The type of menu item.- Specified by:
getType
in interfaceMenuItemAction
-
isEnabled
public boolean isEnabled()Description copied from interface:MenuItemAction
If the menu item should be enabled or disabled.- Specified by:
isEnabled
in interfaceMenuItemAction
-
isVisible
public boolean isVisible()Description copied from interface:MenuItemAction
If the menu item should be visible or not.- Specified by:
isVisible
in interfaceMenuItemAction
-
setId
-
setClazz
-
setIcon
-
setMenuId
-
setStyle
-
setTitle
-
setTooltip
-
setEnabled
public void setEnabled(boolean enabled) -
setEnabled
-
setVisible
public void setVisible(boolean visible) -
setVisible
-
setType
-