|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.drjava.ui.MainFrame.ModelListener
private class MainFrame.ModelListener
Inner class to listen to all events in the model.
| Field Summary | |
|---|---|
private int |
_fnfCount
|
| Constructor Summary | |
|---|---|
private |
MainFrame.ModelListener()
|
| Method Summary | ||
|---|---|---|
private void |
_compileBeforeProceeding(String message,
BooleanOption option,
String checkMsg,
CompilerListener afterCompile)
Helper method shared by all "compileBeforeX" methods. |
|
private void |
_fileClosed(OpenDefinitionsDocument doc)
Does the work of closing a file |
|
private void |
_fileOpened(OpenDefinitionsDocument doc)
|
|
private boolean |
_fileSaveHelper(OpenDefinitionsDocument doc,
int paneOption)
|
|
private void |
_saveAllBeforeProceeding(String message,
BooleanOption option,
String checkMsg)
Helper method shared by all "saveBeforeX" methods. |
|
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 |
allFilesClosed()
Called when all open files are closed. |
|
void |
browserChanged()
Called when the a region is added to the browswing history. |
|
boolean |
canAbandonFile(OpenDefinitionsDocument doc)
Check if the specified document has been modified. |
|
void |
classFileError(ClassFileError e)
Event that is fired when testing encounters an illegal class file. |
|
void |
compileAborted(Exception e)
Called if a compilation is aborted. |
|
void |
compileBeforeJavadoc(CompilerListener afterCompile)
Called before attempting Javadoc, to give the user a chance to compile. |
|
void |
compileBeforeJUnit(CompilerListener testAfterCompile,
List<OpenDefinitionsDocument> outOfSync)
Compile all open source files if this option is configured or running as a unit test. |
|
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)
Only callable from within the event-handling thread |
|
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. |
|
|
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... files)
Called when trying to open one or more files that do not exist. |
|
File[] |
filesReadOnly(File... files)
Called when trying to write one or more files that are read-only. |
|
void |
focusOnDefinitionsPane()
Moves focus in MainFrame to 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 |
interactionEnded()
Called when an interaction has ended. |
|
void |
interactionErrorOccurred(int offset,
int length)
Called when an interaction results in a syntax error. |
|
void |
interactionIncomplete()
Called when enter was typed in the interactions pane but the interaction was incomplete. |
|
void |
interactionStarted()
Called when an interaction has started. |
|
void |
interpreterChanged(boolean inProgress)
Called when the active interpreter is changed. |
|
void |
interpreterExited(int status)
Called when the interpreter exits unexpectedly. |
|
void |
interpreterReady(File wd)
Called when the interpreter is ready to use. |
|
void |
interpreterResetFailed(Throwable t)
Called if the interpreter could not be reset. |
|
void |
interpreterResetting()
Called when the interpreter has begun resetting. |
|
void |
javadocEnded(boolean success,
File destDir,
boolean allDocs)
Called after Javadoc is finished. |
|
void |
javadocStarted()
Fire just before javadoc asynchronous thread is started. |
|
void |
junitClassesStarted()
We are junit'ing a specific list of classes given their source files. |
|
void |
junitEnded()
Called after JUnit is finished running tests. |
|
void |
junitStarted()
Only runs in event thread. |
|
void |
junitSuiteStarted(int numTests)
Called to indicate that a suite of tests has started running. |
|
void |
junitTestEnded(String name,
boolean succeeded,
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,
boolean didCompileFail)
Event that is fired with there is nothing to test. |
|
void |
openProject(File projectFile,
FileOpenSelector files)
Called while the project is being opened. |
|
void |
prepareForRun(OpenDefinitionsDocument doc)
Called when a file's main method is about to be run. |
|
void |
projectBuildDirChanged()
Called when the build directory is modified in the model. |
|
void |
projectClosed()
Called when the project is being closed. |
|
void |
projectModified()
Called if the project's modified state has changed. |
|
void |
projectRunnableChanged()
Called when the project runnability changed (ie, when the main file is set/unset). |
|
void |
projectWorkDirChanged()
Called when the working directory is modified in the model. |
|
boolean |
quitFile(OpenDefinitionsDocument doc)
Check if the current document has been modified. |
|
private boolean |
resetFNFCount()
|
|
void |
saveBeforeCompile()
Called to demand that all open source files be saved before compiling. |
|
void |
saveBeforeJavadoc()
Called to demand that all files be saved before generating Javadoc. |
|
void |
saveUntitled()
Saves the active document which is untitled. |
|
boolean |
shouldRevertFile(OpenDefinitionsDocument doc)
Called to ask the listener if it is OK to revert the current document to a newer version saved on file. |
|
private boolean |
someFilesNotFound()
|
|
void |
undoableEditHappened()
Called when an undoable edit occurs. |
|
void |
updateCurrentLocationInDoc()
Called when the current location in the document needs to be synchronized to the actual location displayed in the view. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private volatile int _fnfCount
| Constructor Detail |
|---|
private MainFrame.ModelListener()
| Method Detail |
|---|
public <P,R> void executeAsyncTask(AsyncTask<P,R> task,
P param,
boolean showProgress,
boolean lockUI)
GlobalModelListener
executeAsyncTask in interface GlobalModelListenerpublic void handleAlreadyOpenDocument(OpenDefinitionsDocument doc)
GlobalModelListener
handleAlreadyOpenDocument in interface GlobalModelListenerdoc - true if the user wishes to revert the document, false to ignorepublic void newFileCreated(OpenDefinitionsDocument doc)
GlobalModelListener
newFileCreated in interface GlobalModelListenerprivate boolean resetFNFCount()
private boolean someFilesNotFound()
public void filesNotFound(File... files)
GlobalModelListener
filesNotFound in interface GlobalModelListenerpublic File[] filesReadOnly(File... files)
GlobalModelListener
filesReadOnly in interface GlobalModelListenerfiles - files that are read-only
public void fileSaved(OpenDefinitionsDocument doc)
GlobalModelListener
fileSaved in interface GlobalModelListenerpublic void fileOpened(OpenDefinitionsDocument doc)
GlobalModelListener
fileOpened in interface GlobalModelListenerprivate void _fileOpened(OpenDefinitionsDocument doc)
public void fileClosed(OpenDefinitionsDocument doc)
GlobalModelListener
fileClosed in interface GlobalModelListenerprivate void _fileClosed(OpenDefinitionsDocument doc)
public void fileReverted(OpenDefinitionsDocument doc)
GlobalModelListener
fileReverted in interface GlobalModelListenerpublic void undoableEditHappened()
GlobalModelListener
undoableEditHappened in interface GlobalModelListenerpublic void activeDocumentRefreshed(OpenDefinitionsDocument active)
GlobalModelListener
activeDocumentRefreshed in interface GlobalModelListenerpublic void activeDocumentChanged(OpenDefinitionsDocument active)
GlobalModelListener
activeDocumentChanged in interface GlobalModelListenerpublic void focusOnLastFocusOwner()
GlobalModelListener
focusOnLastFocusOwner in interface GlobalModelListenerpublic void focusOnDefinitionsPane()
focusOnDefinitionsPane in interface GlobalModelListenerpublic void interactionStarted()
InteractionsListener
interactionStarted in interface InteractionsListenerpublic void interactionEnded()
InteractionsListener
interactionEnded in interface InteractionsListener
public void interactionErrorOccurred(int offset,
int length)
InteractionsListener
interactionErrorOccurred in interface InteractionsListeneroffset - the error's offset into the InteractionsDocumentlength - the length of the errorpublic void interpreterChanged(boolean inProgress)
interpreterChanged in interface InteractionsListenerinProgress - Whether the new interpreter is currently in progress with an interaction (i.e., whether an
interactionEnded event will be fired)public void compileStarted()
CompilerListener
compileStarted in interface CompilerListener
public void compileEnded(File workDir,
List<? extends File> excludedFiles)
CompilerListener
compileEnded in interface CompilerListenerpublic void compileAborted(Exception e)
compileAborted in interface CompilerListenerpublic void activeCompilerChanged()
activeCompilerChanged in interface CompilerListenerpublic void prepareForRun(OpenDefinitionsDocument doc)
GlobalModelListener
prepareForRun in interface GlobalModelListenerpublic void junitStarted()
junitStarted in interface JUnitListenerpublic void junitClassesStarted()
junitClassesStarted in interface JUnitListenerpublic void junitSuiteStarted(int numTests)
JUnitListener
junitSuiteStarted in interface JUnitListenernumTests - The number of tests in the suite to be run.public void junitTestStarted(String name)
JUnitListener
junitTestStarted in interface JUnitListenername - The name of the test being started.
public void junitTestEnded(String name,
boolean succeeded,
boolean causedError)
JUnitListener
junitTestEnded in interface JUnitListenername - The name of the test that has ended.succeeded - Whether the test passed or not.causedError - If not successful, whether the test caused an error or simply failed.public void junitEnded()
JUnitListener
junitEnded in interface JUnitListenerpublic void javadocStarted()
javadocStarted in interface JavadocListener
public void javadocEnded(boolean success,
File destDir,
boolean allDocs)
JavadocListener
javadocEnded in interface JavadocListenersuccess - whether the Javadoc operation generated proper outputdestDir - if (success == true) the location where the output was generated, otherwise undefined (null?)allDocs - Whether we are running over all open documentspublic void interpreterExited(int status)
InteractionsListener
interpreterExited in interface InteractionsListenerstatus - the exit codepublic void interpreterResetFailed(Throwable t)
InteractionsListener
interpreterResetFailed in interface InteractionsListenert - Throwable explaining why the reset failed.public void interpreterResetting()
InteractionsListener
interpreterResetting in interface InteractionsListenerpublic void interpreterReady(File wd)
InteractionsListener
interpreterReady in interface InteractionsListenerpublic void consoleReset()
GlobalModelListener
consoleReset in interface GlobalModelListenerpublic void saveBeforeCompile()
CompilerListener
saveBeforeCompile in interface CompilerListener
public void compileBeforeJUnit(CompilerListener testAfterCompile,
List<OpenDefinitionsDocument> outOfSync)
compileBeforeJUnit in interface JUnitListenerpublic void saveBeforeJavadoc()
JavadocListener
saveBeforeJavadoc in interface JavadocListener
private void _saveAllBeforeProceeding(String message,
BooleanOption option,
String checkMsg)
message - a prompt message to be displayed to the useroption - the BooleanOption for the prompt dialog checkboxcheckMsg - the description of the checkbox ("Always save before X")public void compileBeforeJavadoc(CompilerListener afterCompile)
JavadocListener
compileBeforeJavadoc in interface JavadocListener
private void _compileBeforeProceeding(String message,
BooleanOption option,
String checkMsg,
CompilerListener afterCompile)
message - a prompt message to be displayed to the useroption - the BooleanOption for the prompt dialog checkboxcheckMsg - the description of the checkbox ("Always compile before X")public void saveUntitled()
saveUntitled in interface CompilerListenerpublic void filePathContainsPound()
GlobalModelListener
filePathContainsPound in interface GlobalModelListener
public void nonTestCase(boolean isTestAll,
boolean didCompileFail)
nonTestCase in interface JUnitListenerisTestAll - whether or not it was a use of the test all buttondidCompileFail - whether or not a compile before this JUnit attempt failedpublic void classFileError(ClassFileError e)
classFileError in interface JUnitListenere - the error or exception thrown by loading and resolving f.public void currentDirectoryChanged(File dir)
currentDirectoryChanged in interface GlobalModelListenerpublic boolean canAbandonFile(OpenDefinitionsDocument doc)
canAbandonFile in interface GlobalModelListener
private boolean _fileSaveHelper(OpenDefinitionsDocument doc,
int paneOption)
public boolean quitFile(OpenDefinitionsDocument doc)
quitFile in interface GlobalModelListenerpublic boolean shouldRevertFile(OpenDefinitionsDocument doc)
shouldRevertFile in interface GlobalModelListenerpublic void interactionIncomplete()
InteractionsListener
interactionIncomplete in interface InteractionsListenerpublic void projectBuildDirChanged()
GlobalModelListener
projectBuildDirChanged in interface GlobalModelListenerpublic void projectWorkDirChanged()
GlobalModelListener
projectWorkDirChanged in interface GlobalModelListenerpublic void projectModified()
GlobalModelListener
projectModified in interface GlobalModelListenerpublic void projectClosed()
GlobalModelListener
projectClosed in interface GlobalModelListenerpublic void allFilesClosed()
GlobalModelListener
allFilesClosed in interface GlobalModelListener
public void openProject(File projectFile,
FileOpenSelector files)
GlobalModelListener
openProject in interface GlobalModelListenerprojectFile - the location of the project filefiles - The files the gui should open for the modelpublic void projectRunnableChanged()
GlobalModelListener
projectRunnableChanged in interface GlobalModelListener
public void documentNotFound(OpenDefinitionsDocument d,
File f)
GlobalModelListener
documentNotFound in interface GlobalModelListenerpublic void browserChanged()
GlobalModelListener
browserChanged in interface GlobalModelListenerpublic void updateCurrentLocationInDoc()
GlobalModelListener
updateCurrentLocationInDoc in interface GlobalModelListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||