2.17.2: 2011-06-17

net.sf.basedb.clients.web.extensions.toolbar
Class ToolbarButtonRenderer

java.lang.Object
  extended by 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 a JspContext).

Version:
2.12
Author:
nicklas
Last modified
$Date:2008-03-20 12:15:25 +0100 (Thu, 20 Mar 2008) $

Field Summary
private  JspContext context
           
 
Constructor Summary
ToolbarButtonRenderer()
          Create a new "standalone" toolbar button renderer.
ToolbarButtonRenderer(JspContext context)
          Create a new toolbar button renderer.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

private JspContext context
Constructor Detail

ToolbarButtonRenderer

public ToolbarButtonRenderer()
Create a new "standalone" toolbar button renderer. Use getHTML(ButtonAction, boolean, boolean) to generate the HTML. Do not use render(ButtonAction) since that requires a JspContext.


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 interface Renderer<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 information
displayText - If text should be displayed on the button or not
displayIcon - If the icon should be displayed on the button or not

2.17.2: 2011-06-17