Source Code Cross Referenced for JFormattedTextFieldModel.java in  » XML-UI » SwingML » org » swingml » model » 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 » XML UI » SwingML » org.swingml.model 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.swingml.model;
002:
003:        import javax.swing.*;
004:        import javax.swing.text.*;
005:
006:        import org.swingml.*;
007:        import org.swingml.system.*;
008:
009:        /**
010:         * @author NumberSix
011:         */
012:        public class JFormattedTextFieldModel extends SwingMLModel {
013:
014:            private boolean autoSelect = true;
015:            private String button; // Name of the button that should be clicked on a  return (enter) key press.
016:            private String cols = null;
017:            private boolean editable = true;
018:            private boolean enabled = true;
019:            private JFormattedTextField.AbstractFormatter formatter = null;
020:            private boolean overwrite = false;
021:            private String pattern = null;
022:            private char placeholdChar = ' ';
023:            private String placeholder = null;
024:
025:            public JFormattedTextFieldModel() {
026:                super ();
027:            }
028:
029:            public String getCols() {
030:                return this .cols;
031:            }
032:
033:            public JFormattedTextField.AbstractFormatter getFormatter() {
034:                return this .formatter;
035:            }
036:
037:            public String getPattern() {
038:                return pattern;
039:            }
040:
041:            public char getPlaceholdChar() {
042:                return placeholdChar;
043:            }
044:
045:            public String getPlaceholder() {
046:                return placeholder;
047:            }
048:
049:            public String getReturnButton() {
050:                return button;
051:            }
052:
053:            public boolean isEditable() {
054:                return this .editable;
055:            }
056:
057:            public boolean isEnabled() {
058:                return this .enabled;
059:            }
060:
061:            public boolean isOverwrite() {
062:                return overwrite;
063:            }
064:
065:            public void setAutoSelect(boolean shouldAutoSelect) {
066:                this .autoSelect = shouldAutoSelect;
067:            }
068:
069:            public void setCols(String columns) {
070:                this .cols = columns;
071:            }
072:
073:            public void setEditable(boolean isEditable) {
074:                this .editable = isEditable;
075:            }
076:
077:            public void setEnabled(boolean isEnabled) {
078:                this .enabled = isEnabled;
079:            }
080:
081:            public void setFormatter(
082:                    JFormattedTextField.AbstractFormatter aFormatter) {
083:                this .formatter = aFormatter;
084:            }
085:
086:            public void setOverwrite(boolean shouldOverwrite) {
087:                overwrite = shouldOverwrite;
088:            }
089:
090:            public void setPattern(String aPattern) {
091:                pattern = aPattern;
092:            }
093:
094:            public void setPlaceholdChar(char aChar) {
095:                placeholdChar = aChar;
096:            }
097:
098:            public void setPlaceholder(String aPlaceholder) {
099:                placeholder = aPlaceholder;
100:            }
101:
102:            public void setReturnButton(final String aButtonName) {
103:                button = aButtonName;
104:            }
105:
106:            public boolean shouldAutoSelectOnFocus() {
107:                return autoSelect;
108:            }
109:
110:            public void validate() {
111:                if (super .getParent().getLayout() != null
112:                        && super .getParent().getLayout().equalsIgnoreCase(
113:                                Constants.BORDERLAYOUT)) {
114:                    if (super .getOrientation() == null) {
115:                        SwingMLLogger
116:                                .getInstance()
117:                                .log(
118:                                        "Syntax error: The parameter ORIENTATION in the element "
119:                                                + super .getName()
120:                                                + " is required since its parent's LAYOUT is BorderLayout. Add the parameter ORIENTATION to the element "
121:                                                + super .getName()
122:                                                + " or change its parent's LAYOUT to other than BorderLayout.");
123:                    }
124:                }
125:                if (super .getParent().getLayout() != null
126:                        && !super .getParent().getLayout().equalsIgnoreCase(
127:                                Constants.BORDERLAYOUT)) {
128:                    if (super .getOrientation() != null) {
129:                        SwingMLLogger
130:                                .getInstance()
131:                                .log(
132:                                        "Syntax error: The parameter ORIENTATION in the element "
133:                                                + super .getName()
134:                                                + " should be used only when its parent's LAYOUT is BorderLayout. Change its parent's LAYOUT to BorderLayout or delete the parameter ORIENTATION from the element "
135:                                                + super .getName() + ".");
136:                    }
137:                }
138:                try {
139:                    Integer.parseInt(this .cols);
140:                } catch (NumberFormatException e) {
141:                    this .cols = "0";
142:                    SwingMLLogger.getInstance().log(
143:                            "Syntax error: The parameter COLS in the element "
144:                                    + super .getName()
145:                                    + " should be a numeric value.");
146:                }
147:                JFormattedTextField.AbstractFormatter aFormatter = this 
148:                        .getFormatter();
149:                if (aFormatter == null) {
150:                    SwingMLLogger.getInstance().log(
151:                            "Syntax error: The parameter FORMATTER in the element "
152:                                    + super .getName() + " is required.");
153:                }
154:                if (aFormatter != null && aFormatter instanceof  MaskFormatter) {
155:                    if (this .pattern == null) {
156:                        SwingMLLogger
157:                                .getInstance()
158:                                .log(
159:                                        "Syntax error: The parameter PATTERN in the element "
160:                                                + super .getName()
161:                                                + " is required for FORMATTER MaskFormatter.");
162:                    }
163:                }
164:            }
165:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.