KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > rice > cs > drjava > model > DummyGlobalModelListener


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-2006 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;
35
36 import java.io.File JavaDoc;
37 import java.util.List JavaDoc;
38 import edu.rice.cs.drjava.model.compiler.CompilerListener;
39 import edu.rice.cs.drjava.model.repl.DummyInteractionsListener;
40 import edu.rice.cs.util.classloader.ClassFileError;
41 import edu.rice.cs.util.swing.AsyncTask;
42 import edu.rice.cs.util.FileOpenSelector;
43
44 /** A dummy GlobalModelListener that does nothing. Useful for listening to only a small number of events.
45  * Not currently used.
46  * @version $Id: DummyGlobalModelListener.java 4044 2006-11-23 13:40:43Z dlsmith $
47  */

48 public class DummyGlobalModelListener extends DummyInteractionsListener implements GlobalModelListener {
49
50   /** Called when an asynchronous task must be run in the model */
51   public <P,R> void executeAsyncTask(AsyncTask<P,R> task, P param, boolean showProgress, boolean lockUI) { }
52
53   public void handleAlreadyOpenDocument(OpenDefinitionsDocument doc) { }
54   
55   /** Called when trying to open a file that does not exist. */
56   public void fileNotFound(File JavaDoc f) { }
57   
58   /** Called when the project's build directory has changed. */
59   public void projectBuildDirChanged() { }
60   
61   /** Called when the project's build directory has changed. */
62   public void projectWorkDirChanged() { }
63   
64   /** Called when the project is being opened and the model needs the gui to do some stuff for it. */
65   public void projectOpened(File JavaDoc pfile, FileOpenSelector files) { }
66   
67   /** Called when the project is being closed. */
68   public void projectClosed() { }
69   
70   /** Called when the projects modified state has changed. */
71   public void projectModified() { }
72
73   /** Called when a project's main class has been set/unset. */
74   public void projectRunnableChanged() { }
75   
76   /** Called after a new document is created. */
77   public void newFileCreated(OpenDefinitionsDocument doc) { }
78
79   /** Called after the current document is saved. */
80   public void fileSaved(OpenDefinitionsDocument doc) { }
81
82   /** Called after a file is opened and read into the current document. */
83   public void fileOpened(OpenDefinitionsDocument doc) { }
84
85   /** Called after a document is closed. */
86   public void fileClosed(OpenDefinitionsDocument doc) { }
87
88   /** Called after a document is reverted. */
89   public void fileReverted(OpenDefinitionsDocument doc) { }
90   
91   /** Called when an undoable edit occurs. */
92   public void undoableEditHappened() { }
93
94   /** Called after a compile is started by the GlobalModel. */
95   public void compileStarted() { }
96
97   /** Called when a compile has finished running. */
98   public void compileEnded(File JavaDoc workDir, List JavaDoc<? extends File JavaDoc> excludedFiles) { }
99   
100   /** Called when a file's main method is about to be run. */
101   public void runStarted(OpenDefinitionsDocument doc) { }
102   
103   /** Called when saving a file whose path contains a '#' symbol. */
104   public void filePathContainsPound() { }
105   
106   /** Called to demand that all class file must be in sync before running unit tests. It is up to the caller of this
107    * method to check if the documents are out of sync, using OpenDefinitionsDocument.checkIfClassFileInSync().
108    */

109   public void compileBeforeJUnit(final CompilerListener l) { }
110
111   /** Called after JUnit is started by the GlobalModel. */
112   public void junitStarted() { }
113   
114   /** Called when testing all files. */
115   public void junitClassesStarted() { }
116
117   /** Called to indicate that a suite of tests has started running.
118    * @param numTests The number of tests in the suite to be run.
119    */

120   public void junitSuiteStarted(int numTests) { }
121   
122   /** Called when a particular test is started.
123    * @param name The name of the test being started.
124    */

125   public void junitTestStarted(String JavaDoc name) { }
126   
127   /** Called when a particular test has ended.
128    * @param name The name of the test that has ended.
129    * @param wasSuccessful Whether the test passed or not.
130    * @param causedError If not successful, whether the test caused an error or simply failed.
131    */

132   public void junitTestEnded(String JavaDoc name, boolean wasSuccessful, boolean causedError) { }
133   
134   /** Called after JUnit is finished running tests. */
135   public void junitEnded() { }
136   
137   /** Called when the console window is reset. */
138   public void consoleReset() { }
139   
140   /** Called to demand that all files be saved before compiling. It is up to the caller of this method to check
141    * if the documents have been saved, using IGetDocuments.hasModifiedDocuments().
142    */

143   public void saveBeforeCompile() { }
144
145   public void saveUntitled() { }
146   
147   /** Called to demand that all files be saved before generating Javadoc. It is up to the caller of this method to
148    * check if the documents have been saved, using IGetDocuments.hasModifiedDocuments().
149    */

150   public void saveBeforeJavadoc() { }
151   
152   /** Called to demand that all files be saved before starting the debugger. It is up to the caller of this method
153    * to check if the documents have been saved, using IGetDocuments.hasModifiedDocuments().
154    *
155    * Not currently used. */

156 // public void saveBeforeDebug() { }
157

158   /** Called when the navigator selection changes the current directory without changing the active document. */
159   public void currentDirectoryChanged(File JavaDoc dir) { }
160   
161   /** Called when trying to test a non-TestCase class.
162    * @param isTestAll whether or not it was a use of the test all button
163    */

164   public void nonTestCase(boolean isTestAll) { }
165   
166   /** Called when trying to test an illegal class file.
167    * @param e the ClassFileError thrown when DrJava attempted to load the offending class.
168    */

169   public void classFileError(ClassFileError e) { }
170
171   /** Called to ask the listener if it is OK to abandon the current document. */
172   public boolean canAbandonFile(OpenDefinitionsDocument doc) { return true; }
173   
174   /** Called to ask the listener if the document should be saved before quitting.
175    * @return true if quitting should continue, false if the user cancelled */

176   public boolean quitFile(OpenDefinitionsDocument doc) { return true; }
177   
178   /** Called to ask the listener if it is OK to replace the current document by a newer version on disk. */
179   public boolean shouldRevertFile(OpenDefinitionsDocument doc) { return true; }
180
181   /** Called after Javadoc is started by the GlobalModel. */
182   public void javadocStarted() { }
183   
184   /** Called after Javadoc is finished.
185    * @param success whether the Javadoc operation generated proper output
186    * @param destDir if (success == true) the location where the output was placed, otherwise undefined
187    * @param allDocs Whether we are running over all open documents
188    */

189   public void javadocEnded(boolean success, File JavaDoc destDir, boolean allDocs) { }
190   
191   public void activeDocumentChanged(OpenDefinitionsDocument active) { }
192   
193   public void focusOnDefinitionsPane() { }
194   
195   public void documentNotFound(OpenDefinitionsDocument d, File JavaDoc f) { }
196 }
197
Popular Tags