| 1 19 20 package ca.mcgill.sable.soot.launching; 21 22 import java.util.HashMap ; 23 import java.util.Iterator ; 24 25 import org.eclipse.jface.action.IAction; 26 import ca.mcgill.sable.soot.*; 27 import ca.mcgill.sable.soot.ui.SootConfigManagerDialog; 28 29 import org.eclipse.jface.dialogs.*; 30 31 32 35 public class SootConfigFileLauncher extends SootFileLauncher { 36 37 public void run(IAction action) { 38 39 super.run(action); 40 super.handleMultipleFiles(); 41 42 if (isDoNotContinue()) return; 43 window = SootPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow(); 44 45 SootConfigManagerDialog manager = new SootConfigManagerDialog(window.getShell()); 46 manager.setEclipseDefList(setEclipseDefs()); 47 manager.setLauncher(this); 48 manager.open(); 49 50 51 } 52 53 public void launch(String name, String mainClass) { 54 55 IDialogSettings settings = SootPlugin.getDefault().getDialogSettings(); 56 57 setSootCommandList(new SootCommandList()); 58 59 60 SootSavedConfiguration ssc = new SootSavedConfiguration(name, settings.getArray(name)); 61 ssc.setEclipseDefs(setEclipseDefs()); 62 63 getSootCommandList().addSingleOpt(ssc.toRunArray()); 64 65 Iterator it = getToProcessList().iterator(); 66 while (it.hasNext()){ 67 getSootCommandList().addSingleOpt((String )it.next()); 68 } 69 70 getSootCommandList().printList(); 71 72 if ((mainClass == null) || (mainClass.length() == 0)){ 73 runSootDirectly(); 74 } 75 else { 76 runSootDirectly(mainClass); 77 } 78 runFinish(); 79 } 80 81 private HashMap setEclipseDefs() { 82 83 HashMap defs = new HashMap (); 84 defs.put(LaunchCommands.OUTPUT_DIR, getOutputLocation()); 85 86 defs.put(LaunchCommands.SOOT_CLASSPATH, getClasspathAppend()); 87 88 if (isSrcPrec()) { 89 defs.put(LaunchCommands.SRC_PREC, getSrcPrec()); 90 } 91 defs.put(LaunchCommands.KEEP_LINE_NUMBER, new Boolean (true)); 92 93 defs.put(LaunchCommands.XML_ATTRIBUTES, new Boolean (true)); 94 95 return defs; 96 } 97 98 99 } 100 | Popular Tags |