2.17.2: 2011-06-17

net.sf.basedb.clients.web.taglib.table
Class Button

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by net.sf.basedb.clients.web.taglib.table.Button
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag, ButtonAction, Action

public class Button
extends TagSupport
implements ButtonAction

This tag creates a button on a toolbar. The tag must be located inside a <tbl:toolbar> tag.

Syntax:

   <tbl:button
      id=...
      clazz=...
      style=...
      image=...
      imagealign=left|right (no longer supported)
      onclick=...
      title=...
      tooltip=...
      disabled=true|false
      visible=true|false
   >

Attribute Default value Required Description
id - no The ID of the button. The value of this attribute goes directly into the standard HTML id attribute. This means that if you need a reference to the table object in your own JavaScript code, you may for example use the following code:
button = document.getElementById('<id>');
clazz button no The value if this attribute goes directly into the standard HTML class attribute. This allows you to apply different styles to different tables.
style - no The value if this attribute goes directly into the standard HTML style attribute. This allows you to apply different styles to different tables.
image - no The file name of an image to show on the button. It is expected that the image is located in the /images directory. Do not specify a complete path.
imagealign left no If the image should be aligned to the left or right of the text. No longer supported.
onclick - no A JavaScript statement that is executed when the user click on the button.
title - no The text of the button.
tooltip - no A text that will be shown while the user has the mouse over the button.
disabled - false If the button is disabled or not. The values '0', 'no' or 'false' will enabled the button, all other values will disable it.
visible true no If the button should be visible or not.

This tag has no subtags.

Version:
2.0
Author:
Nicklas
See Also:
Serialized Form

Field Summary
private  String clazz
          Optional class attribute
private  boolean disabled
          IF the button is disabled or not.
private  String image
          An optional image to show in the button.
private  String imageAlign
          LEFT or RIGTH;
private  String onClick
          A JavaScript statement that is executet when the button is clicked.
private static long serialVersionUID
           
private  String style
          Optional style attribute
private  Table table
          The parent <tbl:table> tag.
private  String title
          An optional title text on the button.
private  Toolbar toolbar
          The parent <tbl:toolbar> tag.
private  String tooltip
          An optional tooltip that will show when the mouse is over the button.
private  boolean visible
          If the button should be visible or not.
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
Button()
           
 
Method Summary
 int doStartTag()
           
 String getClazz()
          Class attribute of the main button tag.
 String getIcon()
          Get a reference to an image that will be displayed in the menu.
 String getImage()
           
 String getImagealign()
           
 String getOnclick()
           
 String getOnClick()
          A javascript action that is executed when the user clicks on the button.
 String getStyle()
          Extra CSS style attributes that will be added to the style attribute of the main button tag.
 String getTitle()
          Get the title of the button.
 String getTooltip()
          A tooltip that is shown as a yellow popup when the user points the mouse at the button.
 boolean isDisabled()
           
 boolean isEnabled()
          If the button should be enabled or disabled.
 boolean isVisible()
          If the button should be visible or not.
 void setClazz(String clazz)
           
 void setDisabled(boolean disabled)
           
 void setImage(String image)
           
 void setImagealign(String imageAlign)
           
 void setOnclick(String onClick)
           
 void setStyle(String style)
           
 void setTitle(String title)
           
 void setTooltip(String tooltip)
           
 void setVisible(boolean visible)
           
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.basedb.clients.web.extensions.toolbar.ButtonAction
getId
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

table

private Table table
The parent <tbl:table> tag.


toolbar

private Toolbar toolbar
The parent <tbl:toolbar> tag.


clazz

private String clazz
Optional class attribute


style

private String style
Optional style attribute


image

private String image
An optional image to show in the button.


imageAlign

private String imageAlign
LEFT or RIGTH;


onClick

private String onClick
A JavaScript statement that is executet when the button is clicked.


title

private String title
An optional title text on the button.


tooltip

private String tooltip
An optional tooltip that will show when the mouse is over the button.


disabled

private boolean disabled
IF the button is disabled or not.


visible

private boolean visible
If the button should be visible or not.

Constructor Detail

Button

public Button()
Method Detail

setClazz

public void setClazz(String clazz)

getClazz

public String getClazz()
Description copied from interface: ButtonAction
Class attribute of the main button tag. The default value is "button".

Specified by:
getClazz in interface ButtonAction
Returns:
Class attribute, or null to use the default "button"

setStyle

public void setStyle(String style)

getStyle

public String getStyle()
Description copied from interface: ButtonAction
Extra CSS style attributes that will be added to the style attribute of the main button tag.

Specified by:
getStyle in interface ButtonAction
Returns:
Style attributes, or null

setImage

public void setImage(String image)

getImage

public String getImage()

setImagealign

public void setImagealign(String imageAlign)

getImagealign

public String getImagealign()

setOnclick

public void setOnclick(String onClick)

getOnclick

public String getOnclick()

setTitle

public void setTitle(String title)

getTitle

public String getTitle()
Description copied from interface: ButtonAction
Get the title of the button.

Specified by:
getTitle in interface ButtonAction

setTooltip

public void setTooltip(String tooltip)

getTooltip

public String 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 interface ButtonAction
Returns:
The tooltip or null to not display any tooltip

setDisabled

public void setDisabled(boolean disabled)

isDisabled

public boolean isDisabled()

setVisible

public void setVisible(boolean visible)

isVisible

public boolean isVisible()
Description copied from interface: ButtonAction
If the button should be visible or not.

Specified by:
isVisible in interface ButtonAction

getIcon

public String 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 interface ButtonAction
Returns:
A reference to an image, or null if no image should be used

getOnClick

public String getOnClick()
Description copied from interface: ButtonAction
A javascript action that is executed when the user clicks on the button.

Specified by:
getOnClick in interface ButtonAction
Returns:
The javascript action

isEnabled

public boolean isEnabled()
Description copied from interface: ButtonAction
If the button should be enabled or disabled.

Specified by:
isEnabled in interface ButtonAction

doStartTag

public int doStartTag()
               throws JspException
Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class TagSupport
Throws:
JspException

2.17.2: 2011-06-17