Java Doc for RelativeDateFormatter.java in  » Swing-Library » jgoodies-validation » com » jgoodies » validation » formatter » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Swing Library » jgoodies validation » com.jgoodies.validation.formatter 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.jgoodies.validation.formatter.EmptyDateFormatter
   com.jgoodies.validation.formatter.RelativeDateFormatter

RelativeDateFormatter
public class RelativeDateFormatter extends EmptyDateFormatter (Code)
Adds relative dates and output shortcuts to its superclass EmptyDateFormatter.

If output shortcuts are enabled, Yesterday, Today and Tomorrow are formatted using their localized human-language print strings.

If relative input is allowed, the parser accepts signed integers that encode a date relative to today; this input would otherwise be considered invalid.
author:
   Karsten Lentzsch
version:
   $Revision: 1.9 $
See Also:   com.jgoodies.validation.util.ValidationUtils
See Also:   javax.swing.JFormattedTextField



Field Summary
final public static  StringKEY_TODAY
     The resource bundle key used to localize 'Today'.
final public static  StringKEY_TOMORROW
     The resource bundle key used to localize 'Tomorrow'.
final public static  StringKEY_YESTERDAY
     The resource bundle key used to localize 'Yesterday'.

Constructor Summary
public  RelativeDateFormatter()
     Constructs a RelativeDateFormatter using the default DateFormat with output shortcuts and relative input enabled.
public  RelativeDateFormatter(DateFormat format)
     Constructs a RelativeDateFormatter using the given DateFormat with output shortcuts and relative input enabled.
public  RelativeDateFormatter(boolean useOutputShortcuts, boolean allowRelativeInput)
     Constructs a RelativeDateFormatter using the default DateFormat with output shortcuts and relative input configured as specified.
public  RelativeDateFormatter(DateFormat format, boolean useOutputShortcuts, boolean allowRelativeInput)
     Constructs a RelativeDateFormatter using the given DateFormat with output shortcuts and relative input configured as specified.

Method Summary
public static  ResourceBundlegetDefaultResourceBundle()
     Returns the ResourceBundle that is used as default unless overridden by an individual bundle.
final public  ResourceBundlegetResourceBundle()
     Returns the ResourceBundle used to lookup localized texts for Yesterday, Today, and Tomorrow.
public static  voidsetDefaultResourceBundle(ResourceBundle newDefaultBundle)
     Sets the ResourceBundle that is used as default for all RelativeDateFormatters that have no individual bundle set.
final public  voidsetResourceBundle(ResourceBundle newBundle)
     Sets a ResourceBundle that will be used to lookup localized texts for Yesterday, Today, and Tomorrow.
public  ObjectstringToValue(String text)
     Returns the Object representation of the String text.

In addition to the delegate's behavior, this methods accepts signed integers interpreted as days relative to today.

public  StringvalueToString(Object value)
     Returns a String representation of the Object value.

Field Detail
KEY_TODAY
final public static String KEY_TODAY(Code)
The resource bundle key used to localize 'Today'.



KEY_TOMORROW
final public static String KEY_TOMORROW(Code)
The resource bundle key used to localize 'Tomorrow'.



KEY_YESTERDAY
final public static String KEY_YESTERDAY(Code)
The resource bundle key used to localize 'Yesterday'.




Constructor Detail
RelativeDateFormatter
public RelativeDateFormatter()(Code)
Constructs a RelativeDateFormatter using the default DateFormat with output shortcuts and relative input enabled.



RelativeDateFormatter
public RelativeDateFormatter(DateFormat format)(Code)
Constructs a RelativeDateFormatter using the given DateFormat with output shortcuts and relative input enabled.
Parameters:
  format - the DateFormat used to format and parse dates



RelativeDateFormatter
public RelativeDateFormatter(boolean useOutputShortcuts, boolean allowRelativeInput)(Code)
Constructs a RelativeDateFormatter using the default DateFormat with output shortcuts and relative input configured as specified.
Parameters:
  useOutputShortcuts - true indicates that dates are formattedwith shortcuts for yesterday, today, and tomorrow, where falsealways converts using absolute numbers for day, month and year.
Parameters:
  allowRelativeInput - true indicates that the parser acceptssigned integers that encode a date relative to today; if falsesuch input is considered invalid



RelativeDateFormatter
public RelativeDateFormatter(DateFormat format, boolean useOutputShortcuts, boolean allowRelativeInput)(Code)
Constructs a RelativeDateFormatter using the given DateFormat with output shortcuts and relative input configured as specified.
Parameters:
  format - the DateFormat used to format and parse dates
Parameters:
  useOutputShortcuts - true indicates that dates are formattedwith shortcuts for yesterday, today, and tomorrow, where falsealways converts using absolute numbers for day, month and year.
Parameters:
  allowRelativeInput - true indicates that the parser acceptssigned integers that encode a date relative to today; if falsesuch input is considered invalid




Method Detail
getDefaultResourceBundle
public static ResourceBundle getDefaultResourceBundle()(Code)
Returns the ResourceBundle that is used as default unless overridden by an individual bundle. the ResourceBundle that is used as default



getResourceBundle
final public ResourceBundle getResourceBundle()(Code)
Returns the ResourceBundle used to lookup localized texts for Yesterday, Today, and Tomorrow. In case no bundle is set, these 3 dates will be formatted using the English texts. the ResourceBundle used to lookup localized texts
See Also:   RelativeDateFormatter.setResourceBundle(ResourceBundle)
See Also:   RelativeDateFormatter.getDefaultResourceBundle()
See Also:   RelativeDateFormatter.setDefaultResourceBundle(ResourceBundle)



setDefaultResourceBundle
public static void setDefaultResourceBundle(ResourceBundle newDefaultBundle)(Code)
Sets the ResourceBundle that is used as default for all RelativeDateFormatters that have no individual bundle set.
Parameters:
  newDefaultBundle - the ResourceBundle to be used as default



setResourceBundle
final public void setResourceBundle(ResourceBundle newBundle)(Code)
Sets a ResourceBundle that will be used to lookup localized texts for Yesterday, Today, and Tomorrow. In case no bundle is set, the default bundle will be used.
Parameters:
  newBundle - the ResourceBundle to set
See Also:   RelativeDateFormatter.getResourceBundle()
See Also:   RelativeDateFormatter.getDefaultResourceBundle()
See Also:   RelativeDateFormatter.setDefaultResourceBundle(ResourceBundle)



stringToValue
public Object stringToValue(String text) throws ParseException(Code)
Returns the Object representation of the String text.

In addition to the delegate's behavior, this methods accepts signed integers interpreted as days relative to today.
Parameters:
  text - the String to convert the Object representation of text
throws:
  ParseException - if there is an error in the conversion




valueToString
public String valueToString(Object value) throws ParseException(Code)
Returns a String representation of the Object value. This invokes format on the current DateFormat.

In addition to the superclass behavior, this method formats the dates for yesterday, today and tomorrow to the natural language strings.
Parameters:
  value - The value to convert a String representation for the value
throws:
  ParseException - if there is an error in the conversion




Methods inherited from com.jgoodies.validation.formatter.EmptyDateFormatter
public Object stringToValue(String text) throws ParseException(Code)(Java Doc)
public String valueToString(Object value) throws ParseException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.