1 package org.enhydra.kelp.jdev.codegen.wizard; 2 3 import org.enhydra.tool.codegen.CodeGen; 6 import org.enhydra.tool.codegen.Generator; 7 import org.enhydra.tool.codegen.GeneratorException; 8 import org.enhydra.tool.codegen.GeneratorOption; 9 import org.enhydra.tool.codegen.wizard.CodeGenDeck; 10 import org.enhydra.tool.codegen.wizard.CodeGenWizard; 11 12 16 public class JDevCodeGenWizard extends CodeGenWizard { 17 private String prjName; 18 private String prjLocation; 19 20 24 public JDevCodeGenWizard(CodeGen cg) { 25 super(cg); 26 } 27 28 32 public JDevCodeGenWizard() throws GeneratorException { 33 super(); 34 } 35 36 40 41 public JDevCodeGenWizard(String name, String prjRootKelp) throws GeneratorException { super(); 43 44 prjName = name; 45 prjLocation = prjRootKelp; 46 SetOptions(); 47 } 48 49 private void SetOptions() { 50 int i = 0; 51 52 Generator[] generators = getGenerators(); 53 GeneratorOption opt; 54 try { 55 for (i = 0; i < generators.length; i++) { 56 opt = generators[i].getOptionSet().lookup("project"); 57 opt.setValue(prjName); 58 opt = generators[i].getOptionSet().lookup("package"); 59 opt.setValue(prjName); 60 opt = generators[i].getOptionSet().lookup("root"); 61 opt.setValue(prjLocation); 62 } 63 } catch (GeneratorException e) { 64 } 65 } 66 67 70 public void back() { 71 super.back(); 72 73 CodeGenDeck deck = (CodeGenDeck) getDeck(); 74 if (deck.getPageIndex() == 0) 75 SetOptions(); 76 } 77 } 78 | Popular Tags |