1 19 20 package ca.mcgill.sable.soot.launching; 21 22 import java.util.HashMap ; 23 24 import org.eclipse.jface.action.IAction; 25 import ca.mcgill.sable.soot.*; 26 import ca.mcgill.sable.soot.ui.SootConfigManagerDialog; 27 28 import org.eclipse.jface.dialogs.*; 29 30 34 public class SootConfigProjectLauncher extends SootProjectLauncher { 35 36 public void run(IAction action) { 37 38 super.run(action); 39 40 SootConfigManagerDialog manager = new SootConfigManagerDialog(getWindow().getShell()); 41 manager.setEclipseDefList(setEclipseDefs()); 42 manager.setLauncher(this); 43 manager.open(); 44 45 46 } 47 48 public void launch(String name, String mainClass) { 49 50 IDialogSettings settings = SootPlugin.getDefault().getDialogSettings(); 51 52 setSootCommandList(new SootCommandList()); 53 SootSavedConfiguration ssc = new SootSavedConfiguration(name, settings.getArray(name)); 54 ssc.setEclipseDefs(setEclipseDefs()); 55 56 getSootCommandList().addSingleOpt(ssc.toRunArray()); 57 58 if ((mainClass == null) || (mainClass.length() == 0)){ 59 runSootDirectly(); 60 } 61 else { 62 runSootDirectly(mainClass); 63 } 64 runFinish(); 65 } 66 67 private HashMap setEclipseDefs() { 68 69 HashMap defs = new HashMap (); 70 defs.put(LaunchCommands.OUTPUT_DIR, getOutputLocation()); 71 72 defs.put(LaunchCommands.SOOT_CLASSPATH, getProcess_path()+getSootClasspath().getSeparator()+getClasspathAppend()); 73 74 defs.put(LaunchCommands.PROCESS_PATH, getProcess_path()); 75 defs.put(LaunchCommands.KEEP_LINE_NUMBER, new Boolean (true)); 76 defs.put(LaunchCommands.XML_ATTRIBUTES, new Boolean (true)); 77 78 return defs; 79 } 80 81 82 } 83 | Popular Tags |