1 /*2 * Enhydra Java Application Server Project3 *4 * The contents of this file are subject to the Enhydra Public License5 * Version 1.1 (the "License"); you may not use this file except in6 * compliance with the License. You may obtain a copy of the License on7 * 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. See11 * the License for the specific terms governing rights and limitations12 * under the License.13 *14 * The Initial Developer of the Enhydra Application Server is Lutris15 * Technologies, Inc. The Enhydra Application Server and portions created16 * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.17 * All Rights Reserved.18 *19 * Contributor(s):20 * Paul Mahar21 *22 */23 package org.enhydra.kelp.common.codegen;24 25 // ToolBox imports26 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 imports36 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 imports50 import java.awt.Component ;51 import java.io.File ;52 import java.io.FileInputStream ;53 import java.io.FilenameFilter ;54 import java.util.Enumeration ;55 import java.util.Properties ;56 import java.util.Vector ;57 import java.util.ResourceBundle ;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 ProjectGenUtil73 protected ImportPaths getImportPaths() throws CodeGenException {74 ImportPaths paths = null;75 AppGenerator appGen = null;76 String [][] map = new String [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