org.makumba.list.tags
Class SectionTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.makumba.analyser.AnalysableElement
          extended by org.makumba.analyser.AnalysableTag
              extended by org.makumba.commons.tags.GenericMakumbaTag
                  extended by org.makumba.list.tags.SectionTag
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag

public class SectionTag
extends GenericMakumbaTag
implements BodyTag

mak:section tag, capable of rendering its content dynamically and reloading it via AJAX callbacks
TODO support for multiple events:
TODO special effects for show/hide/reload
TODO detection of "toggle"/"update" situation (i.e. two sections next to one another that hide/show on the same event)?

Version:
$Id: SectionTag.java,v 1.1 Dec 25, 2009 6:47:43 PM manu Exp $
Author:
Manuel Gay
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.makumba.analyser.AnalysableElement
AnalysableElement.FilePositionElementComparator
 
Field Summary
static String MAKUMBA_EVENT
           
 
Fields inherited from class org.makumba.commons.tags.GenericMakumbaTag
extraFormatting, extraFormattingParams, NEEDED_RESOURCES, params
 
Fields inherited from class org.makumba.analyser.AnalysableTag
ATTRIBUTE_VALUES_TRUE_FALSE, tagData, tagKey, TYPES
 
Fields inherited from class org.makumba.analyser.AnalysableElement
ANALYSIS_STATE
 
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
SectionTag()
           
 
Method Summary
 boolean allowsIdenticalKey()
          Determines whether the tag can have the same key as others in the page
 boolean canHaveBody()
          Determines whether this tag can have a body or not.
protected  void doAnalyzedCleanup()
          Called by doEndTag in its finally block.
 int doAnalyzedEndTag(PageCache pageCache)
          makumba-specific endTag
 int doAnalyzedStartTag(PageCache pageCache)
          makumba-specific startTag.
 void doInitBody()
           
 void doStartAnalyze(PageCache pageCache)
          Starts the analysis of the tag, without knowing what tags follow it in the page.
 String getHideOn()
           
 String getIterationExpr()
           
 String getName()
           
 String getReloadOn()
           
 String getShowOn()
           
 void setBodyContent(BodyContent b)
           
 void setHideOn(String hide)
           
 void setIterationExpr(String iterationExpression)
           
 void setName(String name)
           
 void setReloadOn(String reload)
           
 void setShowOn(String show)
           
 void setTagKey(PageCache pageCache)
          Sets tagKey to uniquely identify this tag.
 
Methods inherited from class org.makumba.commons.tags.GenericMakumbaTag
doStartTag, getParams, initialiseState, isAttribute, setAddTitle, setCols, setDefault, setElementSeparator, setEllipsis, setEllipsisLength, setEmpty, setFormat, setHtml, setLabelSeparator, setLineSeparator, setLongLineLength, setMaxlength, setMaxLength, setOnClick, setOnDblClick, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setRows, setSize, setStyle, setStyleClass, setStyleId, setTitle, setType, setType, setUrlEncode, toString
 
Methods inherited from class org.makumba.analyser.AnalysableTag
addTagText, checkAttributeValues, doEndAnalyze, doEndTag, getElementData, getPageContext, getPageTextInfo, getTagKey, getTagText, needPageCache, notEmpty, onlyInt, registerAttributeValues, registerPossibleAttributeValues, setTagDataAtAnalysis
 
Methods inherited from class org.makumba.analyser.AnalysableElement
checkTagFound, discardJSPParsingData, getAnalyzedElementData, getCurrentBodyTagData, getElementAfter, getElementBefore, getPageCache, getPageCache, getRunningElementData, getTagByAttribute, getTagById, getThreadElementStack, initializeThread, keepAnalysisState, setAnalyzedElementData, setRunningElementData
 
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, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
doEndTag, doStartTag, getParent, release, setPageContext, setParent
 

Field Detail

MAKUMBA_EVENT

public static final String MAKUMBA_EVENT
See Also:
Constant Field Values
Constructor Detail

SectionTag

public SectionTag()
Method Detail

getName

public String getName()

setName

public void setName(String name)

getShowOn

public String getShowOn()

setShowOn

public void setShowOn(String show)

getHideOn

public String getHideOn()

setHideOn

public void setHideOn(String hide)

getReloadOn

public String getReloadOn()

setReloadOn

public void setReloadOn(String reload)

getIterationExpr

public String getIterationExpr()

setIterationExpr

public void setIterationExpr(String iterationExpression)

doInitBody

public void doInitBody()
                throws JspException
Specified by:
doInitBody in interface BodyTag
Throws:
JspException

setBodyContent

public void setBodyContent(BodyContent b)
Specified by:
setBodyContent in interface BodyTag

canHaveBody

public boolean canHaveBody()
Description copied from class: AnalysableTag
Determines whether this tag can have a body or not.

Overrides:
canHaveBody in class AnalysableTag
Returns:
true if the tag is allowed to have a body, false otherwise

setTagKey

public void setTagKey(PageCache pageCache)
Description copied from class: AnalysableTag
Sets tagKey to uniquely identify this tag. Called at analysis time before doStartAnalyze() and at runtime before doMakumbaStartTag()

Overrides:
setTagKey in class AnalysableTag
Parameters:
pageCache - The page cache for the current page
See Also:
AnalysableTag.doAnalyzedStartTag(org.makumba.analyser.PageCache), AnalysableTag.doStartAnalyze(org.makumba.analyser.PageCache)

allowsIdenticalKey

public boolean allowsIdenticalKey()
Description copied from class: AnalysableTag
Determines whether the tag can have the same key as others in the page

Overrides:
allowsIdenticalKey in class AnalysableTag
Returns:
true if the tag is allowed to have the same key as others in the page, false otherwise

doAnalyzedCleanup

protected void doAnalyzedCleanup()
Description copied from class: AnalysableTag
Called by doEndTag in its finally block. Use it to clean references that will not be used next time the servlet container uses the tag object.

Overrides:
doAnalyzedCleanup in class GenericMakumbaTag

doStartAnalyze

public void doStartAnalyze(PageCache pageCache)
Description copied from class: AnalysableTag
Starts the analysis of the tag, without knowing what tags follow it in the page. Typically this method will allocate initial data structures, that are then completed at doEndAnalyze()

Overrides:
doStartAnalyze in class AnalysableTag
Parameters:
pageCache - The page cache for the current page

doAnalyzedStartTag

public int doAnalyzedStartTag(PageCache pageCache)
                       throws LogicException,
                              JspException
Description copied from class: AnalysableTag
makumba-specific startTag.

Overrides:
doAnalyzedStartTag in class AnalysableTag
Parameters:
pageCache - The page cache for the current page
Throws:
LogicException
JspException
See Also:
AnalysableTag.doStartTag()

doAnalyzedEndTag

public int doAnalyzedEndTag(PageCache pageCache)
                     throws LogicException,
                            JspException
Description copied from class: AnalysableTag
makumba-specific endTag

Overrides:
doAnalyzedEndTag in class AnalysableTag
Parameters:
pageCache - The page cache for the current page
Throws:
LogicException
JspException
See Also:
AnalysableTag.doEndTag()