2.17.2: 2011-06-17

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

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

public class Button
extends TagSupport

This tag is used to display a clickable button.

Example:

   <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
   <base:button onclick="alert('click')" title="Click here">
   </base:note>

Syntax:

   <base:button
      id=...
      clazz=...
      style=...
      onclick=...
      title=...
      tooltip=...
      image=...
      visible=true|false
      disabled=true|false
   >

Attribute Default value Required Description
id - no The ID of the button. The value of this attribute goes directly into the standard id attribute. This means that if you need a reference to the button object in your own JavaScript code, you may for example use the following code:

note = document.getElementById('<id>');

clazz buttonclass no The value if this attribute goes directly into the standard HTML class attribute. This allows you to apply different styles to different buttons. Note! To function properly the button also requires definitions for clazz_hover and clazz_inner.
style - no The value if this attribute goes directly into the standard HTML style attribute. This allows you to apply different styles to different buttons.
onclick - yes A JavaScript statement that will be excuted when the button is clicked.
title no The title of the button.
tooltip no A short explanation that will show up as a tooltip.
image no An optional image to display. An image is automatically selected if the title is "Close", "Cancel", "Save", "Ok", "Yes" or "No".
visible true no If the button should be visible or not.
disabled false no If the button should be enabled or not.

Version:
2.0
Author:
Nicklas
See Also:
Serialized Form

Field Summary
private  ButtonGroup buttonGroup
           
private  String clazz
          Optional class attribute
private static Map<String,String> defaultImages
           
private  boolean disabled
          If the button should be enabled or not.
private  String image
          The image to display.
private static Pattern keepFirstWord
           
private  String onClick
          JavaScript statement.
private static long serialVersionUID
           
private  String style
          Optional style attribute
private  String title
          The title of the button.
private  String tooltip
          An optional tooltip.
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()
           
private  String getDefaultImage(String theTitle)
           
 String getImage()
           
 String getOnclick()
           
 String getStyle()
           
 String getTitle()
           
 String getTooltip()
           
 boolean isDisabled()
           
 boolean isVisible()
           
 void setClazz(String clazz)
           
 void setDisabled(boolean disabled)
           
 void setImage(String image)
           
 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
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

defaultImages

private static final Map<String,String> defaultImages

buttonGroup

private ButtonGroup buttonGroup

clazz

private String clazz
Optional class attribute


style

private String style
Optional style attribute


onClick

private String onClick
JavaScript statement.


title

private String title
The title of the button.


tooltip

private String tooltip
An optional tooltip.


visible

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


disabled

private boolean disabled
If the button should be enabled or not.


image

private String image
The image to display.


keepFirstWord

private static final Pattern keepFirstWord
Constructor Detail

Button

public Button()
Method Detail

setClazz

public void setClazz(String clazz)

getClazz

public String getClazz()

setStyle

public void setStyle(String style)

getStyle

public String getStyle()

setOnclick

public void setOnclick(String onClick)

getOnclick

public String getOnclick()

setTitle

public void setTitle(String title)

getTitle

public String getTitle()

setImage

public void setImage(String image)

getImage

public String getImage()

setTooltip

public void setTooltip(String tooltip)

getTooltip

public String getTooltip()

setVisible

public void setVisible(boolean visible)

isVisible

public boolean isVisible()

setDisabled

public void setDisabled(boolean disabled)

isDisabled

public boolean isDisabled()

doStartTag

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

getDefaultImage

private String getDefaultImage(String theTitle)

2.17.2: 2011-06-17