edu.rice.cs.drjava.model
Class DummyGlobalModelListener

java.lang.Object
  extended by edu.rice.cs.drjava.model.repl.DummyInteractionsListener
      extended by edu.rice.cs.drjava.model.DummyGlobalModelListener
All Implemented Interfaces:
CompilerListener, GlobalModelListener, JavadocListener, JUnitListener, InteractionsListener

public class DummyGlobalModelListener
extends DummyInteractionsListener
implements GlobalModelListener

A dummy GlobalModelListener that does nothing. Useful for listening to only a small number of events. Not currently used.

Version:
$Id: DummyGlobalModelListener.java 4636 2008-08-12 18:47:11Z mgricken $

Constructor Summary
DummyGlobalModelListener()
           
 
Method Summary
 void activeCompilerChanged()
          Called after the active compiler has been changed.
 void activeDocumentChanged(OpenDefinitionsDocument active)
          Called when a new active document is selected
 void activeDocumentRefreshed(OpenDefinitionsDocument active)
          Called when the active document is refreshed
 void browserChanged()
          Called when the a region is added to the browswing history.
 boolean canAbandonFile(OpenDefinitionsDocument doc)
          Called to ask the listener if it is OK to abandon the current document.
 void classFileError(ClassFileError e)
          Called when trying to test an illegal class file.
 void compileAborted(Exception e)
          Called if a compile is aborted.
 void compileBeforeJUnit(CompilerListener l)
          Called to demand that all class file must be in sync before running unit tests.
 void compileEnded(File workDir, List<? extends File> excludedFiles)
          Called when a compile has finished running.
 void compileStarted()
          Called after a compile is started by the GlobalModel.
 void consoleReset()
          Called when the console window is reset.
 void currentDirectoryChanged(File dir)
          Called when the navigator selection changes the current directory without changing the active document.
 void documentNotFound(OpenDefinitionsDocument d, File f)
          Called when the a document, already opened, is brought back into the cache, and it no longer exists on disk or cannot be accessed.
<P,R> void
executeAsyncTask(AsyncTask<P,R> task, P param, boolean showProgress, boolean lockUI)
          Called when an asynchronous task must be run in the model
 void fileClosed(OpenDefinitionsDocument doc)
          Called after a document is closed.
 void fileOpened(OpenDefinitionsDocument doc)
          Called after a file is opened and read into the current document.
 void filePathContainsPound()
          Called when saving a file whose path contains a '#' symbol.
 void fileReverted(OpenDefinitionsDocument doc)
          Called after a document is reverted.
 void fileSaved(OpenDefinitionsDocument doc)
          Called after the current document is saved.
 void filesNotFound(File... f)
          Called when trying to open one or more files that do not exist.
 File[] filesReadOnly(File... f)
          Called when trying to write one or more files that are read-only.
 void focusOnDefinitionsPane()
          Called when the focus must be changed to the active document in the definitions pane
 void focusOnLastFocusOwner()
          Restores the focus in the main frame to the last focus owner.
 void handleAlreadyOpenDocument(OpenDefinitionsDocument doc)
          Performs any UI related steps to handle the case in which a file is being opened that is already open and modified.
 void javadocEnded(boolean success, File destDir, boolean allDocs)
          Called after Javadoc is finished.
 void javadocStarted()
          Called after Javadoc is started by the GlobalModel.
 void junitClassesStarted()
          Called when testing all files.
 void junitEnded()
          Called after JUnit is finished running tests.
 void junitStarted()
          Called after JUnit is started by the GlobalModel.
 void junitSuiteStarted(int numTests)
          Called to indicate that a suite of tests has started running.
 void junitTestEnded(String name, boolean wasSuccessful, boolean causedError)
          Called when a particular test has ended.
 void junitTestStarted(String name)
          Called when a particular test is started.
 void newFileCreated(OpenDefinitionsDocument doc)
          Called after a new document is created.
 void nonTestCase(boolean isTestAll)
          Called when trying to test a non-TestCase class.
 void openProject(File pfile, FileOpenSelector files)
          Called when the project is being opened and the model needs the gui to do some stuff for it.
 void prepareForRun(OpenDefinitionsDocument doc)
          Called when a file's main method is about to be run.
 void projectBuildDirChanged()
          Called when the project's build directory has changed.
 void projectClosed()
          Called when the project is being closed.
 void projectModified()
          Called when the projects modified state has changed.
 void projectRunnableChanged()
          Called when a project's main class has been set/unset.
 void projectWorkDirChanged()
          Called when the project's build directory has changed.
 boolean quitFile(OpenDefinitionsDocument doc)
          Called to ask the listener if the document should be saved before quitting.
 void saveBeforeCompile()
          Called to demand that all files be saved before compiling.
 void saveBeforeJavadoc()
          Called to demand that all files be saved before generating Javadoc.
 void saveUntitled()
          Called to demand that the active document, which is untitled, be saved before compiling.
 boolean shouldRevertFile(OpenDefinitionsDocument doc)
          Called to ask the listener if it is OK to replace the current document by a newer version on disk.
 void undoableEditHappened()
          Called when an undoable edit occurs.
 
Methods inherited from class edu.rice.cs.drjava.model.repl.DummyInteractionsListener
interactionEnded, interactionErrorOccurred, interactionIncomplete, interactionStarted, interpreterChanged, interpreterExited, interpreterReady, interpreterResetFailed, interpreterResetting, slaveJVMUsed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.rice.cs.drjava.model.repl.InteractionsListener
interactionEnded, interactionErrorOccurred, interactionIncomplete, interactionStarted, interpreterChanged, interpreterExited, interpreterReady, interpreterResetFailed, interpreterResetting, slaveJVMUsed
 

Constructor Detail

DummyGlobalModelListener

public DummyGlobalModelListener()
Method Detail

executeAsyncTask

public <P,R> void executeAsyncTask(AsyncTask<P,R> task,
                                   P param,
                                   boolean showProgress,
                                   boolean lockUI)
Called when an asynchronous task must be run in the model

Specified by:
executeAsyncTask in interface GlobalModelListener

handleAlreadyOpenDocument

public void handleAlreadyOpenDocument(OpenDefinitionsDocument doc)
Description copied from interface: GlobalModelListener
Performs any UI related steps to handle the case in which a file is being opened that is already open and modified. The two choices are to revert to the copy on disk, or to keep the current changes.

Specified by:
handleAlreadyOpenDocument in interface GlobalModelListener
Parameters:
doc - true if the user wishes to revert the document, false to ignore

filesNotFound

public void filesNotFound(File... f)
Called when trying to open one or more files that do not exist.

Specified by:
filesNotFound in interface GlobalModelListener

filesReadOnly

public File[] filesReadOnly(File... f)
Called when trying to write one or more files that are read-only.

Specified by:
filesReadOnly in interface GlobalModelListener
Parameters:
f - files that are read-only
Returns:
the files that should be attempted to be rewritten

newFileCreated

public void newFileCreated(OpenDefinitionsDocument doc)
Called after a new document is created.

Specified by:
newFileCreated in interface GlobalModelListener

fileSaved

public void fileSaved(OpenDefinitionsDocument doc)
Called after the current document is saved.

Specified by:
fileSaved in interface GlobalModelListener

fileOpened

public void fileOpened(OpenDefinitionsDocument doc)
Called after a file is opened and read into the current document.

Specified by:
fileOpened in interface GlobalModelListener

fileClosed

public void fileClosed(OpenDefinitionsDocument doc)
Called after a document is closed.

Specified by:
fileClosed in interface GlobalModelListener

fileReverted

public void fileReverted(OpenDefinitionsDocument doc)
Called after a document is reverted.

Specified by:
fileReverted in interface GlobalModelListener

undoableEditHappened

public void undoableEditHappened()
Called when an undoable edit occurs.

Specified by:
undoableEditHappened in interface GlobalModelListener

compileStarted

public void compileStarted()
Called after a compile is started by the GlobalModel.

Specified by:
compileStarted in interface CompilerListener

compileEnded

public void compileEnded(File workDir,
                         List<? extends File> excludedFiles)
Called when a compile has finished running.

Specified by:
compileEnded in interface CompilerListener

compileAborted

public void compileAborted(Exception e)
Called if a compile is aborted.

Specified by:
compileAborted in interface CompilerListener

activeCompilerChanged

public void activeCompilerChanged()
Called after the active compiler has been changed.

Specified by:
activeCompilerChanged in interface CompilerListener

prepareForRun

public void prepareForRun(OpenDefinitionsDocument doc)
Called when a file's main method is about to be run.

Specified by:
prepareForRun in interface GlobalModelListener

filePathContainsPound

public void filePathContainsPound()
Called when saving a file whose path contains a '#' symbol.

Specified by:
filePathContainsPound in interface GlobalModelListener

compileBeforeJUnit

public void compileBeforeJUnit(CompilerListener l)
Called to demand that all class file must be in sync before running unit tests. It is up to the caller of this method to check if the documents are out of sync, using OpenDefinitionsDocument.checkIfClassFileInSync().

Specified by:
compileBeforeJUnit in interface JUnitListener

junitStarted

public void junitStarted()
Called after JUnit is started by the GlobalModel.

Specified by:
junitStarted in interface JUnitListener

junitClassesStarted

public void junitClassesStarted()
Called when testing all files.

Specified by:
junitClassesStarted in interface JUnitListener

junitSuiteStarted

public void junitSuiteStarted(int numTests)
Called to indicate that a suite of tests has started running.

Specified by:
junitSuiteStarted in interface JUnitListener
Parameters:
numTests - The number of tests in the suite to be run.

junitTestStarted

public void junitTestStarted(String name)
Called when a particular test is started.

Specified by:
junitTestStarted in interface JUnitListener
Parameters:
name - The name of the test being started.

junitTestEnded

public void junitTestEnded(String name,
                           boolean wasSuccessful,
                           boolean causedError)
Called when a particular test has ended.

Specified by:
junitTestEnded in interface JUnitListener
Parameters:
name - The name of the test that has ended.
wasSuccessful - Whether the test passed or not.
causedError - If not successful, whether the test caused an error or simply failed.

junitEnded

public void junitEnded()
Called after JUnit is finished running tests.

Specified by:
junitEnded in interface JUnitListener

consoleReset

public void consoleReset()
Called when the console window is reset.

Specified by:
consoleReset in interface GlobalModelListener

saveBeforeCompile

public void saveBeforeCompile()
Called to demand that all files be saved before compiling. It is up to the caller of this method to check if the documents have been saved, using IGetDocuments.hasModifiedDocuments().

Specified by:
saveBeforeCompile in interface CompilerListener

saveUntitled

public void saveUntitled()
Description copied from interface: CompilerListener
Called to demand that the active document, which is untitled, be saved before compiling.

Specified by:
saveUntitled in interface CompilerListener

saveBeforeJavadoc

public void saveBeforeJavadoc()
Called to demand that all files be saved before generating Javadoc. It is up to the caller of this method to check if the documents have been saved, using IGetDocuments.hasModifiedDocuments().

Specified by:
saveBeforeJavadoc in interface JavadocListener

currentDirectoryChanged

public void currentDirectoryChanged(File dir)
Called when the navigator selection changes the current directory without changing the active document.

Specified by:
currentDirectoryChanged in interface GlobalModelListener

nonTestCase

public void nonTestCase(boolean isTestAll)
Called when trying to test a non-TestCase class.

Specified by:
nonTestCase in interface JUnitListener
Parameters:
isTestAll - whether or not it was a use of the test all button

classFileError

public void classFileError(ClassFileError e)
Called when trying to test an illegal class file.

Specified by:
classFileError in interface JUnitListener
Parameters:
e - the ClassFileError thrown when DrJava attempted to load the offending class.

canAbandonFile

public boolean canAbandonFile(OpenDefinitionsDocument doc)
Called to ask the listener if it is OK to abandon the current document.

Specified by:
canAbandonFile in interface GlobalModelListener

quitFile

public boolean quitFile(OpenDefinitionsDocument doc)
Called to ask the listener if the document should be saved before quitting.

Specified by:
quitFile in interface GlobalModelListener
Returns:
true if quitting should continue, false if the user cancelled

shouldRevertFile

public boolean shouldRevertFile(OpenDefinitionsDocument doc)
Called to ask the listener if it is OK to replace the current document by a newer version on disk.

Specified by:
shouldRevertFile in interface GlobalModelListener

javadocStarted

public void javadocStarted()
Called after Javadoc is started by the GlobalModel.

Specified by:
javadocStarted in interface JavadocListener

javadocEnded

public void javadocEnded(boolean success,
                         File destDir,
                         boolean allDocs)
Called after Javadoc is finished.

Specified by:
javadocEnded in interface JavadocListener
Parameters:
success - whether the Javadoc operation generated proper output
destDir - if (success == true) the location where the output was placed, otherwise undefined
allDocs - Whether we are running over all open documents

activeDocumentChanged

public void activeDocumentChanged(OpenDefinitionsDocument active)
Description copied from interface: GlobalModelListener
Called when a new active document is selected

Specified by:
activeDocumentChanged in interface GlobalModelListener

activeDocumentRefreshed

public void activeDocumentRefreshed(OpenDefinitionsDocument active)
Description copied from interface: GlobalModelListener
Called when the active document is refreshed

Specified by:
activeDocumentRefreshed in interface GlobalModelListener

focusOnLastFocusOwner

public void focusOnLastFocusOwner()
Description copied from interface: GlobalModelListener
Restores the focus in the main frame to the last focus owner.

Specified by:
focusOnLastFocusOwner in interface GlobalModelListener

focusOnDefinitionsPane

public void focusOnDefinitionsPane()
Description copied from interface: GlobalModelListener
Called when the focus must be changed to the active document in the definitions pane

Specified by:
focusOnDefinitionsPane in interface GlobalModelListener

documentNotFound

public void documentNotFound(OpenDefinitionsDocument d,
                             File f)
Description copied from interface: GlobalModelListener
Called when the a document, already opened, is brought back into the cache, and it no longer exists on disk or cannot be accessed.

Specified by:
documentNotFound in interface GlobalModelListener

projectBuildDirChanged

public void projectBuildDirChanged()
Called when the project's build directory has changed.

Specified by:
projectBuildDirChanged in interface GlobalModelListener

projectWorkDirChanged

public void projectWorkDirChanged()
Called when the project's build directory has changed.

Specified by:
projectWorkDirChanged in interface GlobalModelListener

openProject

public void openProject(File pfile,
                        FileOpenSelector files)
Called when the project is being opened and the model needs the gui to do some stuff for it.

Specified by:
openProject in interface GlobalModelListener
Parameters:
pfile - the location of the project file
files - The files the gui should open for the model

projectClosed

public void projectClosed()
Called when the project is being closed.

Specified by:
projectClosed in interface GlobalModelListener

projectModified

public void projectModified()
Called when the projects modified state has changed.

Specified by:
projectModified in interface GlobalModelListener

projectRunnableChanged

public void projectRunnableChanged()
Called when a project's main class has been set/unset.

Specified by:
projectRunnableChanged in interface GlobalModelListener

browserChanged

public void browserChanged()
Called when the a region is added to the browswing history.

Specified by:
browserChanged in interface GlobalModelListener