KickJava   Java API By Example, From Geeks To Geeks.

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


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.common.ExtensionFilter;
27 import org.enhydra.tool.codegen.internal.AppGenerator;
28 import org.enhydra.tool.codegen.ProjectOptionSet;
29 import org.enhydra.tool.codegen.CodeGen;
30 import org.enhydra.tool.codegen.OptionSet;
31 import org.enhydra.tool.codegen.GeneratorException;
32 import org.enhydra.tool.codegen.wizard.CodeGenWizard;
33 import org.enhydra.tool.codegen.wizard.CodeGenPanel;
34
35 // Kelp imports
36
import org.enhydra.kelp.KelpInfo;
37 import org.enhydra.kelp.common.Constants;
38 import org.enhydra.kelp.common.map.Mapper;
39 import org.enhydra.kelp.common.node.OtterNode;
40 import org.enhydra.kelp.common.node.OtterProject;
41 import org.enhydra.kelp.common.node.OtterFolderNode;
42 import org.enhydra.kelp.common.node.OtterJavaFileNode;
43 import org.enhydra.kelp.common.node.OtterTextFileNode;
44 import org.enhydra.kelp.common.node.OtterNodeFactory;
45 import org.enhydra.kelp.common.importer.ImportPaths;
46 import org.enhydra.kelp.common.importer.ImportTool;
47 import org.enhydra.kelp.common.ValidationException;
48
49 // Standard imports
50
import java.awt.Component JavaDoc;
51 import java.io.File JavaDoc;
52 import java.io.FileInputStream JavaDoc;
53 import java.io.FilenameFilter JavaDoc;
54 import java.util.Enumeration JavaDoc;
55 import java.util.Properties JavaDoc;
56 import java.util.Vector JavaDoc;
57 import java.util.ResourceBundle JavaDoc;
58
59 //
60
abstract public class AppGenUtil extends ProjectGenUtil {
61     private Mapper mapper = null;
62
63     public AppGenUtil(AppGenerator gen) throws CodeGenException {
64         super(gen);
65     }
66
67     public AppGenUtil(OtterProject p, AppGenerator gen) throws CodeGenException {
68         super(p, gen);
69     }
70
71
72     // override ProjectGenUtil
73
protected ImportPaths getImportPaths() throws CodeGenException {
74         ImportPaths paths = null;
75         AppGenerator appGen = null;
76         String JavaDoc[][] map = new String JavaDoc[0][2];
77
78         paths= super.getImportPaths();
79         appGen = (AppGenerator) getGenerator();
80
81         try {
82             map = appGen.expandAddinPackageMap();
83             paths.setPackageMap(map);
84         } catch (GeneratorException e) {
85             throw new CodeGenException(e);
86         }
87         return paths;
88     }
89
90 }
91
Popular Tags