org.makumba.forms.tags
Class MatchModeTag

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.forms.tags.MatchModeTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag

public class MatchModeTag
extends GenericMakumbaTag

Implements a match mode chooser, which can take the form of a select box or a radio button, and allows to select the type of match mode for the enclosing search criterion. Different modes apply for string (char, text), number (int, real) and date types. The latter two can also be matched against a range.

Version:
$Id: MatchModeTag.java,v 1.1 Oct 21, 2007 1:37:25 PM rudi Exp $
Author:
Rudolf Mayer
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.makumba.analyser.AnalysableElement
AnalysableElement.FilePositionElementComparator
 
Field Summary
static Hashtable<String,String> allMatchModes
           
static String[] allowedTypes
           
static Hashtable<String,String> knownDateMatchModes
           
static Hashtable<String,String> knownNumberMatchModes
           
static Hashtable<String,String> knownRangeMatchModes
          
static Hashtable<String,String> knownStringMatchModes
           
 
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.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
MatchModeTag()
           
 
Method Summary
 boolean allowsIdenticalKey()
          Determines whether the tag can have the same key as others in the page
 int doAnalyzedEndTag(PageCache pageCache)
          makumba-specific endTag
 void doStartAnalyze(PageCache pageCache)
          Starts the analysis of the tag, without knowing what tags follow it in the page.
protected  CriterionTag getCriterionTag()
           
static Hashtable<String,String> getValidMatchmodes(boolean isRange, FieldDefinition fd)
           
protected  void registerPossibleAttributeValues()
          Override this in order to register possible attribute values using AnalysableTag.registerAttributeValues(String, String...).
 void setDefault(String s)
           
 void setMatchModes(String s)
           
 void setTagKey(PageCache pageCache)
          Sets tagKey to uniquely identify this tag.
 void setType(String s)
           
 
Methods inherited from class org.makumba.commons.tags.GenericMakumbaTag
doAnalyzedCleanup, doStartTag, getParams, initialiseState, isAttribute, setAddTitle, setCols, 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, setUrlEncode, toString
 
Methods inherited from class org.makumba.analyser.AnalysableTag
addTagText, canHaveBody, checkAttributeValues, doAnalyzedStartTag, doEndAnalyze, doEndTag, getElementData, getPageContext, getPageTextInfo, getTagKey, getTagText, needPageCache, notEmpty, onlyInt, registerAttributeValues, 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
 

Field Detail

allowedTypes

public static final String[] allowedTypes

knownRangeMatchModes

public static final Hashtable<String,String> knownRangeMatchModes


knownStringMatchModes

public static final Hashtable<String,String> knownStringMatchModes

knownDateMatchModes

public static final Hashtable<String,String> knownDateMatchModes

knownNumberMatchModes

public static final Hashtable<String,String> knownNumberMatchModes

allMatchModes

public static final Hashtable<String,String> allMatchModes
Constructor Detail

MatchModeTag

public MatchModeTag()
Method Detail

getValidMatchmodes

public static Hashtable<String,String> getValidMatchmodes(boolean isRange,
                                                          FieldDefinition fd)

setMatchModes

public void setMatchModes(String s)

setType

public void setType(String s)
Overrides:
setType 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

getCriterionTag

protected CriterionTag getCriterionTag()

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()

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)

registerPossibleAttributeValues

protected void registerPossibleAttributeValues()
Description copied from class: AnalysableTag
Override this in order to register possible attribute values using AnalysableTag.registerAttributeValues(String, String...). The registered attributes are checked before AnalysableTag.doStartAnalyze(PageCache) and throw a ProgrammerError is thrown if the provided value is not allowed.

Overrides:
registerPossibleAttributeValues in class AnalysableTag

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

setDefault

public void setDefault(String s)
Overrides:
setDefault in class GenericMakumbaTag