KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > rice > cs > drjava > model > debug > NoDebuggerAvailable


1 /*BEGIN_COPYRIGHT_BLOCK
2  *
3  * This file is part of DrJava. Download the current version of this project from http://www.drjava.org/
4  * or http://sourceforge.net/projects/drjava/
5  *
6  * DrJava Open Source License
7  *
8  * Copyright (C) 2001-2005 JavaPLT group at Rice University (javaplt@rice.edu). All rights reserved.
9  *
10  * Developed by: Java Programming Languages Team, Rice University, http://www.cs.rice.edu/~javaplt/
11  *
12  * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
13  * documentation files (the "Software"), to deal with the Software without restriction, including without limitation
14  * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
15  * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
16  *
17  * - Redistributions of source code must retain the above copyright notice, this list of conditions and the
18  * following disclaimers.
19  * - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
20  * following disclaimers in the documentation and/or other materials provided with the distribution.
21  * - Neither the names of DrJava, the JavaPLT, Rice University, nor the names of its contributors may be used to
22  * endorse or promote products derived from this Software without specific prior written permission.
23  * - Products derived from this software may not be called "DrJava" nor use the term "DrJava" as part of their
24  * names without prior written permission from the JavaPLT group. For permission, write to javaplt@rice.edu.
25  *
26  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
27  * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28  * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
29  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
30  * WITH THE SOFTWARE.
31  *
32  *END_COPYRIGHT_BLOCK*/

33
34 package edu.rice.cs.drjava.model.debug;
35
36 import java.util.Vector JavaDoc;
37 import edu.rice.cs.drjava.model.OpenDefinitionsDocument;
38
39 /**
40  * Placeholder class indicating that no debugger is available to DrJava.
41  * This class follows the Singleton pattern.
42  * @version $Id: NoDebuggerAvailable.java 4031 2006-11-15 22:09:06Z rcartwright $
43  */

44 public class NoDebuggerAvailable implements Debugger {
45   
46   /** Singleton instance of this class. */
47   public static final NoDebuggerAvailable ONLY = new NoDebuggerAvailable();
48
49   /** Private constructor: use the ONLY field. */
50   private NoDebuggerAvailable() { }
51
52   /** Returns whether the debugger is currently available in this JVM. This does not indicate whether it is ready to
53    * be used.
54    */

55   public boolean isAvailable() { return false; }
56
57   /** Attaches the debugger to the Interactions JVM to prepare for debugging. */
58   public void startUp() throws DebugException { }
59
60   /** Disconnects the debugger from the Interactions JVM and cleans up any state. */
61   public void shutdown() { }
62
63   /** Returns the status of the debugger. */
64   public boolean isReady() { return false; }
65
66   /** Suspends execution of the currently. */
67   public void suspend(DebugThreadData d) { }
68
69   /** Suspends all the threads. */
70   public void suspendAll() { }
71
72   /** Sets the current thread which is being debugged to the thread referenced by d. */
73   public void setCurrentThread(DebugThreadData d) { }
74
75   /** Resumes execution of the currently loaded document. */
76   public void resume() { }
77
78   /** Resumes execution of the given thread.
79    * @param data the DebugThreadData representing the thread to resume
80    */

81   public void resume(DebugThreadData data) { }
82
83   /** Steps into the execution of the currently loaded document.
84    * @param flag The flag denotes what kind of step to take. The following mark valid options:
85    * StepRequest.STEP_INTO, StepRequest.STEP_OVER, StepRequest.STEP_OUT
86    */

87   public void step(int flag) throws DebugException { }
88
89   /** Called from interactionsEnded in MainFrame in order to clear any current StepRequests that remain. */
90   public void clearCurrentStepRequest() { }
91
92   /** Adds a watch on the given field or variable.
93    * @param field the name of the field we will watch
94    */

95   public void addWatch(String JavaDoc field) { }
96
97   /** Removes any watches on the given field or variable.
98    * @param field the name of the field we will watch
99    */

100   public void removeWatch(String JavaDoc field) { }
101
102   /** Removes the watch at the given index.
103    * @param index Index of the watch to remove
104    */

105   public void removeWatch(int index) { }
106
107   /** Removes all watches on existing fields and variables. */
108   public void removeAllWatches() { }
109
110   /** Toggles whether a breakpoint is set at the given line in the given document. */
111   public void toggleBreakpoint(OpenDefinitionsDocument doc, int offset, int lineNum, boolean isEnabled) throws DebugException { }
112
113   /** Sets a breakpoint. */
114   public void setBreakpoint(Breakpoint breakpoint) { }
115
116  /** Removes a breakpoint. */
117   public void removeBreakpoint(Breakpoint breakpoint) { }
118
119   /** Returns all currently watched fields and variables. */
120   public Vector JavaDoc<DebugWatchData> getWatches() { return new Vector JavaDoc<DebugWatchData>(); }
121
122   /** Returns a Vector of ThreadData or null if the vm is null. */
123   public Vector JavaDoc<DebugThreadData> getCurrentThreadData() { return new Vector JavaDoc<DebugThreadData>(); }
124
125   /** Returns a Vector of StackData for the current thread or null if the current thread is null. */
126   public Vector JavaDoc<DebugStackData> getCurrentStackFrameData() { return new Vector JavaDoc<DebugStackData>(); }
127
128   /** Adds a listener to this Debugger. */
129   public void addListener(DebugListener listener) { }
130
131   /** Removes a listener to this JPDADebugger. */
132   public void removeListener(DebugListener listener) { }
133
134   /** @return true if there are any threads in the program currently being
135    * debugged which have been suspended (by the user or by hitting a breakpoint).
136    */

137   public boolean hasSuspendedThreads() { return false; }
138
139   /** Returns whether the thread the debugger is tracking is now running. */
140   public boolean hasRunningThread() { return false; }
141
142   /** Returns whether the debugger's current thread is suspended. */
143   public boolean isCurrentThreadSuspended() { return false; }
144
145   /** scrolls to the source indicated by the given DebugStackData */
146   public void scrollToSource(DebugStackData data) { }
147
148   /** scrolls to the source indicated by the given Breakpoint */
149   public void scrollToSource(Breakpoint bp) { }
150
151   /** Gets the Breakpoint object at the specified line in the given class. */
152   public Breakpoint getBreakpoint(int line, String JavaDoc className) { return null; }
153 }
154
Popular Tags