net.sf.tacos.formatter
Class DateJsFormatter

java.lang.Object
  extended by net.sf.tacos.formatter.DateJsFormatter
All Implemented Interfaces:
JsFormatter

public class DateJsFormatter
extends Object
implements JsFormatter

Javascript formatting renderer for numbers. The following parameters are allowed in the initializer:

Parameter Name Description Default
format Date/time format string. See SimpleDateFormat for details. %m/%d/%Y
ignoreSeparators If true, the formatter allows the user to enter the date without separators, as in: "03202006". It then formats the date. This speeds up text entry. true
separator Date separator. /
amSymbol Symbol for AM. Component's locale AM symbol.
pmSymbol Symbol for PM. Component's locale PM symbol.

Author:
lquijano

Field Summary
static String FORMATTER_SCRIPT_RESOURCE
          Classpath for formatter script.
 
Constructor Summary
DateJsFormatter()
          Default constructor, required by BeanFactory.
DateJsFormatter(String initializer)
          Constructor with initializer, required by BeanFactory.
 
Method Summary
 String getAmSymbol()
           
 String getFormat()
           
 String getIgnoreSeparators()
           
 String getPmSymbol()
           
 String getSeparator()
           
 void renderContributions(org.apache.tapestry.IRequestCycle cycle, org.apache.tapestry.engine.IScriptSource scriptSource, org.apache.tapestry.IComponent comp, String uniqueId)
          Renders the formatter contributions (usually JavaScript functions).
 void setAmSymbol(String amSymbol)
           
 void setFormat(String format)
           
 void setIgnoreSeparators(String ignoreSeparators)
           
 void setPmSymbol(String pmSymbol)
           
 void setSeparator(String separator)
           
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FORMATTER_SCRIPT_RESOURCE

public static final String FORMATTER_SCRIPT_RESOURCE
Classpath for formatter script.

See Also:
Constant Field Values
Constructor Detail

DateJsFormatter

public DateJsFormatter()
Default constructor, required by BeanFactory.


DateJsFormatter

public DateJsFormatter(String initializer)
Constructor with initializer, required by BeanFactory.

Method Detail

renderContributions

public void renderContributions(org.apache.tapestry.IRequestCycle cycle,
                                org.apache.tapestry.engine.IScriptSource scriptSource,
                                org.apache.tapestry.IComponent comp,
                                String uniqueId)
Renders the formatter contributions (usually JavaScript functions).

Specified by:
renderContributions in interface JsFormatter
Parameters:
cycle - Tapestry request cycle.
scriptSource - Tapestry script source.
comp - the component.
uniqueId - optional unique Id to override the component's id.

getFormat

public String getFormat()
Returns:
Returns the format.

setFormat

public void setFormat(String format)
Parameters:
format - The format to set.

getIgnoreSeparators

public String getIgnoreSeparators()
Returns:
Returns the ignoreSeparators.

setIgnoreSeparators

public void setIgnoreSeparators(String ignoreSeparators)
Parameters:
ignoreSeparators - The ignoreSeparators to set.

setAmSymbol

public void setAmSymbol(String amSymbol)
Parameters:
amSymbol - The amSymbol to set.

getAmSymbol

public String getAmSymbol()
Returns:
Returns the amSymbol.

getPmSymbol

public String getPmSymbol()
Returns:
Returns the pmSymbol.

setPmSymbol

public void setPmSymbol(String pmSymbol)
Parameters:
pmSymbol - The pmSymbol to set.

getSeparator

public String getSeparator()
Returns:
Returns the separator.

setSeparator

public void setSeparator(String separator)
Parameters:
separator - The separator to set.

toString

public String toString()

Overrides:
toString in class Object