edu.rice.cs.drjava.model |
The model package is responsible for the majority of the logic
and state in DrJava.
It is independent of the presentation, allowing different user interfaces
to be created for the same codebase. The interfaces and classes in this
package maintain the state of all open documents, interface to the compiler
and interaction components, and communicate with the user interface through
public methods and GlobalModelListeners .
GlobalModel's Role
The GlobalModel is the central point of DrJava, coordinating
all components and communicating with the user interface.
To maintain state, the GlobalModel keeps a list of the
OpenDefinitionsDocuments , each of which is responsible for its
own DefinitionsDocument object and document specific actions
on that object, such as saving and compiling.
The GlobalModel also provides a set of public methods which
allow it to communicate with the user interface. This gives the
ui package access to the OpenDefinitionsDocuments ,
compiler, console, and interactions code.
To keep the user interface up-to-date, the GlobalModel fires
events to all GlobalModelListeners which have registered with
it. Events are fired after actions which can affect the user interface, such
as the opening, saving, and closing of files, or the starting and ending
of compilation or interaction.
Subpackages
- The
compiler package provides an interface between the
model and the available compilers, allowing DrJava to
compile documents and maintain any errors produced as a result.
- The
definitions package provides the model of the documents
and editor kit, as well as the reducedmodel package for
lightweight representation of a document for easy parenthesis matching
and similar syntactic features.
- The
repl package contains the classes used for the
Interactions window, allowing the dynamic execution of Java code
from within DrJava.
|
Java Source File Name | Type | Comment |
AbstractDJDocument.java | Class | Class containing code shared between the DefinitionsDocument and the InteractionsDJDocument. |
AbstractGlobalModel.java | Class | In simple terms, a DefaultGlobalModel without an interpreter, compiler, junit testing, debugger or javadoc. |
AlreadyOpenException.java | Class | Indicates that the file attempting to be opened is already open. |
BrainClassLoader.java | Class | |
ClassAndInterfaceFinder.java | Class | |
ClassAndInterfaceFinderTest.java | Class | ClassAndInterfaceFinderTest for unit testing ClassAndInterfaceFinder. |
ClipboardHistoryModel.java | Class | Model class for clipboard history. |
DeadClassLoader.java | Class | |
DefaultGlobalModel.java | Class | Handles the bulk of DrJava's program logic. |
DefaultLightWeightParsingControl.java | Class | Default light-weight parsing control. |
DJDocument.java | Interface | Interface to be collectively shared by the Definitions Document, Open Definitions Document,
and the Interactions Document. |
DocumentClosedException.java | Class | |
DocumentRegion.java | Interface | Interface for region data. |
DummyGlobalModel.java | Class | Concrete implementation of GlobalModel that always throws UnsupportedOperation exceptions. |
DummyGlobalModelListener.java | Class | A dummy GlobalModelListener that does nothing. |
DummyGlobalModelTest.java | Class | DummyGetDocumentsTest for unit testing DummyGetDocuments. |
DummyOpenDefDoc.java | Class | |
DummyOpenDefDocTest.java | Class | DummyOpenDefDocTest for unit testing DummyOpenDefDoc. |
EventNotifier.java | Class | Base class for all component-specific EventNotifiers. |
EventNotifierTest.java | Class | Tests the functionality of the class that notifies listeners
of a global model. |
FileGroupingState.java | Interface | This state pattern is used by the global model to store any information pertaining to the currently open project. |
FileMovedException.java | Class | Special FileMovedException to signify when a document's file no longer exists on disk where it once was. |
FileSaveSelector.java | Interface | An interface to give GlobalModel a file to save a document to. |
Finalizable.java | Interface | A listener that may be added to classes that
implement the Finalizable interface. |
FinalizationEvent.java | Class | Objects of this type are given to those
listening for finalization. |
FinalizationListener.java | Interface | A listener that may be added to classes that
implement the Finalizable interface. |
FindReplaceMachine.java | Class | Implementation of logic of find/replace over a document. |
FindReplaceMachineTest.java | Class | Tests the FindReplaceMachine. |
FindResult.java | Class | Returned to FindMachineDialog with the location of the found string
(or -1 if the string was not found) as well as a flag indicating
whether the machine wrapped around the end of the document. |
GlobalEventNotifier.java | Class | Keeps track of all listeners to the model, and has the ability to notify them of some event.
This class has a specific role of managing GlobalModelListeners. |
GlobalIndentTest.java | Class | Tests the indenting functionality on the level of the GlobalModel. |
GlobalModel.java | Interface | Handles the bulk of DrJava's program logic. |
GlobalModelCompileErrorsTest.java | Class | Tests to ensure that compilation fails when expected, and that the errors
are reported correctly. |
GlobalModelCompileIOTest.java | Class | Tests to ensure that compilation interacts with files correctly. |
GlobalModelCompileSuccessOptionsTest.java | Class | Tests to ensure that compilation succeeds when expected. |
GlobalModelCompileSuccessTest.java | Class | Tests to ensure that compilation succeeds when expected. |
GlobalModelCompileSuccessTestCase.java | Class | Tests to ensure that compilation succeeds when expected. |
GlobalModelCompileTest.java | Class | Tests to ensure that compilation behaves correctly in border cases. |
GlobalModelIOTest.java | Class | Test I/O functions of the global model. |
GlobalModelJUnitTest.java | Class | A test of Junit testing support in the GlobalModel. |
GlobalModelListener.java | Interface | An interface for responding to events generated by the GlobalModel. |
GlobalModelOtherTest.java | Class | A test on the GlobalModel that does deals with everything outside of simple file operations, e.g., compile, quit. |
GlobalModelTestCase.java | Class | Base class for tests over the
GlobalModel .
This class provides a number of convenience methods for testing the GlobalModel. |
ILoadDocuments.java | Interface | This interface encapsulates the behavior of a document loader. |
JarJDKToolsLibrary.java | Class | |
JDKToolsLibrary.java | Class | The class that provides methods for interfacing to facilities in tools.jar that do not have published interfaces
(or did not have published interfaces at the time DrJava was originally written). |
LightWeightParsingControl.java | Interface | Light-weight parsing control. |
LightWeightParsingListener.java | Interface | Light-weight parsing visitor. |
MovingDocumentRegion.java | Class | Class for a document region that can move with changes in the document; its text, however, remains constant. |
MultiThreadedTestCase.java | Class | TestCase which can fail if another thread causes an error or failure. |
MultiThreadedTestCaseTest.java | Class | Tests for MultiThreadedTestCase. |
OpenDefinitionsDocument.java | Interface | Interface for the GlobalModel's handler of an open
DefinitionsDocument. |
RegionManager.java | Interface | Interface for a region manager. |
RegionManagerListener.java | Interface | Any class which wants to listen to DocumentRegion events fired by a RegionManager should implement this interface
and use RegionManager's addListener() method. |
SimpleDocumentRegion.java | Class | Class for a simple document region. |
SingleDisplayModel.java | Interface | A GlobalModel that enforces invariants associated with having
one active document at a time.
Invariants:
-
SingleDisplayModel.getOpenDefinitionsDocuments will always return an array of
at least size 1.
- (follows from previous) If there is ever no document in the model,
a new one will be created.
- There is always exactly one active document, which can be get/set
via
SingleDisplayModel.getActiveDocument and
SingleDisplayModel.setActiveDocument .
Other functions added by this class:
- When calling
SingleDisplayModel.openFile , if there is currently only one open
document, and it is untitled and unchanged, it will be closed after the
new document is opened.
|
SingleDisplayModelTest.java | Class | Test functions of the single display model. |
StaticDocumentRegion.java | Class | Class for a document region that remains static all the time and does not respond to changes in the document. |
TestDocGetter.java | Class | Test implementation of the document fetching methods in the GlobalModel interface. |
TestDocGetterTest.java | Class | JUnit test class for testing TestDocGetter. |