Source Code Cross Referenced for PropertyClassNameUtil.java in  » J2EE » ICEfaces-1.6.1 » com » icesoft » jsfmeta » eclipse » 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 » J2EE » ICEfaces 1.6.1 » com.icesoft.jsfmeta.eclipse 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * PropertyClassNameUtil to rematch CM model type
003:         */
004:
005:        package com.icesoft.jsfmeta.eclipse;
006:
007:        import com.icesoft.jsfmeta.util.ConfigStorage;
008:        import com.icesoft.jsfmeta.util.GeneratorUtil;
009:        import java.util.Arrays;
010:        import java.util.HashMap;
011:        import java.util.HashSet;
012:        import java.util.Iterator;
013:        import java.util.Map;
014:        import java.util.Properties;
015:        import java.util.Set;
016:
017:        public class PropertyClassNameUtil {
018:
019:            private Properties properties;
020:            private Map propertyNameToTypeMap = new HashMap();
021:            private Map propertyClassToTypeMap = new HashMap();
022:            private Map propertyCategoryToTypeMap = new HashMap();
023:
024:            public PropertyClassNameUtil() {
025:                properties = loadProperties();
026:                initMapping();
027:            }
028:
029:            public Properties loadProperties() {
030:
031:                String filePath = GeneratorUtil.getWorkingFolder()
032:                        + "conf/eclipse.schema/cm_type.properties";
033:                Properties props = ConfigStorage.getInstance(filePath)
034:                        .loadProperties();
035:                for (Iterator iterator = props.keySet().iterator(); iterator
036:                        .hasNext();) {
037:                    Object nextKey = iterator.next();
038:                }
039:                return props;
040:            }
041:
042:            public void initMapping() {
043:                String[] propertyNames = new String[] { "style", "styleClass",
044:                        "bgcolor", "binding" };
045:                String[] propertyTypes = new String[] { "CSSSTYLE", "CSSCLASS",
046:                        "COLOR", "PROPERTYBINDING" };
047:
048:                for (int i = 0; i < propertyNames.length; i++) {
049:                    propertyNameToTypeMap.put(propertyNames[i],
050:                            propertyTypes[i]);
051:                }
052:
053:                String[] propertyClasses = new String[] {
054:                        "com.icesoft.faces.context.effects.Effect", "boolean",
055:                        "java.lang.Object", "javax.faces.el.MethodBinding" };
056:                String[] propertyClassesToTypes = new String[] {
057:                        "METHODBINDING", "BOOLEAN", "METHODBINDING",
058:                        "METHODBINDING" };
059:
060:                for (int i = 0; i < propertyClasses.length; i++) {
061:                    propertyClassToTypeMap.put(propertyClasses[i],
062:                            propertyClassesToTypes[i]);
063:                }
064:
065:                String[] propertyCategories = new String[] { "javascript" };
066:                String[] propertyCategroiesToTypes = new String[] { "JAVASCRIPT" };
067:
068:                for (int i = 0; i < propertyCategories.length; i++) {
069:                    propertyClassToTypeMap.put(propertyCategories[i],
070:                            propertyCategroiesToTypes[i]);
071:                }
072:
073:            }
074:
075:            //vwp metadata
076:            private final static Set propertyClassHashSet = new HashSet(Arrays
077:                    .asList(new String[] { "boolean",
078:                            "com.icesoft.faces.context.effects.Effect", "int",
079:                            "java.lang.Object", "java.lang.String",
080:                            "java.util.List", "javax.faces.convert.Converter",
081:                            "javax.faces.el.MethodBinding" }));
082:
083:            //eclipse cm model property type keywords
084:            private final static Set propertyTypeHashSet = new HashSet(Arrays
085:                    .asList(new String[] { "BOOLEAN", "COLOR", "CSSCLASS",
086:                            "CSSSTYLE", "ENUMERATED", "JAVASCRIPT",
087:                            "METHODBINDING", "NAMED-BOOLEAN",
088:                            "PROPERTYBINDING", "RELATIVEPATH", "WEBPATH" }));
089:
090:            public static boolean isPropertyType(String name) {
091:                return propertyTypeHashSet.contains(name);
092:            }
093:
094:            public static boolean isPropertyClass(String name) {
095:                return propertyClassHashSet.contains(name);
096:            }
097:
098:            //eclipse a separate marker for editor class yet, so type is associated with editor
099:            //
100:            public String getMatchedName(String propertyClassName,
101:                    String propertyCategoryName, String propertyName,
102:                    String propertyEditor) {
103:
104:                if (propertyClassName != null) {
105:                    propertyClassName = propertyClassName.trim();
106:                }
107:
108:                if (propertyCategoryName != null) {
109:                    propertyCategoryName = propertyCategoryName.trim();
110:                }
111:
112:                if (propertyName != null) {
113:                    propertyName = propertyName.trim();
114:                }
115:
116:                if ((String) propertyNameToTypeMap.get(propertyName) != null) {
117:                    return (String) propertyNameToTypeMap.get(propertyName);
118:                }
119:
120:                if ((String) propertyClassToTypeMap.get(propertyClassName) != null) {
121:                    return (String) propertyClassToTypeMap
122:                            .get(propertyClassName);
123:                }
124:
125:                if ((String) propertyCategoryToTypeMap
126:                        .get(propertyCategoryName) != null) {
127:                    return (String) propertyCategoryToTypeMap
128:                            .get(propertyCategoryName);
129:                }
130:
131:                if (propertyEditor != null
132:                        && (String) properties.get(propertyEditor) != null) {
133:                    return (String) properties.get(propertyEditor);
134:                }
135:
136:                return null;
137:            }
138:
139:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.