org.appfuse.webapp.taglib
Class CountryTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.appfuse.webapp.taglib.CountryTag
All Implemented Interfaces:
Serializable, IterationTag, Tag

public class CountryTag
extends TagSupport

Tag for creating multiple <select> options for displaying a list of country names.

NOTE - This tag requires a Java2 (JDK 1.2 or later) platform.

Version:
$Revision: 1.4.2.1 $ $Date: 2006-06-10 08:00:48 -0600 (Sat, 10 Jun 2006) $
Author:
Jens Fischer, Matt Raible
See Also:
Serialized Form
JSP Tag:
name="country" bodycontent="empty"

Nested Class Summary
 class CountryTag.LabelValueComparator
          Class to compare LabelValues using their labels with locale-sensitive behaviour.
 
Field Summary
 
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
CountryTag()
           
 
Method Summary
protected  List buildCountryList(Locale locale)
          Build a List of LabelValues for all the available countries.
 int doStartTag()
          Process the start of this tag.
 void release()
          Release aquired resources to enable tag reusage.
 void setDefault(String selected)
           
 void setName(String name)
           
 void setPrompt(String prompt)
           
 void setToScope(String scope)
          Property used to simply stuff the list of countries into a specified scope.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CountryTag

public CountryTag()
Method Detail

setName

public void setName(String name)
Parameters:
name - The name to set.
JSP Attribute:
required="false" rtexprvalue="true"

setPrompt

public void setPrompt(String prompt)
Parameters:
prompt - The prompt to set.
JSP Attribute:
required="false" rtexprvalue="true"

setDefault

public void setDefault(String selected)
Parameters:
selected - The selected option.
JSP Attribute:
required="false" rtexprvalue="true"

setToScope

public void setToScope(String scope)
Property used to simply stuff the list of countries into a specified scope.

Parameters:
scope -
JSP Attribute:
required="false" rtexprvalue="true"

doStartTag

public int doStartTag()
               throws JspException
Process the start of this tag.

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class TagSupport
Returns:
int status
Throws:
JspException - if a JSP exception has occurred
See Also:
Tag.doStartTag()

release

public void release()
Release aquired resources to enable tag reusage.

Specified by:
release in interface Tag
Overrides:
release in class TagSupport
See Also:
Tag.release()

buildCountryList

protected List buildCountryList(Locale locale)
Build a List of LabelValues for all the available countries. Uses the two letter uppercase ISO name of the country as the value and the localized country name as the label.

Parameters:
locale - The Locale used to localize the country names.
Returns:
List of LabelValues for all available countries.


Copyright � 2002-2006