1 package org.enhydra.kelp.eclipse.codegen.wizard; 2 3 import org.eclipse.core.resources.IWorkspaceRoot; 4 import org.enhydra.kelp.eclipse.KelpPlugin; 5 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 20 public class EclipseCodeGenWizard extends CodeGenWizard { 21 private String prjName; 22 private String prjLocation; 23 24 28 public EclipseCodeGenWizard(CodeGen cg) { 29 super(cg); 30 } 31 32 36 public EclipseCodeGenWizard() throws GeneratorException { 37 super(); 38 } 39 40 44 45 public EclipseCodeGenWizard(String name, String prjRootKelp) throws GeneratorException { super(); 47 48 prjName = name; 49 prjLocation = prjRootKelp; 50 SetOptions(); 51 } 52 53 private void SetOptions() { 54 int i = 0; 55 56 Generator[] generators = getGenerators(); 57 GeneratorOption opt; 58 try { 59 for (i = 0; i < generators.length; i++) { 60 opt = generators[i].getOptionSet().lookup("project"); 61 opt.setValue(prjName); 62 opt = generators[i].getOptionSet().lookup("package"); 63 opt.setValue(prjName); 64 opt = generators[i].getOptionSet().lookup("root"); 65 opt.setValue(prjLocation); 66 } 67 } catch (GeneratorException e) { 68 } 69 } 70 71 74 public void back() { 75 super.back(); 76 77 CodeGenDeck deck = (CodeGenDeck) getDeck(); 78 if (deck.getPageIndex() == 0) 79 SetOptions(); 80 } 81 } 82 | Popular Tags |