Class FixedButtonFactory
java.lang.Object
net.sf.basedb.clients.web.extensions.AbstractJspFactory
net.sf.basedb.clients.web.extensions.AbstractJspActionFactory<ButtonAction>
net.sf.basedb.clients.web.extensions.toolbar.FixedButtonFactory
- All Implemented Interfaces:
DynamicActionAttributes
,ButtonAction
,Action
,ActionFactory<ButtonAction>
public class FixedButtonFactory
extends AbstractJspActionFactory<ButtonAction>
implements ButtonAction
A simple implementation of a toolbar button action factory that
creates the same fixed button for all users
not using any context information.
The button is by default 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.
If the extension point supports scripts and stylesheets, use the
AbstractJspFactory.setScript(String)
and AbstractJspFactory.setStylesheet(String)
methods.
Each call to these methods will add the argument to a set. Use
the AbstractJspFactory.getScripts()
and AbstractJspFactory.getStylesheets()
methods to gain
access to the sets, for example, to remove added items.
- Version:
- 2.7
- Author:
- nicklas
- Last modified
- $Date:2008-03-20 12:15:25 +0100 (Thu, 20 Mar 2008) $
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetActions
(InvokationContext<? super ButtonAction> context) This method may be called one or several times for each request.getClazz()
Class attribute of the main button tag.getIcon()
Get a reference to an image that will be displayed in the menu.getId()
ID attribute of the main button tag.getStyle()
Extra CSS style attributes that will be added to thestyle
attribute of the main button tag.int
Get the tab index used to control focus order when tabbing.getTitle()
Get the title of the button.A tooltip that is shown as a yellow popup when the user points the mouse at the button.boolean
If the button should be enabled or disabled.boolean
If the button should be visible or not.void
void
setEnabled
(boolean enabled) void
setEnabled
(String enabled) void
void
void
void
setTabIndex
(int tabIndex) void
void
setTooltip
(String tooltip) 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 -
tabIndex
private int tabIndex
-
-
Constructor Details
-
FixedButtonFactory
public FixedButtonFactory()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<ButtonAction>
- 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.
-
getClazz
Description copied from interface:ButtonAction
Class attribute of the main button tag. The default value is "button".- Specified by:
getClazz
in interfaceButtonAction
- Returns:
- Class attribute, or null to use the default "button"
-
getId
Description copied from interface:ButtonAction
ID attribute of the main button tag. You need to set this value to reference the button in a javascript.- Specified by:
getId
in interfaceButtonAction
- Returns:
- The ID, or null
-
getIcon
Description copied from interface:ButtonAction
Get a reference to an image that will be displayed in the menu. It is recommended that the image is 16x16 pixels to line up with the other icons used by the BASE.- Specified by:
getIcon
in interfaceButtonAction
- Returns:
- A reference to an image, or null if no image should be used
-
getStyle
Description copied from interface:ButtonAction
Extra CSS style attributes that will be added to thestyle
attribute of the main button tag.- Specified by:
getStyle
in interfaceButtonAction
- Returns:
- Style attributes, or null
-
getTitle
Description copied from interface:ButtonAction
Get the title of the button.- Specified by:
getTitle
in interfaceButtonAction
-
getTooltip
Description copied from interface:ButtonAction
A tooltip that is shown as a yellow popup when the user points the mouse at the button.- Specified by:
getTooltip
in interfaceButtonAction
- Returns:
- The tooltip or null to not display any tooltip
-
isEnabled
public boolean isEnabled()Description copied from interface:ButtonAction
If the button should be enabled or disabled.- Specified by:
isEnabled
in interfaceButtonAction
-
isVisible
public boolean isVisible()Description copied from interface:ButtonAction
If the button should be visible or not.- Specified by:
isVisible
in interfaceButtonAction
-
getTabIndex
public int getTabIndex()Description copied from interface:ButtonAction
Get the tab index used to control focus order when tabbing. Use -1 to disable.- Specified by:
getTabIndex
in interfaceButtonAction
-
setClazz
-
setIcon
-
setId
-
setStyle
-
setTitle
-
setTooltip
-
setEnabled
public void setEnabled(boolean enabled) -
setEnabled
-
setVisible
public void setVisible(boolean visible) -
setVisible
-
setTabIndex
public void setTabIndex(int tabIndex)
-