01: /*
02: * Enhydra Java Application Server Project
03: *
04: * The contents of this file are subject to the Enhydra Public License
05: * Version 1.1 (the "License"); you may not use this file except in
06: * compliance with the License. You may obtain a copy of the License on
07: * the Enhydra web site ( http://www.enhydra.org/ ).
08: *
09: * Software distributed under the License is distributed on an "AS IS"
10: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11: * the License for the specific terms governing rights and limitations
12: * under the License.
13: *
14: * The Initial Developer of the Enhydra Application Server is Lutris
15: * Technologies, Inc. The Enhydra Application Server and portions created
16: * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17: * All Rights Reserved.
18: *
19: * Contributor(s):
20: * Paul Mahar
21: *
22: */
23: package org.enhydra.kelp.common.codegen;
24:
25: // ToolBox imports
26: import org.enhydra.tool.codegen.ProjectGenerator;
27: import org.enhydra.tool.codegen.internal.WebAppGenerator;
28:
29: // Kelp imports
30: import org.enhydra.kelp.KelpInfo;
31: import org.enhydra.kelp.common.node.OtterProject;
32:
33: //
34: public class WebAppUtil extends AppGenUtil {
35:
36: // string not to be resourced
37: private final static String DEFAULT_COMMAND_NAME = "webapp"; // nores
38:
39: //
40: public WebAppUtil() throws CodeGenException {
41: super (new WebAppGenerator());
42: }
43:
44: public WebAppUtil(OtterProject project) throws CodeGenException {
45: super (project, new WebAppGenerator());
46: }
47:
48: public WebAppUtil(OtterProject project, WebAppGenerator gen)
49: throws CodeGenException {
50: super (project, gen);
51: }
52:
53: public static ProjectGenerator createGenerator() {
54: return new WebAppGenerator();
55: }
56:
57: public static String getCommandName() {
58: String commandName = DEFAULT_COMMAND_NAME;
59:
60: if (KelpInfo.isClassPathComplete()) {
61: commandName = WebAppGenerator.COMMAND_NAME;
62: }
63: return commandName;
64: }
65:
66: /**
67: * Method declaration
68: *
69: * @return
70: */
71: public static String getDisplayName() {
72: String displayName = res.getString("Web_Application");
73:
74: if (KelpInfo.isClassPathComplete()) {
75: displayName = WebAppGenerator.displayName;
76: }
77: return displayName;
78: }
79:
80: }
|