KickJava   Java API By Example, From Geeks To Geeks.

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


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

20
21 package ca.mcgill.sable.soot.launching;
22
23 import org.eclipse.jface.action.*;
24
25 /**
26  * Soot Launcher for folders.
27  */

28 public class SootFolderLauncher extends SootLauncher {
29
30     private String JavaDoc processPath;
31     private String JavaDoc classpathAppend = null;
32
33     public void run(IAction action) {
34         super.run(action);
35         classpathAppend = null;
36         
37         if (getSootSelection().getType() == SootSelection.PACKAGEROOT_SELECTED_TYPE){
38             addJars();
39             if (getSootSelection().getPackageFragmentRoot().getResource() != null){
40                 setProcessPath(platform_location+getSootSelection().getPackageFragmentRoot().getPath().toOSString());
41             }
42             else {
43                 setProcessPath(getSootSelection().getPackageFragmentRoot().getPath().toOSString());
44             }
45         }
46     }
47     
48     /**
49      * Sets the classpathAppend.
50      * @param classpathAppend The classpathAppend to set
51      */

52     public void setClasspathAppend(String JavaDoc ca) {
53         if (this.classpathAppend == null){
54             this.classpathAppend = ca;
55         }
56         else {
57             this.classpathAppend = this.classpathAppend+getSootClasspath().getSeparator()+ca;
58         }
59     }
60
61
62     /**
63      * Returns the processPath.
64      * @return String
65      */

66     public String JavaDoc getProcessPath() {
67         return processPath;
68     }
69
70
71     /**
72      * Sets the processPath.
73      * @param processPath The processPath to set
74      */

75     public void setProcessPath(String JavaDoc processPath) {
76         this.processPath = processPath;
77     }
78
79     /**
80      * @return
81      */

82     public String JavaDoc getClasspathAppend() {
83         return classpathAppend;
84     }
85
86 }
87
Popular Tags