edu.rice.cs.drjava.ui

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Natural Language Processing
51.Net
52.Parser
53.PDF
54.Portal
55.Profiler
56.Project Management
57.Report
58.RSS RDF
59.Rule Engine
60.Science
61.Scripting
62.Search Engine
63.Security
64.Sevlet Container
65.Source Control
66.Swing Library
67.Template Engine
68.Test Coverage
69.Testing
70.UML
71.Web Crawler
72.Web Framework
73.Web Mail
74.Web Server
75.Web Services
76.Web Services apache cxf 2.2.6
77.Web Services AXIS2
78.Wiki Engine
79.Workflow Engines
80.XML
81.XML UI
Java Source Code / Java Documentation  » IDE » DrJava » edu.rice.cs.drjava.ui 
edu.rice.cs.drjava.ui
The ui package contains classes for the default user interface for DrJava. The interface allows multiple documents to be open, but requires that exactly one document is active at any time, since only one document is displayed in the GUI. This is enforced by subclassing the DefaultGlobalModel in the model package to add additional constraints to the logic and state of DrJava, while maintaining the separation from the pure user interface classes.

Additional Logic

The SingleDisplayModel is a subclass of DefaultGlobalModel, primarily providing the constraint that exactly one document is active at any time. It adds public methods for getting and setting the currently active document to the interface provided by GlobalModel, and fires a corresponding event through the SingleDisplayModelListener class, which is a subclass of GlobalModelListener.

Note that this behavior is not included in the DefaultGlobalModel because the notion of a single active document is specific to this user interface. Alternative GUIs might choose to display multiple documents simultaneously, eliminating the need for this additional constraint. Housing this logic in a subclass of DefaultGlobalModel, rather than in MainFrame itself, allows us to verify through unit tests that only one document can be active.

User Interface

The graphical user interface is implemented in Swing and is coordinated through the MainFrame class. The general layout and primary components of the interface are shown in the image below.

DrJava GUI

MainFrame

The MainFrame is the JFrame which houses all other components of the GUI. It is solely a means of displaying the state and logic kept within its SingleDisplayModel, and maintains as little state of its own as possible. The MainFrame consists of a JMenuBar containing the menus, current filename, and toolbar buttons, together with a collection of panes for displaying the various components of DrJava. These include a scrollable JList with the OpenDefinitionDocuments, a DefinitionsPane for displaying and editing the source code, and a tabbed pane at the bottom which houses the InteractionsPane, CompilerErrorPanel, and OutputPane.

In addition to setting up the GUI and passing action requests to the model, MainFrame is also responsible for listening to events fired by both the GlobalModel and the document itself, in order to keep the display current.

Other Components

  • The primary GUI component outside the MainFrame is the DefinitionsPane, which is a JEditorPane that is tied to a specific OpenDefinitionsDocument in the model. This pane handles all highlighting and text indenting for its document, as well as undoing actions specific to the document.
  • The InteractionsPane is held in the tabbed pane at the bottom of the interface and provides the actual interaction with the repl interpreter within the GlobalModel.
  • The CompilerErrorPanel is another tab in the tabbed pane, and contains both a JComboBox for selecting the compiler and an ErrorListPane for displaying all the errors from the most recent compilation, sorted by document. The ErrorListPane is an inner class of CompilerErrorPanel, and is responsible for highlighting errors in the list and in the source consistently.
  • The OutputPane is the third tab in the tabbed pane, and is simply where System.out and System.err are redirected when DrJava is run.
  • The FindReplaceDialog is a separate JDialog which handles the logic and state of finding and replacing text in the code, including highlighting and changing the source position as necessary. Only one FindReplaceDialog exists in the GUI, and it must be notified each time the active document is changed.

Java Source File NameTypeComment
AbortablePanel.javaClass Panel for displaying some component with buttons, one of which is an "Abort" button.
AboutDialog.javaClass About dialog.
AbstractConsoleController.javaClass Abstract class that hooks a Swing console/interactions document with its Swing pane.
AbstractDJPane.javaClass This pane class for a SwingDocument.
AutoCompletePopup.javaClass Autocomplete support.
BackgroundColorListener.javaClass Creates and installs an OptionListener for DEFINITIONS_BACKGROUND_COLOR on a specified JTextComponent.
BookmarksPanel.javaClass Panel for displaying bookmarks.
BreakpointsPanel.javaClass Panel for displaying the breakpoints.
ClassPathFilter.javaClass A file filter for files with extensions ".jar"/".zip".
ClipboardHistoryFrame.javaClass Frame with history of clipboard.
CommonCloseButton.javaClass Common button that can be instantiated to create close buttons with any ActionListener to notify, or not, if you so choose.
CompilerErrorPanel.javaClass The panel which houses the list of errors after an unsuccessful compilation.
ConsoleController.javaClass A Swing specific console controller class that includes both a Swing InteractionsDJDocument and a GUI agnostic ConsoleDocument (wrapping the former).
DebugPanel.javaClass Panel for displaying the debugger input and output in MainFrame.
DefinitionsPane.javaClass The pane in which work on a given OpenDefinitionsDocument occurs.
DefinitionsPaneMemoryLeakTest.javaClass
DefinitionsPaneTest.javaClass
DetachedFrame.javaClass
DirectoryFilter.javaClass A file filter for selecting directories.
DrJavaErrorHandler.javaClass The handle() method in this class is called every time an uncaught exception propagates to an AWT action. The static log() method can be used to put log entries into the error log but continue execution. This does not automatically update the "DrJava Errors" window when new errors occur.
DrJavaErrorPopup.javaClass Displays a popup window for the first uncaught exception or logged conditions.
DrJavaErrorWindow.javaClass Displays uncaught exceptions and logged conditions. This window is not automatically updated when new errors occur.
DrJavaScrollableDialog.javaClass A JDialog with a scrollable text area and a button panel.
DrJavaSurveyPopup.javaClass Asks whether DrJava may contact the DrJava developers and send information about the operating system and the Java version used.
EditExternalDialog.javaClass
ErrorCaretListener.javaClass Listens to the caret in the associated DefinitionsPane and highlights the text containing CompilerErrors.
ErrorPanel.javaClass This class contains common code and interfaces from CompilerErrorPanel, JUnitPanel, and JavadocErrorPanel.
ExecuteExternalDialog.javaClass
ExternalProcessPanel.javaClass Panel for displaying some component with buttons, one of which is an "Abort" button.
FindReplacePanel.javaClass The tabbed panel that handles requests for finding and replacing text.
FindResultsPanel.javaClass Panel for displaying find results.
ForegroundColorListener.javaClass Creates and installs an OptionListener for DEFINITIONS_NORMAL_COLOR on a specified JTextComponent.
GenerateCustomDrJavaJarFrame.javaClass A frame for generating a custom drjava.jar.
HelpFrame.javaClass The frame for displaying the HTML help files.
HistorySaveDialog.javaClass Displayed when the user chooses to save the interactions history.
HTMLFrame.javaClass The frame for displaying the HTML help files.
InsertVariableDialog.javaClass Dialog allowing the user to select a variable.
InteractionsController.javaClass This class installs listeners and actions between an InteractionsDocument (the model) and an InteractionsPane (the view).
InteractionsHistoryFilter.javaClass A file filter for files with extensions ".hist".
InteractionsPane.javaClass The view component for repl interaction.
InteractionsPaneTest.javaClass Test functions of InteractionsPane.
InteractionsScriptController.javaClass Controller for an interactions script.
InteractionsScriptPane.javaClass Pane for an interactions script.
JarOptionsDialog.javaClass
JavadocDialog.javaClass Manages a dialog box that can select a destination directory for generating Javadoc.
JavadocErrorPanel.javaClass The panel which displays all the Javadoc parsing errors.
JavadocFrame.javaClass
JavaSourceFilter.javaClass A file filter for files with extensions ".java" and ".dj?".
JUnitPanel.javaClass The panel that displays all the testing errors.
KeyBindingManager.javaClass Contains Hashtables that are used in the key-binding process along with methods to build them and access their contents.
LessPanel.javaClass Panel for displaying some component with buttons, one of which is an "Abort" button.
LineEnumRule.javaClass
MainFrame.javaClass DrJava's main window.
MainFrameStatics.javaClass Utilities for DrJava's main window.
MainFrameTest.javaClass Test functions of MainFrame.
NewJavaClassDialog.javaClass Generates Java source from information entered in the "New Class" dialog.
NewJavaClassTest.javaClass Tests for NewNewJavaClassDialog.
NewVersionPopup.javaClass Displays whether a new version of DrJava is available.
PreviewConsoleFrame.javaClass
PreviewDefDocFrame.javaClass
PreviewFrame.javaClass
ProjectMenuTest.javaClass Test functions of Project Facility working through the main frame and model.
ProjectPropertiesFrame.javaClass
QuickStartFrame.javaClass The frame for displaying the HTML quick start files.
RecentDocFrame.javaClass This class extends a Swing view class.
RecentFileManager.javaClass Manages a list of the most recently used files to be displayed in the File menu.
RecentFileManagerTest.javaClass Test functions of RecentFileManager.
RegionsListPanel.javaClass Panel for displaying regions in a list in the order specified by indices passes to addRegion.
RegionsTreePanel.javaClass Panel for displaying regions in a tree sorted by class name and line number.
ReverseHighlighter.javaClass Implements the Highlighter interfaces.
SimpleInteractionsWindow.javaClass A standalone Interactions Window that provides the functionality of DrJava's Interactions Pane in a single JVM.
SmartSourceFilter.javaClass A file filter for all source files.
SplashScreen.javaClass A splash screen window to be displayed as DrJava is first starting up.
TabbedPanel.javaClass Extended by all panels that can dynamically be added or removed from the _tabbedPane in MainFrame.
ww__w___.ja__v__a__2_s_.___c_o_m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.