Class ToolbarButtonRenderer
- java.lang.Object
-
- net.sf.basedb.clients.web.extensions.toolbar.ToolbarButtonRenderer
-
- All Implemented Interfaces:
Renderer<ButtonAction>
public class ToolbarButtonRenderer extends Object implements Renderer<ButtonAction>
A renderer for toolbar button actions, which displays the action as a toolbar button. The render can also be used in "standalone" mode (eg. without aJspContext
).- Version:
- 2.12
- Author:
- nicklas
- Last modified
- $Date:2008-03-20 12:15:25 +0100 (Thu, 20 Mar 2008) $
-
-
Field Summary
Fields Modifier and Type Field Description private JspContext
context
-
Constructor Summary
Constructors Constructor Description ToolbarButtonRenderer()
Create a new "standalone" toolbar button renderer.ToolbarButtonRenderer(JspContext context)
Create a new toolbar button renderer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getHTML(ButtonAction btn, boolean displayText, boolean displayIcon)
Generate the HTML that is needed to create a toolbar button.void
render(ButtonAction btn)
Generates a toolbar button.
-
-
-
Field Detail
-
context
private JspContext context
-
-
Constructor Detail
-
ToolbarButtonRenderer
public ToolbarButtonRenderer()
Create a new "standalone" toolbar button renderer. UsegetHTML(ButtonAction, boolean, boolean)
to generate the HTML. Do not userender(ButtonAction)
since that requires aJspContext
.
-
ToolbarButtonRenderer
public ToolbarButtonRenderer(JspContext context)
Create a new toolbar button renderer.
-
-
Method Detail
-
render
public void render(ButtonAction btn)
Generates a toolbar button. If the button isn't visible nothing is generated. If the button isn't enabled, the onclick attribute is not generated.- Specified by:
render
in interfaceRenderer<ButtonAction>
- Parameters:
btn
- The action to render
-
getHTML
public String getHTML(ButtonAction btn, boolean displayText, boolean displayIcon)
Generate the HTML that is needed to create a toolbar button.- Parameters:
btn
- The button informationdisplayText
- If text should be displayed on the button or notdisplayIcon
- If the icon should be displayed on the button or not
-
-