KickJava   Java API By Example, From Geeks To Geeks.

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


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 org.aspectj.debugger.gui.ComponentDirector;
27 import java.util.List JavaDoc;
28 import javax.swing.JComponent JavaDoc;
29
30 /**
31  * A general-purpose interface to the AJDE stuff.
32  * When needing functionality between the debugger and IDEs, expand
33  * this interface and all implementing classes.
34  *
35  * @author Jeff Palm
36  */

37 public interface IDEInterface {
38
39     /**
40      * Does whatever is necessary to exit, i.e. close output windows, etc...
41      */

42     public void exit();
43
44     /**
45      * Gives the IDEInterface a chance to init itself
46      * with the IDEComponentDirector.
47      *
48      * @param director the IDEComponentDirector to which this
49      * IDEInterface is bound.
50      */

51     public void init(IDEComponentDirector director);
52
53     /**
54      * Called from the IDEComponentDirector when it is setting breakpoints
55      * from the IDE. This should serve as a 'down' operation.
56      */

57     public void settingBreakpointsFromIDE();
58
59     /**
60      * Called from the IDEComponentDirector when it is done setting breakpoints
61      * from the IDE source. This should serve as an 'up' operation.
62      */

63     public void doneSettingBreakpointsFromIDE();
64
65     /**
66      * Returns the current classpath.
67      *
68      * @return The current classpath.
69      */

70     public String JavaDoc getClasspath();
71
72     /**
73      * Returns the current VM parameters.
74      *
75      * @return The current VM parameters.
76      */

77     public String JavaDoc getVMParameters();
78
79     /**
80      * Returns the class name to run right away.
81      *
82      * @return The class name to run right away.
83      */

84     public String JavaDoc getClassNameToRun();
85
86     /**
87      * Gets a class name from the user some way.
88      *
89      * @return The class name from the user.
90      */

91     public String JavaDoc findClassName();
92
93     /**
94      * Gets a file name from the user some way.
95      *
96      * @return The file name from the user.
97      */

98     public String JavaDoc findFileName();
99
100     /**
101      * Retrieves breakpoints to set initially.
102      *
103      * @return A java.util.List of breakpoints to set initially of
104      * type SourceLineBreakable.
105      * @see SourceLineBreakable.
106      */

107     public List JavaDoc getInitialBreakpoints();
108
109     /**
110      * Sets the ComponentDirector for use by this IDEInterface.
111      *
112      * @param director The ComponentDirector to use.
113      */

114     public void setComponentDirector(ComponentDirector director);
115
116     /**
117      * An interface allowing us to pass around
118      * source-line breakpoint information.
119      */

120     public interface SourceLineBreakable {
121
122         /**
123          * Returns the full source name of this breakpoint.
124          *
125          * @return The full source name of this breakpoint.
126          */

127         public abstract String JavaDoc getSourceName();
128
129         /**
130          * Returns the line number of this breakpoint.
131          *
132          * @return The line number of this breakpoint.
133          */

134         public abstract int getLine();
135     }
136
137     /**
138      * A simple implementation of SourceLinBreakable that
139      * has a toString() method.
140      */

141     public abstract class AbstractSourceLineBreakpoint
142         implements SourceLineBreakable
143     {
144
145         /**
146          * @see SourceLineBreakable#getSourceName
147          */

148         public abstract String JavaDoc getSourceName();
149
150         /**
151          * @see SourceLineBreakable#getLine
152          */

153         public abstract int getLine();
154
155         /**
156          * Returns a String of the form source ':' line.
157          *
158          * @return A String of the form source ':' line.
159          */

160         public String JavaDoc toString() {
161             return getSourceName() + ":" + getLine();
162         }
163     }
164 }
165
Popular Tags