edu.rice.cs.drjava.model
Interface GlobalModelListener

All Known Subinterfaces:
SingleDisplayModelListener
All Known Implementing Classes:
GlobalModelTestCase.TestListener

public interface GlobalModelListener

An interface for responding to events generated by the GlobalModel.

Version:
$Id: GlobalModelListener.java,v 1.23 2002/08/15 23:03:57 jhsia Exp $

Inner Class Summary
static class GlobalModelListener.SaveReason
          Reasons provided for demanding a save before proceeding.
 
Field Summary
static GlobalModelListener.SaveReason COMPILE_REASON
          This enumeration of save reason means that we want to compile.
static GlobalModelListener.SaveReason DEBUG_REASON
          This enumeration of save reason means that we want to debug with JSwat.
static GlobalModelListener.SaveReason JUNIT_REASON
          This enumeration of save reason means that we want to run JUnit.
 
Method Summary
 boolean canAbandonFile(OpenDefinitionsDocument doc)
          Called to ask the listener if it is OK to abandon the current document.
 void compileEnded()
          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 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 fileReverted(OpenDefinitionsDocument doc)
          Called after a document is reverted.
 void fileSaved(OpenDefinitionsDocument doc)
          Called after the current document is saved.
 void interactionEnded()
          Called when an interaction has finished running.
 void interactionsExited(int status)
          Called when the interactions JVM was closed by System.exit or by being aborted.
 void interactionsReset()
          Called when the interactions window is reset.
 void interactionsResetting()
          Called when the interactionsJVM has begun to be resetted
 void interactionStarted()
          Called after an interaction is started by the GlobalModel.
 void junitEnded()
          Called after JUnit is finished running tests.
 void junitRunning()
          Called once JUnit actually starts running the tests.
 void junitStarted(OpenDefinitionsDocument doc)
          Called after JUnit is started by the GlobalModel.
 void newFileCreated(OpenDefinitionsDocument doc)
          Called after a new document is created.
 void nonTestCase()
          Called when trying to test a non-TestCase class.
 void saveAllBeforeProceeding(GlobalModelListener.SaveReason reason)
          Called to demand that the listeners save all open documents before the GlobalModel can proceed with another action.
 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.
 

Field Detail

COMPILE_REASON

public static final GlobalModelListener.SaveReason COMPILE_REASON
This enumeration of save reason means that we want to compile.

JUNIT_REASON

public static final GlobalModelListener.SaveReason JUNIT_REASON
This enumeration of save reason means that we want to run JUnit.

DEBUG_REASON

public static final GlobalModelListener.SaveReason DEBUG_REASON
This enumeration of save reason means that we want to debug with JSwat.
Method Detail

newFileCreated

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

fileSaved

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

fileOpened

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

fileClosed

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

fileReverted

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

compileStarted

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

compileEnded

public void compileEnded()
Called when a compile has finished running.

junitStarted

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

junitRunning

public void junitRunning()
Called once JUnit actually starts running the tests. (Primarily used in test cases.)

junitEnded

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

interactionStarted

public void interactionStarted()
Called after an interaction is started by the GlobalModel.

interactionEnded

public void interactionEnded()
Called when an interaction has finished running.

interactionsResetting

public void interactionsResetting()
Called when the interactionsJVM has begun to be resetted

interactionsReset

public void interactionsReset()
Called when the interactions window is reset.

interactionsExited

public void interactionsExited(int status)
Called when the interactions JVM was closed by System.exit or by being aborted. Immediately after this the interactions will be reset.
Parameters:
status - The exit code

consoleReset

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

saveAllBeforeProceeding

public void saveAllBeforeProceeding(GlobalModelListener.SaveReason reason)
Called to demand that the listeners save all open documents before the GlobalModel can proceed with another action.

nonTestCase

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

canAbandonFile

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

shouldRevertFile

public 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.