KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ca > mcgill > sable > soot > launching > SootDefaultCommands


1 /* Soot - a J*va Optimization Framework
2  * Copyright (C) 2003 Jennifer Lhotak
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */

19
20 package ca.mcgill.sable.soot.launching;
21
22 import java.util.ArrayList JavaDoc;
23
24 import ca.mcgill.sable.soot.ui.PhaseOptionsDialog;
25
26 /**
27  * Sets Soot commands needed by Eclipse in Options Dialog
28  * (ex output directory)
29  */

30 public class SootDefaultCommands {
31
32     private PhaseOptionsDialog dialog;
33     
34     /**
35      * Constructor for SootDefaultCommands.
36      */

37     public SootDefaultCommands(PhaseOptionsDialog dialog) {
38         setDialog(dialog);
39     }
40     
41     public void setSootClassPath(String JavaDoc val) {
42         getDialog().addToEclipseDefList(LaunchCommands.SOOT_CLASSPATH, val);
43     }
44     
45     public void setProcessPath(String JavaDoc val) {
46         ArrayList JavaDoc list = new ArrayList JavaDoc();
47         list.add(val);
48         getDialog().addToEclipseDefList(LaunchCommands.PROCESS_PATH, list);
49     }
50     public void setProcessPath(ArrayList JavaDoc list){
51         getDialog().addToEclipseDefList(LaunchCommands.PROCESS_PATH, list);
52     }
53     public void setOutputDir(String JavaDoc val) {
54         getDialog().addToEclipseDefList(LaunchCommands.OUTPUT_DIR, val);
55     }
56     
57     public void setKeepLineNum() {
58         getDialog().addToEclipseDefList(LaunchCommands.KEEP_LINE_NUMBER, new Boolean JavaDoc(true));
59     }
60     
61     public void setPrintTags() {
62         getDialog().addToEclipseDefList(LaunchCommands.XML_ATTRIBUTES, new Boolean JavaDoc(true));
63     }
64     
65     public void setSrcPrec(String JavaDoc val) {
66         getDialog().addToEclipseDefList(LaunchCommands.SRC_PREC, val);
67     }
68     
69     public void setSootMainClass(){
70         getDialog().addToEclipseDefList("sootMainClass", "soot.Main");
71     }
72     
73     
74
75     
76
77     /**
78      * Returns the dialog.
79      * @return PhaseOptionsDialog
80      */

81     public PhaseOptionsDialog getDialog() {
82         return dialog;
83     }
84
85     /**
86      * Sets the dialog.
87      * @param dialog The dialog to set
88      */

89     public void setDialog(PhaseOptionsDialog dialog) {
90         this.dialog = dialog;
91     }
92
93 }
94
Popular Tags