Source Code Cross Referenced for HtmlOutputText.java in  » EJB-Server-resin-3.1.5 » jsf » javax » faces » component » html » 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 » EJB Server resin 3.1.5 » jsf » javax.faces.component.html 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved
003:         *
004:         * This file is part of Resin(R) Open Source
005:         *
006:         * Each copy or derived work must preserve the copyright notice and this
007:         * notice unmodified.
008:         *
009:         * Resin Open Source is free software; you can redistribute it and/or modify
010:         * it under the terms of the GNU General Public License version 2
011:         * as published by the Free Software Foundation.
012:         *
013:         * Resin Open Source is distributed in the hope that it will be useful,
014:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
015:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
016:         * of NON-INFRINGEMENT.  See the GNU General Public License for more
017:         * details.
018:         *
019:         * You should have received a copy of the GNU General Public License
020:         * along with Resin Open Source; if not, write to the
021:         *
022:         *   Free Software Foundation, Inc.
023:         *   59 Temple Place, Suite 330
024:         *   Boston, MA 02111-1307  USA
025:         *
026:         * @author Scott Ferguson
027:         */
028:
029:        package javax.faces.component.html;
030:
031:        import java.util.*;
032:
033:        import javax.el.*;
034:
035:        import javax.faces.context.*;
036:        import javax.faces.component.*;
037:
038:        public class HtmlOutputText extends UIOutput {
039:            public static final String COMPONENT_TYPE = "javax.faces.HtmlOutputText";
040:
041:            private static final HashMap<String, PropEnum> _propMap = new HashMap<String, PropEnum>();
042:
043:            private String _dir;
044:            private ValueExpression _dirExpr;
045:
046:            private String _lang;
047:            private ValueExpression _langExpr;
048:
049:            private String _style;
050:            private ValueExpression _styleExpr;
051:
052:            private String _styleClass;
053:            private ValueExpression _styleClassExpr;
054:
055:            private String _title;
056:            private ValueExpression _titleExpr;
057:
058:            private Boolean _escape;
059:            private ValueExpression _escapeExpr;
060:
061:            public HtmlOutputText() {
062:                setRendererType("javax.faces.Text");
063:            }
064:
065:            //
066:            // properties
067:            //
068:
069:            public String getDir() {
070:                if (_dir != null)
071:                    return _dir;
072:                else if (_dirExpr != null)
073:                    return Util.evalString(_dirExpr);
074:                else
075:                    return null;
076:            }
077:
078:            public void setDir(String dir) {
079:                _dir = dir;
080:            }
081:
082:            public boolean isEscape() {
083:                if (_escape != null)
084:                    return _escape;
085:                else if (_escapeExpr != null)
086:                    return Util.evalBoolean(_escapeExpr);
087:                else
088:                    return true;
089:            }
090:
091:            public void setEscape(boolean isEscape) {
092:                _escape = isEscape;
093:            }
094:
095:            public String getLang() {
096:                if (_lang != null)
097:                    return _lang;
098:                else if (_langExpr != null)
099:                    return Util.evalString(_langExpr);
100:                else
101:                    return null;
102:            }
103:
104:            public void setLang(String lang) {
105:                _lang = lang;
106:            }
107:
108:            public String getStyle() {
109:                if (_style != null)
110:                    return _style;
111:                else if (_styleExpr != null)
112:                    return Util.evalString(_styleExpr);
113:                else
114:                    return null;
115:            }
116:
117:            public void setStyle(String style) {
118:                _style = style;
119:            }
120:
121:            public String getStyleClass() {
122:                if (_styleClass != null)
123:                    return _styleClass;
124:                else if (_styleClassExpr != null)
125:                    return Util.evalString(_styleClassExpr);
126:                else
127:                    return null;
128:            }
129:
130:            public void setStyleClass(String styleClass) {
131:                _styleClass = styleClass;
132:            }
133:
134:            public String getTitle() {
135:                if (_title != null)
136:                    return _title;
137:                else if (_titleExpr != null)
138:                    return Util.evalString(_titleExpr);
139:                else
140:                    return null;
141:            }
142:
143:            public void setTitle(String title) {
144:                _title = title;
145:            }
146:
147:            //
148:            // value expression override
149:            //
150:
151:            /**
152:             * Returns the value expression with the given name.
153:             */
154:            @Override
155:            public ValueExpression getValueExpression(String name) {
156:                PropEnum prop = _propMap.get(name);
157:
158:                if (prop != null) {
159:                    switch (prop) {
160:                    case DIR:
161:                        return _dirExpr;
162:                    case ESCAPE:
163:                        return _escapeExpr;
164:                    case LANG:
165:                        return _langExpr;
166:                    case STYLE:
167:                        return _styleExpr;
168:                    case STYLE_CLASS:
169:                        return _styleClassExpr;
170:                    case TITLE:
171:                        return _titleExpr;
172:                    }
173:                }
174:
175:                return super .getValueExpression(name);
176:            }
177:
178:            /**
179:             * Sets the value expression with the given name.
180:             */
181:            @Override
182:            public void setValueExpression(String name, ValueExpression expr) {
183:                PropEnum prop = _propMap.get(name);
184:
185:                if (prop != null) {
186:                    switch (prop) {
187:                    case DIR:
188:                        if (expr != null && expr.isLiteralText()) {
189:                            _dir = Util.evalString(expr);
190:                            return;
191:                        } else
192:                            _dirExpr = expr;
193:                        break;
194:
195:                    case ESCAPE:
196:                        if (expr != null && expr.isLiteralText()) {
197:                            _escape = Util.evalBoolean(expr);
198:                            return;
199:                        } else
200:                            _escapeExpr = expr;
201:                        break;
202:
203:                    case LANG:
204:                        if (expr != null && expr.isLiteralText()) {
205:                            _lang = Util.evalString(expr);
206:                            return;
207:                        } else
208:                            _langExpr = expr;
209:                        break;
210:
211:                    case STYLE:
212:                        if (expr != null && expr.isLiteralText()) {
213:                            _style = Util.evalString(expr);
214:                            return;
215:                        } else
216:                            _styleExpr = expr;
217:                        break;
218:
219:                    case STYLE_CLASS:
220:                        if (expr != null && expr.isLiteralText()) {
221:                            _styleClass = Util.evalString(expr);
222:                            return;
223:                        } else
224:                            _styleClassExpr = expr;
225:                        break;
226:
227:                    case TITLE:
228:                        if (expr != null && expr.isLiteralText()) {
229:                            _title = Util.evalString(expr);
230:                            return;
231:                        } else
232:                            _titleExpr = expr;
233:                        break;
234:                    }
235:                }
236:
237:                super .setValueExpression(name, expr);
238:            }
239:
240:            //
241:            // state
242:            //
243:
244:            public Object saveState(FacesContext context) {
245:                Object parent = super .saveState(context);
246:
247:                return new Object[] { parent, _dir, _escape, _lang, _style,
248:                        _styleClass, _title, };
249:            }
250:
251:            public void restoreState(FacesContext context, Object value) {
252:                Object[] state = (Object[]) value;
253:
254:                if (state != null)
255:                    super .restoreState(context, state[0]);
256:
257:                _dir = (String) state[1];
258:                _escape = (Boolean) state[2];
259:                _lang = (String) state[3];
260:                _style = (String) state[4];
261:                _styleClass = (String) state[5];
262:                _title = (String) state[6];
263:            }
264:
265:            //
266:            // private impl
267:            //
268:
269:            private enum PropEnum {
270:                DIR, ESCAPE, LANG, STYLE, STYLE_CLASS, TITLE,
271:            }
272:
273:            static {
274:                _propMap.put("dir", PropEnum.DIR);
275:                _propMap.put("escape", PropEnum.ESCAPE);
276:                _propMap.put("lang", PropEnum.LANG);
277:                _propMap.put("style", PropEnum.STYLE);
278:                _propMap.put("styleClass", PropEnum.STYLE_CLASS);
279:                _propMap.put("title", PropEnum.TITLE);
280:            }
281:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.