Source Code Cross Referenced for ProjectOptionSet.java in  » J2EE » enhydra » org » enhydra » tool » codegen » 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 » enhydra » org.enhydra.tool.codegen 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Enhydra Java Application Server Project
003:         *
004:         * The contents of this file are subject to the Enhydra Public License
005:         * Version 1.1 (the "License"); you may not use this file except in
006:         * compliance with the License. You may obtain a copy of the License on
007:         * the Enhydra web site ( http://www.enhydra.org/ ).
008:         *
009:         * Software distributed under the License is distributed on an "AS IS"
010:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
011:         * the License for the specific terms governing rights and limitations
012:         * under the License.
013:         *
014:         * The Initial Developer of the Enhydra Application Server is Lutris
015:         * Technologies, Inc. The Enhydra Application Server and portions created
016:         * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
017:         * All Rights Reserved.
018:         *
019:         * Contributor(s):
020:         * Paul Mahar
021:         *
022:         */
023:        package org.enhydra.tool.codegen;
024:
025:        // ToolBox imports
026:
027:        import org.enhydra.tool.ToolBoxInfo;
028:
029:        // Standard imports
030:
031:        import java.io.File;
032:        import java.util.StringTokenizer;
033:        import java.util.ResourceBundle;
034:
035:        /**
036:         * This class instantiates a set of default GeneratorOptions during
037:         * initialization. The default options include: project, d, package
038:         * copywrite, copywritefile, make, script, j2ee and overwrite.
039:         */
040:        abstract public class ProjectOptionSet extends OptionSet implements 
041:                Constants {
042:
043:            /**
044:             * Property name for the project name option.
045:             */
046:            public static final String PROJECT = "project"; // nores
047:
048:            /**
049:             * Property name for the destintation option
050:             */
051:            public static final String ROOT = "root"; // nores
052:
053:            /**
054:             * Property name for the package option.
055:             */
056:            public static final String PACKAGE = "package"; // nores
057:
058:            /**
059:             * Property name for the copyright option.
060:             */
061:            public static final String COPYRIGHT = "copyright"; // nores
062:
063:            /**
064:             * Property name for the copyright file option.
065:             */
066:            public static final String COPYRIGHTFILE = "copyrightfile"; // nores
067:
068:            /**
069:             * Property name for the script option.
070:             */
071:            public static final String NOCLI = "nocli"; // nores
072:
073:            /**
074:             * Property name for the overwrite option.
075:             */
076:            public static final String OVERWRITE = "overwrite"; // nores
077:
078:            //
079:
080:            private final String DEF_PROJECT = "untitled1"; // nores
081:            private final String DEF_PACKAGE = "untitled"; // nores
082:
083:            /**
084:             * Create a default set of options. This is a convenience class that
085:             * can be used as the basis for building custom option set within
086:             * a generator.
087:             */
088:            public ProjectOptionSet() {
089:
090:                try {
091:                    add(new GeneratorOption(PROJECT, DEF_PROJECT, res
092:                            .getString("PROJECT"), res
093:                            .getString("PROJECT_Instruct"), true, true));
094:                    add(new GeneratorOption(PACKAGE, DEF_PACKAGE, res
095:                            .getString("PACKAGE"), res
096:                            .getString("PACKAGE_Instruct"), true, true));
097:                    add(new GeneratorOption(ROOT, getDefaultRoot(), res
098:                            .getString("ROOT"), res.getString("ROOT_Instruct"),
099:                            true, true));
100:                    add(new GeneratorOption(COPYRIGHT, new String(), res
101:                            .getString("STRING"), res
102:                            .getString("STRING instruct"), false, true));
103:                    add(new GeneratorOption(COPYRIGHTFILE, new String(), res
104:                            .getString("FILE"), res.getString("FILE_instruct"),
105:                            false, true));
106:                    add(new GeneratorOption(NOCLI, false, res
107:                            .getString("Suppress_CLI"), true));
108:                    add(new GeneratorOption(OVERWRITE, false, res
109:                            .getString("OK_to_overwrite"), false));
110:                } catch (GeneratorException e) {
111:                    e.printStackTrace();
112:                }
113:            }
114:
115:            /**
116:             * Method declaration
117:             *
118:             *
119:             * @return
120:             */
121:            private String getDefaultRoot() {
122:                final String DIR_ENHYDRA_APPS = "myProjects"; // nores
123:                StringBuffer buf = new StringBuffer();
124:                String userHome = new String();
125:                File file = null;
126:
127:                userHome = System.getProperties().getProperty(SYS_USER_HOME);
128:
129:                buf.append(userHome);
130:                buf.append(File.separator);
131:                buf.append(DIR_ENHYDRA_APPS);
132:
133:                file = new File(buf.toString());
134:
135:                if (!file.exists()) {
136:                    file.mkdirs();
137:                }
138:
139:                if (!file.isDirectory()) {
140:                    buf.setLength(0);
141:                    buf.append(userHome);
142:                }
143:
144:                return buf.toString();
145:            }
146:
147:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.