KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > aspectj > debugger > ide > IDEInterfaceImpl


1 /* -*- Mode: JDE; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2  *
3  * This file is part of the compiler and core tools for the AspectJ(tm)
4  * programming language; see http://aspectj.org
5  *
6  * The contents of this file are subject to the Mozilla Public License
7  * Version 1.1 (the "License"); you may not use this file except in
8  * compliance with the License. You may obtain a copy of the License at
9  * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/.
10  *
11  * Software distributed under the License is distributed on an "AS IS" basis,
12  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13  * for the specific language governing rights and limitations under the
14  * License.
15  *
16  * The Original Code is AspectJ.
17  *
18  * The Initial Developer of the Original Code is Xerox Corporation. Portions
19  * created by Xerox Corporation are Copyright (C) 1999-2002 Xerox Corporation.
20  * All Rights Reserved.
21  *
22  * Contributor(s):
23  */

24 package org.aspectj.debugger.ide;
25
26 import java.io.File JavaDoc;
27 import java.util.List JavaDoc;
28 import java.util.Vector JavaDoc;
29 import javax.swing.JFileChooser JavaDoc;
30 import javax.swing.filechooser.FileFilter JavaDoc;
31
32 /**
33  * A simple implementation of IDEInterface.
34  *
35  * @see IDEInterface
36  * @author Jeff Palm
37  */

38 public class IDEInterfaceImpl extends IDEInterfaceHelper {
39
40     public final static IDEInterface proto = new IDEInterfaceImpl();
41
42     /**
43      * Not implemented.
44      */

45     public void toggle(String JavaDoc sourceName, int lineNumber) { }
46
47     public String JavaDoc getClasspath() {
48         return ""; //get.classpath";
49
}
50
51     public String JavaDoc getVMParameters() {
52         return "" ;//get.vm.parameters";
53
}
54
55     public String JavaDoc getClassNameToRun() {
56         return "spacewar.Game"; //get.class.name.to.run";
57
}
58
59     public String JavaDoc findClassName() {
60         return ""; //find.class.name";
61
}
62
63     public String JavaDoc findFileName() {
64         JFileChooser JavaDoc chooser = new JFileChooser JavaDoc(".");
65         String JavaDoc fileName = "bad.file.name";
66         chooser.addChoosableFileFilter(new FileFilter JavaDoc() {
67                 public boolean accept(File JavaDoc f) {
68                     return f != null && (f.getName().endsWith(".java") || f.isDirectory());
69                 }
70                 public String JavaDoc getDescription() {
71                     return "Java files (*.java)";
72                 }
73             });
74         int result = chooser.showDialog(null, "OK");
75         System.out.println("result=" + result);
76         if (result == 0) {
77             fileName = chooser.getSelectedFile().getAbsolutePath();
78         }
79         return fileName;
80     }
81
82     public List JavaDoc getInitialBreakpoints() {
83         return new Vector JavaDoc();
84     }
85
86     protected void markLine(String JavaDoc className, List JavaDoc argumentTypeNames) {
87         System.out.println("className:" + className + " argumentTypeNames:" + argumentTypeNames);
88     }
89
90     protected void markLineWithClass(String JavaDoc className, int line) {
91         System.out.println("markLineWithClass:className=" + className);
92     }
93
94     protected void markLine(String JavaDoc sourceName, int line) {
95         System.out.println("markLine() sourceName:" + sourceName + ",line:" + line);
96     }
97
98     protected void unmarkLine(String JavaDoc sourceName, int line) {
99         System.out.println("unmarkLine() sourceName:" + sourceName + ",line:" + line);
100     }
101
102     protected void handle(Throwable JavaDoc t) {
103         t.printStackTrace();
104     }
105 }
106
Popular Tags