pt.moredata.taglibs.widgets
Class ToolBarTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended bypt.moredata.taglibs.widgets.ToolBarTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, java.io.Serializable, SimpleToolBar, javax.servlet.jsp.tagext.Tag, javax.servlet.jsp.tagext.TryCatchFinally
Direct Known Subclasses:
ToolBarTag

public class ToolBarTag
extends javax.servlet.jsp.tagext.TagSupport
implements SimpleToolBar, javax.servlet.jsp.tagext.TryCatchFinally

ToolBarTag.java Implementacao de uma tag para mostrar uma barra de navegacao. Company MoreData

Version:
$Revision: 1.20 $
Author:
aricardo, pcarmo
See Also:
Serialized Form

Field Summary
protected  java.util.ArrayList _buttonList
          Lista de butoes da tooolbar.
protected  java.lang.StringBuffer results
          Buffer onde e despejado o codigo em HTML.
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface pt.moredata.widgets.SimpleToolBar
CANCEL_BUTTON, DELETE_BUTTON, EXECUTEQUERY_BUTTON, EXIT_BUTTON, EXPORT_BUTTON, FIRST_BUTTON, LAST_BUTTON, NEW_BUTTON, NEXT_BUTTON, PREVIOUS_BUTTON, PRINT_BUTTON, QUERY_BUTTON, SAVE_ALL_BUTTON, SAVE_BUTTON
 
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
ToolBarTag()
           
 
Method Summary
 void addButton(JspButton button)
          Adiciona um botao a toolbar.
 void doCatch(java.lang.Throwable t)
          Invoked if a Throwable occurs while evaluating the BODY inside a tag or in any of the following methods: Tag.doStartTag(), Tag.doEndTag(), IterationTag.doAfterBody() and BodyTag.doInitBody().
 int doEndTag()
           
 void doFinally()
          Invoked in all cases after doEndTag() for any class implementing Tag, IterationTag or BodyTag.
 int doStartTag()
           
 SimpleToolBarButton getButton(int button)
          Devolve um determinado botao da toolbar.
 JspButton getButton(java.lang.String buttonValue)
          Devolve um determinado botao da toolbar.
 int getButtonIndex(java.lang.String buttonValue)
          Returns the index of a button.
 int getButtonsCount()
          Devolve o numero de botoes da ToolBar.
 boolean isEnabled()
          Verifica se a toolbar esta activa ou nao.
protected  void printButton(JspButton button)
          Imprime o codigo correspondente a um botao.
protected  void printToolBar()
          Imprime o codigo da toolBar em HTML.
 void setBgcolor(java.lang.String bgcolor)
          Setter for property bgcolor.
 void setButton(int index, JspButton button)
          Altera um botao da toolbar.
 void setHeight(java.lang.String height)
          Setter for property height.
 void setWidth(java.lang.String width)
          Setter for property width.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, 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

_buttonList

protected java.util.ArrayList _buttonList
Lista de butoes da tooolbar.


results

protected java.lang.StringBuffer results
Buffer onde e despejado o codigo em HTML.

Constructor Detail

ToolBarTag

public ToolBarTag()
Method Detail

printButton

protected void printButton(JspButton button)
Imprime o codigo correspondente a um botao.


printToolBar

protected void printToolBar()
Imprime o codigo da toolBar em HTML.


doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspTagException
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Throws:
javax.servlet.jsp.JspTagException

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspTagException
Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Throws:
javax.servlet.jsp.JspTagException

doCatch

public void doCatch(java.lang.Throwable t)
             throws java.lang.Throwable
Invoked if a Throwable occurs while evaluating the BODY inside a tag or in any of the following methods: Tag.doStartTag(), Tag.doEndTag(), IterationTag.doAfterBody() and BodyTag.doInitBody(). This method is not invoked if the Throwable occurs during one of the setter methods. This method may throw an exception (the same or a new one) that will be propagated further up the nest chain. If an exception is thrown, doFinally() will be invoked. This method is intended to be used to respond to an exceptional condition.

Specified by:
doCatch in interface javax.servlet.jsp.tagext.TryCatchFinally
Parameters:
t - - The throwable exception navigating through this tag.
Throws:
java.lang.Throwable - - if the exception is to be rethrown further up the nest chain.

doFinally

public void doFinally()
Invoked in all cases after doEndTag() for any class implementing Tag, IterationTag or BodyTag. This method is invoked even if an exception has occurred in the BODY of the tag, or in any of the following methods: Tag.doStartTag(), Tag.doEndTag(), IterationTag.doAfterBody() and BodyTag.doInitBody(). This method is not invoked if the Throwable occurs during one of the setter methods. This method should not throw an Exception. This method is intended to maintain per-invocation data integrity and resource management actions.

Specified by:
doFinally in interface javax.servlet.jsp.tagext.TryCatchFinally

addButton

public void addButton(JspButton button)
Adiciona um botao a toolbar.


setButton

public void setButton(int index,
                      JspButton button)
Altera um botao da toolbar.


setBgcolor

public void setBgcolor(java.lang.String bgcolor)
Setter for property bgcolor.

Parameters:
bgcolor - New value of property bgcolor.

setHeight

public void setHeight(java.lang.String height)
Setter for property height.

Parameters:
height - New value of property height.

setWidth

public void setWidth(java.lang.String width)
Setter for property width.

Parameters:
width - New value of property width.

getButtonIndex

public int getButtonIndex(java.lang.String buttonValue)
Returns the index of a button.

Parameters:
buttonValue - The value of the button.
Returns:
The index of the button of the toolbar with the given value or -1 if the button does not exists.

getButton

public SimpleToolBarButton getButton(int button)
                              throws java.lang.IndexOutOfBoundsException
Devolve um determinado botao da toolbar.

Specified by:
getButton in interface SimpleToolBar
Parameters:
button - Indice do botao a devolver.
Returns:
Um determinado botao da toolbar.
Throws:
java.lang.IndexOutOfBoundsException - se o indice não existir.

getButton

public JspButton getButton(java.lang.String buttonValue)
Devolve um determinado botao da toolbar.

Parameters:
buttonValue - Valor que e retornado pelo botao no submit.
Returns:
Um determinado botao da toolbar ou null caso nao exista nenhum botao com o nome referido.

getButtonsCount

public int getButtonsCount()
Devolve o numero de botoes da ToolBar.

Specified by:
getButtonsCount in interface SimpleToolBar
Returns:
O numero de botoes da ToolBar.

isEnabled

public boolean isEnabled()
Verifica se a toolbar esta activa ou nao.

Specified by:
isEnabled in interface SimpleToolBar