Source Code Cross Referenced for DateFormatBlock.java in  » Content-Management-System » harmonise » org » openharmonise » swing » datefield » 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 » Content Management System » harmonise » org.openharmonise.swing.datefield 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * The contents of this file are subject to the 
003:         * Mozilla Public License Version 1.1 (the "License"); 
004:         * you may not use this file except in compliance with the License. 
005:         * You may obtain a copy of the License at http://www.mozilla.org/MPL/
006:         *
007:         * Software distributed under the License is distributed on an "AS IS"
008:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. 
009:         * See the License for the specific language governing rights and 
010:         * limitations under the License.
011:         *
012:         * The Initial Developer of the Original Code is Simulacra Media Ltd.
013:         * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
014:         *
015:         * All Rights Reserved.
016:         *
017:         * Contributor(s):
018:         */
019:        package org.openharmonise.swing.datefield;
020:
021:        /**
022:         * Represents a date field base on a parsed date format. For example if
023:         * the date format string was "yyy-MM-dd" you would end up with 5 date format
024:         * blocks;
025:         * 
026:         * 3 active ones: "yyyy", "MM" and "dd"
027:         * 2 inactive ones: "-" and "-"
028:         * 
029:         * @author Matthew Large
030:         * @version $Revision: 1.1 $
031:         *
032:         */
033:        public class DateFormatBlock {
034:
035:            /**
036:             * Format string, based on the {@link java.text.SimpleDateFormat} format strings.
037:             */
038:            private String m_sFormat = null;
039:
040:            /**
041:             * true if this is an active block, i.e. is not a separator such as "-" or "/".
042:             */
043:            private boolean m_bIsActiveBlock = false;
044:
045:            /**
046:             * Length that the input value for this block should be.
047:             */
048:            private int m_nInputLength = -1;
049:
050:            /**
051:             * Position in date string that this block starts at. 
052:             */
053:            private int m_nStartPosition = -1;
054:
055:            /**
056:             * Value for when the block is cleared.
057:             */
058:            private String m_sClearedValue = null;
059:
060:            /**
061:             * Calendar field that this block represents. Uses the {@link java.util.Calendar} field identifiers.
062:             */
063:            private int m_nCalendarField = -1;
064:
065:            /**
066:             * The format string to be displayed, this may be different from the {@link java.text.SimpleDateFormat} based string, e.g. "yyyy" will be displayed as "ccyy" which is more acceptable to general users. 
067:             */
068:            private String m_sEntryFormat = null;
069:
070:            /**
071:             * Constructs a new date format block.
072:             * 
073:             * @param sFormat Format string
074:             * @param bIsActiveBlock true if this is an active block
075:             * @param nStartPosition Position in value string that this block starts at
076:             * @param nInputLength Length of input value
077:             * @param sClearedValue Value for when this block is cleared
078:             * @param nCalendarField {@link java.util.Calendar} field that this block represents
079:             * @param sEntryFormat Format string to be displayed
080:             */
081:            public DateFormatBlock(String sFormat, boolean bIsActiveBlock,
082:                    int nStartPosition, int nInputLength, String sClearedValue,
083:                    int nCalendarField, String sEntryFormat) {
084:                super ();
085:                this .m_sFormat = sFormat;
086:                this .m_bIsActiveBlock = bIsActiveBlock;
087:                this .m_nStartPosition = nStartPosition;
088:                this .m_nInputLength = nInputLength;
089:                this .m_sClearedValue = sClearedValue;
090:                this .m_nCalendarField = nCalendarField;
091:                this .m_sEntryFormat = sEntryFormat;
092:            }
093:
094:            /**
095:             * Returns the {@link java.util.Calendar} date field that this block
096:             * represents.
097:             * 
098:             * @return Date field
099:             */
100:            public int getCalendarField() {
101:                return this .m_nCalendarField;
102:            }
103:
104:            /**
105:             * Returns the cleared value.
106:             * 
107:             * @return Value
108:             */
109:            public String getClearedValue() {
110:                return this .m_sClearedValue;
111:            }
112:
113:            /**
114:             * Sets the cleared value.
115:             * 
116:             * @param sClearedValue Value
117:             */
118:            public void setClearedValue(String sClearedValue) {
119:                this .m_sClearedValue = sClearedValue;
120:            }
121:
122:            /**
123:             * Returns the format string.
124:             * 
125:             * @return Format string
126:             */
127:            public String getFormat() {
128:                return this .m_sFormat;
129:            }
130:
131:            /**
132:             * Returns the length for the input value.
133:             * 
134:             * @return Length
135:             */
136:            public int getInputLength() {
137:                return m_nInputLength;
138:            }
139:
140:            /**
141:             * Returns the position in the date string that this block starts at.
142:             * 
143:             * @return Start position
144:             */
145:            public int getStartPosition() {
146:                return this .m_nStartPosition;
147:            }
148:
149:            /**
150:             * Checks if this is an active block.
151:             * 
152:             * @return true if this is an active block
153:             */
154:            public boolean isActiveBlock() {
155:                return this .m_bIsActiveBlock;
156:            }
157:
158:            /**
159:             * Returns the format string to be displayed.
160:             * 
161:             * @return Displayable format string
162:             */
163:            public String getEntryFormat() {
164:                return this .m_sEntryFormat;
165:            }
166:
167:            /* (non-Javadoc)
168:             * @see java.lang.Object#toString()
169:             */
170:            public String toString() {
171:                StringBuffer sBuff = new StringBuffer("[\"");
172:                sBuff.append(this .m_sFormat).append("\"(").append(
173:                        m_bIsActiveBlock).append(")]");
174:                return sBuff.toString();
175:            }
176:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.