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 | This class contains code supporting the concept of a "DJDocument"; it is shared between DefinitionsDocument and
InteractionsDJDocument. |
AbstractDJDocumentTest.java | Class | This class contains tests for AbstractDJDocument. |
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. |
BrowserDocumentRegion.java | Class | Class for document regions that totally ordered by allocation chronology. |
BrowserHistoryManager.java | Class | Browser history manager for the entire model. |
ClassAndInterfaceFinder.java | Class | |
ClassAndInterfaceFinderTest.java | Class | ClassAndInterfaceFinderTest for unit testing ClassAndInterfaceFinder. |
ClipboardHistoryModel.java | Class | Model class for clipboard history. |
ClipboardHistoryModelTest.java | Class | |
ConcreteRegionManager.java | Class | Simple region manager for the entire model. |
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 shared by the Definitions Document, Open Definitions Document, and Interactions Document. |
DJError.java | Class | A class to represent source errors and warnings generated by the compiler, JUnit, etc. |
DocumentClosedException.java | Class | |
DocumentRegion.java | Class | Class for a simple document region that only records region offsets, not positions. |
DocumentRegionTest.java | Class | Trivial JUnit test case class for DocumentRegion. |
DrJavaFileUtils.java | Class | Some common methods for determining Java source files, language level files, etc. |
DummyDocumentRegion.java | Class | The concrete class for "dummy document" regions produced by ProjectFileParser. |
DummyGlobalModel.java | Class | Concrete implementation of GlobalModel that always throws UnsupportedOperationExceptions. |
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. |
FileRegion.java | Interface | The minimal interface for all region classes. |
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. |
IDocumentRegion.java | Interface | Interface supported by all bona fide document regions (e.g., region classes other than DummyDocumentRegion). |
IHighlighted.java | Interface | Interface for highlighted regions. |
ILoadDocuments.java | Interface | This interface encapsulates the behavior of a document loader. |
JarJDKToolsLibrary.java | Class | A JDKToolsLibrary that was loaded from a specific jar file. |
JDKToolsLibrary.java | Class | Provides dynamic access to the interface of a JDK's tools.jar classes. |
LightWeightParsingControl.java | Interface | Light-weight parsing control. |
LightWeightParsingListener.java | Interface | Light-weight parsing visitor. |
MovingDocumentRegion.java | Class | Class for a document region that moves with changes in the document; it also includes a lazy tool-tip and line
boundaries. |
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 an open document in DrJava. |
OrderedDocumentRegion.java | Interface | Interface supported by all document regions used in search results, bookmarks, and breakpoints (e.g., region
classes other than DummyDocumentRegion and BrowserDocumentRegion). |
Query.java | Interface | |
Region.java | Interface | The minimal interface for all region classes. |
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. |
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. |
TestDocGetter.java | Class | Test implementation of the document fetching methods in the GlobalModel interface. |
TestDocGetterTest.java | Class | JUnit test class for testing TestDocGetter. |