org.opensubsystems.patterns.dialoglayout.www
Class ImageButtonControlTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.opensubsystems.core.www.PageElementCacheTag
              extended by org.opensubsystems.patterns.dialoglayout.www.ImageButtonControlTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class ImageButtonControlTag
extends org.opensubsystems.core.www.PageElementCacheTag

Custom tag to generate all HTML code necessary to display image button control, that is button with image and text, displayed int the dialog row.

Version:
$Id: ImageButtonControlTag.java,v 1.14 2007/02/01 07:23:08 bastafidli Exp $
Author:
Julo Legeny
See Also:
Serialized Form
Code reviewer:
Miro Halas
Code reviewed:
1.7 2006/05/24 15:18:30 bastafidli

Field Summary
protected  java.lang.String m_strAccessKey
          Accesskey that will be used for mnemonics (using ALT+letter)
protected  java.lang.String m_strCssclass
          Css class or combination of classes for this image button that should contain background image that will be displayed within the button created by this tag.
protected  java.lang.String m_strDisabled
          Flag which will tells us if the button is disabled.
protected  java.lang.String m_strFake
          Flag which will tells us if to create a fake button using a DIV tag or a real button using a button tag.
protected  java.lang.String m_strFakecssclass
          Css class or combination of classes for this fake image button.
protected  java.lang.String m_strFocus
          Does this control have focus when it is displayed on the page or not.
protected  java.lang.String m_strOnclick
          Javascript to execute when user clicks on the button.
protected  java.lang.String m_strTitle
          Tooltip that will be displayed for particular button control when user hovers with mouse over it.
protected  java.lang.String m_strType
          Type of the button control (button/reset/submit)
 
Fields inherited from class org.opensubsystems.core.www.PageElementCacheTag
CACHE_INDICATOR, CSS_ELEMENT, JS_ELEMENT, m_strCacheas, m_strId, PAGE_ELEMENTS_CACHE, SCRIPT_ELEMENT
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
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
ImageButtonControlTag()
          Constructor for custom tag.
 
Method Summary
 int doEndTag()
          
 void doEndTag(java.lang.StringBuffer sbHtml, java.lang.String strContent)
          Generate content of the buffer within the end tag.
 int doStartTag()
          
protected  void formatButtonText(java.lang.StringBuffer sbHtml, java.lang.String strContent)
          Format the text of the button underlining the access key if one was defined.
 java.lang.String getAccesskey()
           
 java.lang.String getCssclass()
           
 java.lang.String getDisabled()
           
 java.lang.String getFake()
           
 java.lang.String getFakecssclass()
           
 java.lang.String getFocus()
           
 java.lang.String getOnclick()
           
 java.lang.String getTitle()
           
 java.lang.String getType()
           
 boolean isDisabledButton()
           
 boolean isFakeButton()
           
 boolean isFocusedControl()
           
 void setAccesskey(java.lang.String strAccessKey)
           
 void setCssclass(java.lang.String strCssclass)
           
 void setDisabled(boolean bDisabled)
           
 void setDisabled(java.lang.String strDisabled)
           
 void setFake(boolean bFake)
           
 void setFake(java.lang.String strFake)
           
 void setFakecssclass(java.lang.String strFakecssclass)
           
 void setFocus(boolean bFocus)
           
 void setFocus(java.lang.String strFocus)
           
 void setOnclick(java.lang.String strOnclick)
           
 void setTitle(java.lang.String strTitle)
           
 void setType(java.lang.String strType)
           
 
Methods inherited from class org.opensubsystems.core.www.PageElementCacheTag
cache, getCacheas, getCachedContent, getCachedContent, getCachedContent, getCachedContentElements, getId, setCacheas, setId
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getParent, getValue, getValues, removeValue, 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 javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Field Detail

m_strCssclass

protected java.lang.String m_strCssclass
Css class or combination of classes for this image button that should contain background image that will be displayed within the button created by this tag. Common classes are defined in control.css style sheet.


m_strFakecssclass

protected java.lang.String m_strFakecssclass
Css class or combination of classes for this fake image button. This class will be assigned to the hyperlink that represents the fake button and that will be source of the events whenever user clicks on it.


m_strTitle

protected java.lang.String m_strTitle
Tooltip that will be displayed for particular button control when user hovers with mouse over it.


m_strType

protected java.lang.String m_strType
Type of the button control (button/reset/submit)


m_strAccessKey

protected java.lang.String m_strAccessKey
Accesskey that will be used for mnemonics (using ALT+letter)


m_strOnclick

protected java.lang.String m_strOnclick
Javascript to execute when user clicks on the button.


m_strDisabled

protected java.lang.String m_strDisabled
Flag which will tells us if the button is disabled. Default is false.


m_strFake

protected java.lang.String m_strFake
Flag which will tells us if to create a fake button using a DIV tag or a real button using a button tag. Default is false.


m_strFocus

protected java.lang.String m_strFocus
Does this control have focus when it is displayed on the page or not. Only one control on a page or tab can be marked as focus at a time. If multiple controls are marked this way, then the first one on the page or tab will get the focus.

Constructor Detail

ImageButtonControlTag

public ImageButtonControlTag()
Constructor for custom tag.

Method Detail

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class org.opensubsystems.core.www.PageElementCacheTag
Throws:
javax.servlet.jsp.JspException

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class org.opensubsystems.core.www.PageElementCacheTag
Throws:
javax.servlet.jsp.JspException

doEndTag

public void doEndTag(java.lang.StringBuffer sbHtml,
                     java.lang.String strContent)
Generate content of the buffer within the end tag. Since we are buffering the content we do not provide any doStartTag(StringBuffer) and the caller is responsible for buffering the body and passing it as parameter

Parameters:
sbHtml - - generated string buffer
strContent - - content which was specified between start and the end tag, which would be the name of the button

getCssclass

public java.lang.String getCssclass()
Returns:
String - Class for the button control

setCssclass

public void setCssclass(java.lang.String strCssclass)
Parameters:
strCssclass - - Class for the button control

getFakecssclass

public java.lang.String getFakecssclass()
Returns:
String - Class for the hyperlink within the fake button control

setFakecssclass

public void setFakecssclass(java.lang.String strFakecssclass)
Parameters:
strFakecssclass - - Class for the hyperlink within the fake button control

getType

public java.lang.String getType()
Returns:
String - Type of the button tag used to specify button control type (button/reset/submit).

setType

public void setType(java.lang.String strType)
Parameters:
strType - - Type of the button tag used to specify button control type (button/reset/submit).

getTitle

public java.lang.String getTitle()
Returns:
String - strTitle - Ttitle (tooltip) that will be shown for particular button..

setTitle

public void setTitle(java.lang.String strTitle)
Parameters:
strTitle - - Ttitle (tooltip) that will be shown for particular button.

getAccesskey

public java.lang.String getAccesskey()
Returns:
- Accesskey used for mnemonics (using ALT+letter)

setAccesskey

public void setAccesskey(java.lang.String strAccessKey)
Parameters:
strAccessKey - - AccessKey that will be used for mnemonics (using ALT+letter)

getOnclick

public java.lang.String getOnclick()
Returns:
String - javascript to execute when user clicks on the button

setOnclick

public void setOnclick(java.lang.String strOnclick)
Parameters:
strOnclick - - javascript to execute when user clicks on the button

getDisabled

public java.lang.String getDisabled()
Returns:
String - If this button should be disabled then this attribute should say true or 1.

setDisabled

public void setDisabled(java.lang.String strDisabled)
Parameters:
strDisabled - - If this button should be disabled then this attribute should say true or 1.

setDisabled

public void setDisabled(boolean bDisabled)
Parameters:
bDisabled - - If this button should be disabled then this attribute should say true or 1.

isDisabledButton

public boolean isDisabledButton()
Returns:
boolean - true if this button should be disabled

getFake

public java.lang.String getFake()
Returns:
String - If this should be fake button constructed using a DIV tag rather than a real button created using a button tag then this attribute should say true or 1.

setFake

public void setFake(java.lang.String strFake)
Parameters:
strFake - - If this should be fake button constructed using a DIV tag rather than a real button created using a button tag then this attribute should say true or 1.

setFake

public void setFake(boolean bFake)
Parameters:
bFake - - If this should be fake button constructed using a DIV tag rather than a real button created using a button tag then this attribute should say true or 1.

isFakeButton

public boolean isFakeButton()
Returns:
boolean - true if this should be fake button constructed using a DIV tag rather than a real button created using a button tag

getFocus

public java.lang.String getFocus()
Returns:
String - Does this control have focus when it si displayed on the page or not.

setFocus

public void setFocus(java.lang.String strFocus)
Parameters:
strFocus - - If this control have focus when it si displayed on the page say true or 1.

setFocus

public void setFocus(boolean bFocus)
Parameters:
bFocus - - Does this control have focus when it si displayed on the page or tab.

isFocusedControl

public boolean isFocusedControl()
Returns:
boolean - true if this control has focus when it is displayed on a page or tab

formatButtonText

protected void formatButtonText(java.lang.StringBuffer sbHtml,
                                java.lang.String strContent)
Format the text of the button underlining the access key if one was defined.

Parameters:
sbHtml - - buffer where to insert the formated text
strContent - - the text to display in the button


Copyright © 2003 - 2006 OpenSubsystems s.r.o.