KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > kelp > common > codegen > WebAppUtil


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * 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.OtterNode;
32 import org.enhydra.kelp.common.node.OtterProject;
33 import org.enhydra.kelp.common.node.OtterFolderNode;
34 import org.enhydra.kelp.common.node.OtterJavaFileNode;
35 import org.enhydra.kelp.common.node.OtterTextFileNode;
36 import org.enhydra.kelp.common.node.OtterNodeFactory;
37
38 // Standard imports
39
import java.awt.Component JavaDoc;
40 import java.io.File JavaDoc;
41 import java.io.FilenameFilter JavaDoc;
42 import java.util.Vector JavaDoc;
43 import java.util.ResourceBundle JavaDoc;
44
45 //
46
public class WebAppUtil extends AppGenUtil {
47
48     // string not to be resourced
49
private final static String JavaDoc DEFAULT_COMMAND_NAME = "webapp"; // nores
50

51     //
52
public WebAppUtil() throws CodeGenException {
53         super(new WebAppGenerator());
54     }
55
56     public WebAppUtil(OtterProject project) throws CodeGenException {
57         super(project, new WebAppGenerator());
58     }
59     
60     public WebAppUtil(OtterProject project, WebAppGenerator gen) throws CodeGenException {
61         super(project, gen);
62     }
63     
64
65     public static ProjectGenerator createGenerator() {
66         return new WebAppGenerator();
67     }
68
69     public static String JavaDoc getCommandName() {
70         String JavaDoc commandName = DEFAULT_COMMAND_NAME;
71
72         if (KelpInfo.isClassPathComplete()) {
73             commandName = WebAppGenerator.COMMAND_NAME;
74         }
75         return commandName;
76     }
77
78     /**
79      * Method declaration
80      *
81      * @return
82      */

83     public static String JavaDoc getDisplayName() {
84         String JavaDoc displayName = res.getString("Web_Application");
85
86         if (KelpInfo.isClassPathComplete()) {
87             displayName = WebAppGenerator.displayName;
88         }
89         return displayName;
90     }
91
92 }
93
Popular Tags