edu.rice.cs.drjava.ui
Class MainFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by edu.rice.cs.util.swing.SwingFrame
                          extended by edu.rice.cs.drjava.ui.MainFrame
All Implemented Interfaces:
ClipboardOwner, DropTargetListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class MainFrame
extends SwingFrame
implements ClipboardOwner, DropTargetListener

DrJava's main window.

See Also:
Serialized Form

Nested Class Summary
private  class MainFrame.BackgroundColorOptionListener
          The OptionListener for DEFINITIONS_BACKGROUND_COLOR
private  class MainFrame.DJAsyncTaskLauncher
           
private static class MainFrame.DJFileDisplayManager
          This manager is meant to retrieve the correct icons for the given filename.
private  class MainFrame.DoclistFontOptionListener
          The OptionListener for FONT_DOCLIST
private static class MainFrame.GlassPane
          Blocks access to DrJava while the hourglass cursor is on.
private  class MainFrame.LastFocusListener
           
private  class MainFrame.LineEnumColorOptionListener
          The OptionListener for DEFINITIONS_LINE_NUMBER_COLOR and DEFINITIONS_LINE_NUMBER_BACKGROUND_COLOR.
private  class MainFrame.LineEnumOptionListener
          The OptionListener for LINEENUM_ENABLED.
private  class MainFrame.LineNumbersFontOptionListener
          The OptionListener for FONT_LINE_NUMBERS
private  class MainFrame.MainFontOptionListener
          The OptionListener for FONT_MAIN
(package private) static class MainFrame.MenuBar
          This allows us to intercept key events when compiling testing and turn them off when the glass pane is up.
private  class MainFrame.ModelListener
          Inner class to listen to all events in the model.
private  class MainFrame.NormalColorOptionListener
          The OptionListener for DEFINITIONS_NORMAL_COLOR
private static class MainFrame.OddDisplayManager
          This class wraps the file display managers by superimposing any notification icons on top of the base file icon.
private  class MainFrame.PositionListener
          Inner class to handle updating the current position in a document.
private  class MainFrame.QuitPromptOptionListener
          The OptionListener for QUIT_PROMPT.
private  class MainFrame.RecentFilesOptionListener
          The OptionListener for RECENT_FILES_MAX_SIZE.
private  class MainFrame.ToolbarFontOptionListener
          The OptionListener for FONT_TOOLBAR
private  class MainFrame.ToolbarOptionListener
          The OptionListener for TOOLBAR options
private  class MainFrame.UIDebugListener
          Listens to events from the debugger.
 
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  Action _aboutAction
          Action that pops up an info dialog.
private  AboutDialog _aboutDialog
           
private  boolean _allowKeyEvents
           
private  FileFilter _anyFileFilter
          Filter for any files (*.*)
(package private)  HashSet<MainFrameStatics.JavaAPIListEntry> _autoImportClassSet
          List with entries for the auto-import dialog.
(package private)  PredictiveInputFrame<MainFrameStatics.JavaAPIListEntry> _autoImportDialog
          The "Auto Import" dialog instance.
(package private)  JCheckBox _autoImportPackageCheckbox
           
private  Action _automaticTraceDebugAction
          Action that automatically traces through entire program
private  JMenuItem _automaticTraceMenuItem
           
private  Timer _automaticTraceTimer
          Timer to step into another line of code.
private  AbstractAction _autoRefreshAction
          auto-refresh the project and open new files
private  Action _beginLineAction
          Moves the caret to the "intelligent" beginning of the line.
private  BookmarksPanel _bookmarksPanel
           
private  Action _bookmarksPanelAction
          Action that shows the bookmarks tab.
private  BreakpointsPanel _breakpointsPanel
           
private  Action _breakpointsPanelAction
          Action that shows the breakpoints tab.
private  Action _browseBackAction
          Browse back in the browser history.
private  Action _browseForwardAction
          Browse forward in the browser history.
private  Action _checkNewVersionAction
          Action that pops up a dialog that checks for a new version.
private  AbstractAction _cleanAction
          cleans the build directory
private  Action _clearAllBreakpointsAction
          Clears all breakpoints
private  Action _clearConsoleAction
          Clears DrJava's output console.
private  Action _clearHistoryAction
          Clears the commands in the interaction history.
protected  Action _clearLineAction
          Deletes text from the caret to the end of the current line.
private  ClipboardHistoryFrame _clipboardHistoryDialog
          The "Clipboard History" dialog.
private  Action _closeAction
          Closes the current active document, prompting to save if necessary.
private  Action _closeAllAction
          Closes all open documents, prompting to save if necessary.
private  JButton _closeButton
           
private  Action _closeFolderAction
          Closes all open documents, prompting to save if necessary.
private  Action _closeProjectAction
           
(package private)  Action _closeSystemInAction
          Close input stream in the interactions pane.
private  Action _commentLinesAction
          Action for commenting out a block of text using wing comments.
private  Action _compileAction
          Compiles the document in the definitions pane.
private  AbstractAction _compileAllAction
          Compiles all open documents.
private  JButton _compileButton
           
private  AbstractAction _compileFolderAction
          Compiles all documents in the navigators active group.
private  AbstractAction _compileProjectAction
          Compiles all the project.
private  CompilerErrorPanel _compilerErrorPanel
           
(package private)  HashSet<MainFrameStatics.GoToFileListEntry> _completeClassSet
          List with entries for the complete dialog.
private  AutoCompletePopup _completeWordDialog
          The "Complete Word" dialog instance.
private  ConfigFrame _configFrame
           
private  ConsoleController _consoleController
           
private  InteractionsPane _consolePane
           
private  JPopupMenu _consolePanePopupMenu
           
private  JScrollPane _consoleScroll
           
private  Action _copyInteractionToDefinitionsAction
          Copies whatever is currently in the interactions pane at the prompt to the definitions pane.
private  DefinitionsDocument _currentDefDoc
          The currently displayed DefinitionsDocument.
private  DefinitionsPane _currentDefPane
          The currently displayed DefinitionsPane.
private  HighlightManager.HighlightInfo _currentLocationHighlight
          The current highlight displaying the current location, used for FindAll and the of the debugger's thread, if there is one.
private  File _currentProjFile
           
private  JLabel _currLocationField
           
protected  Action _cutLineAction
          Cuts from the caret to the end of the current line to the clipboard.
private  DetachedFrame _debugFrame
           
private  JMenuItem _debuggerEnabledMenuItem
           
private  JMenu _debugMenu
           
private  DebugPanel _debugPanel
           
private  JSplitPane _debugSplitPane
           
private  Timer _debugStepTimer
          Timer to display "Stepping..." message if a step takes longer than a certain amount of time.
private  HashMap<OpenDefinitionsDocument,JScrollPane> _defScrollPanes
          Maps an OpenDefDoc to its JScrollPane.
private  Action _detachDebugFrameAction
          Action that detaches the debugger pane.
private  JMenuItem _detachDebugFrameMenuItem
           
private  Action _detachTabbedPanesAction
          Action that detaches the tabbed panes.
private  JMenuItem _detachTabbedPanesMenuItem
           
private static MainFrame.DJFileDisplayManager _djFileDisplayManager20
           
private static MainFrame.DJFileDisplayManager _djFileDisplayManager30
           
private static Icon _djProjectIcon
           
private  JSplitPane _docSplitPane
           
private  IdentityHashMap<OrderedDocumentRegion,HighlightManager.HighlightInfo> _documentBookmarkHighlights
          Table to map bookmarks to their corresponding highlight objects.
private  IdentityHashMap<Breakpoint,HighlightManager.HighlightInfo> _documentBreakpointHighlights
          Table to map breakpoints to their corresponding highlight objects.
private  EditExternalDialog _editExternalDialog
          The edit external dialog.
private  Action _editExternalProcessesAction
          Action that edits saved processes.
private  JMenu _editMenu
           
private  Action _editPreferencesAction
          Action that calls the ConfigFrame to edit preferences.
private  Action _errorsAction
          Action that pops up the DrJava errors dialog.
private  JButton _errorsButton
           
private  ExecuteExternalDialog _executeExternalDialog
          The execute external dialog.
private  Action _executeExternalProcessAction
          Execute an external process.
private  Action _executeHistoryAction
          Interprets the commands in a file in the interactions window.
private  Action _exportProjectInOldFormatAction
           
private  JMenu _fileMenu
           
private  String _fileTitle
          The filename currently being displayed.
private  Action _findNextAction
          Find the next instance of the find word.
private  Action _findPrevAction
          Does the find next in the opposite direction.
private  FindReplacePanel _findReplace
           
private  Action _findReplaceAction
          Action that shows the find/replace tab.
private  LinkedList<Pair<FindResultsPanel,Map<MovingDocumentRegion,HighlightManager.HighlightInfo>>> _findResults
           
private  OrderedDocumentRegion _firstRegion
           
 FocusListener _focusListenerForRecentDocs
           
private  DirectoryChooser _folderChooser
          Provides a chooser to open a directory
private  Action _followFileAction
          Follow a file.
private  Action _forceQuitAction
          Quits DrJava.
private  Action _generateCustomDrJavaJarAction
          Action that pops up the dialog to generate a custom drjava.jar file.
private  Action _gotoClosingBraceAction
          Go to the closing brace.
private  Action _gotoFileAction
          Action implementing "Go to file" command, which asks the user for a file name and goes there.
(package private)  PredictiveInputFrame<MainFrameStatics.GoToFileListEntry> _gotoFileDialog
          The "Go to File" dialog instance.
(package private)  Action _gotoFileUnderCursorAction
          Goes to the file specified by the word the cursor is on.
private  Action _gotoLineAction
          Asks the user for a line number and goes there.
private  Action _gotoOpeningBraceAction
          Go to the opening brace.
(package private)  DefaultGUIAvailabilityNotifier _guiAvailabilityNotifier
          GUI component availability notifier.
private  Action _helpAction
          Action that shows what help documentation is available.
private  HelpFrame _helpFrame
           
private  JMenu _helpMenu
           
 KeyListener _historyListener
          These listeners support the traversal operations that cycle through recent documents.
private  int _hourglassNestLevel
           
private  Action _indentLinesAction
          Indents the current selection.
private  JPanel _interactionsContainer
           
private  InteractionsController _interactionsController
           
private  JFileChooser _interactionsHistoryChooser
           
private  FileOpenSelector _interactionsHistoryFileSelector
           
private  InteractionsPane _interactionsPane
           
private  JPopupMenu _interactionsPanePopupMenu
           
private  InteractionsScriptController _interactionsScriptController
           
private  InteractionsScriptPane _interactionsScriptPane
           
private  JarOptionsDialog _jarOptionsDialog
          The jar options dialog.
private  Action _jarProjectAction
           
(package private)  Set<MainFrameStatics.JavaAPIListEntry> _javaAPISet
          The list of Java API classes.
private  AbstractAction _javadocAllAction
          Runs Javadoc on all open documents (and the files in their packages).
private  AbstractAction _javadocCurrentAction
          Runs Javadoc on the current document.
private  JavadocErrorPanel _javadocErrorPanel
           
private  JavadocDialog _javadocSelector
          Provides the view's contribution to the Javadoc interaction.
private  AbstractAction _junitAction
          Runs JUnit on the document in the definitions pane.
private  AbstractAction _junitAllAction
          Runs JUnit over all open JUnit tests.
private  JButton _junitButton
           
private  AbstractAction _junitFolderAction
          Tests all the files in a folder.
private  JUnitPanel _junitPanel
           
private  AbstractAction _junitProjectAction
          Runs JUnit over all open JUnit tests in the project directory.
private  JMenu _languageLevelMenu
           
private  long _lastChangeTime
          The timestamp for the last change to any document.
 Component _lastFocusOwner
           
private  OrderedDocumentRegion _lastRegion
           
private  Action _loadHistoryScriptAction
          Action to load an interactions history as a replayable script.
private static Log _log
           
private  MainFrame.ModelListener _mainListener
          The main model listener attached by the main frame to the global model
(package private)  JSplitPane _mainSplit
           
private  ConfigOptionListeners.MasterJVMXMXListener _masterJvmXmxListener
          Listener for Main JVM
private  JMenuBar _menuBar
           
protected  Window _modalWindowAdapterOwner
          The owner of the modal window listener has already been taken by another window.
protected  HashMap<Window,WindowAdapter> _modalWindowAdapters
          Window adapter for "pseudo-modal" dialogs, i.e.
private  AbstractGlobalModel _model
          The model which controls all logic in DrJava.
private  Action _moveAllToAuxiliaryAction
           
private  Action _moveToAuxiliaryAction
           
private  DisplayManager<INavigatorItem> _navPaneDisplayManager
          This is what is given to the JTreeSortNavigator.
private  Action _newAction
          Creates a new blank document and select it in the definitions pane.
private  Action _newClassAction
          Creates a new Java class file.
private  Action _newDrJavaInstanceAction
          Action that starts a new, blank, unconnected DrJava instance.
 Action _newFileFolderAction
          Creates a new untitled, empty file in the current folder.
private  Action _newJUnitTestAction
          Sets the document in the definitions pane to a new templated junit test class.
private  Action _newProjectAction
           
private  Action _nextRegionAction
          Jump to the next region in the tabbed pane.
private static MainFrame.OddDisplayManager _oddDisplayManager20
           
private static MainFrame.OddDisplayManager _oddDisplayManager30
           
private  Action _openAction
          Asks user for file name and and reads that file into the definitions pane.
private  Action _openAllFolderAction
          Opens all the files in the current folder.
private  FileOpenSelector _openAnyFileSelector
          Returns the files to open.
private  JFileChooser _openChooser
          For opening files.
private  Action _openFileOrProjectAction
          Asks user for file name and and reads that file into the definitions pane.
private  FileOpenSelector _openFileOrProjectSelector
          Returns the files to open to the model (command pattern).
private  Action _openFolderAction
          Asks user for directory name and and reads it's files (and subdirectories files, on request) to the definitions pane.
private  Action _openJavadocAction
          Action that asks the user for a file name and goes there.
(package private)  PredictiveInputFrame<MainFrameStatics.JavaAPIListEntry> _openJavadocDialog
          The "Open Javadoc" dialog instance.
(package private)  Action _openJavadocUnderCursorAction
          Open Javadoc page specified by the word the cursor is on.
private  Action _openOneFolderAction
          Opens a files in the current folder.
private  Action _openProjectAction
          Asks user for project file name and and reads the associated files into the file navigator (and places the first source file in the editor pane)
private  JFileChooser _openProjectChooser
          For opening project files.
private  FileOpenSelector _openProjectSelector
          Returns the project file to open.
private  JCheckBox _openRecursiveCheckBox
           
private  FileOpenSelector _openSelector
          Returns the files to open to the model (command pattern).
private  Action _pageSetupAction
          Opens the page setup window.
private  Action _pasteHistoryAction
          Asks the user for a file name and goes there.
private  OpenDefinitionsDocument _pendingDocument
           
private  Runnable _pendingUpdate
           
private  MainFrame.PositionListener _posListener
           
private  Action _prevRegionAction
          Jump to the previous region in the tabbed pane.
private  Action _printConsoleAction
          Prints the console document.
private  Action _printConsolePreviewAction
          Opens the print preview window.
private  Action _printDefDocAction
          Prints the current document.
private  Action _printDefDocPreviewAction
          Opens the print preview window.
private  Action _printInteractionsAction
          Prints the interactions document.
private  Action _printInteractionsPreviewAction
          Opens the print preview window.
private  FileFilter _projectFilter
          Filter for drjava project files (.drjava and .xml and .pjt)
private  JMenu _projectMenu
           
private  AbstractAction _projectPropertiesAction
           
private  boolean _promptBeforeQuit
          Whether to display a prompt message before quitting.
private  Action _quickStartAction
          Action that shows the quick start documentation.
private  QuickStartFrame _quickStartFrame
           
private  Action _quitAction
          Quits DrJava.
private  RecentDocFrame _recentDocFrame
           
private  RecentFileManager _recentFileManager
          Keeps track of the recent files list in the File menu.
private  RecentFileManager _recentProjectManager
          Keeps track of the recent projects list in the Project menu
private  DelegatingAction _redoAction
          Redoes the last undo to the active definitions document.
private  JButton _redoButton
           
private  Action _removeAllAuxiliaryAction
           
private  Action _removeAuxiliaryAction
           
private  Action _renameAction
          Asks the user for a file name and renames and saves the active document (in the definitions pane) to that file.
private  MouseListener _resetFindReplaceListener
           
private  Action _resetInteractionsAction
          Resets the Interactions pane.
private  Action _resumeDebugAction
          Action that resumes debugging.
private  Action _revertAction
          Reverts the current document.
private  AbstractAction _runAction
          Finds and runs the main method of the current document, if it exists.
private  AbstractAction _runAppletAction
          Tries to run the current document as an applet.
private  JButton _runButton
           
private  AbstractAction _runProjectAction
           
private  Action _saveAction
          Saves the current document.
(package private)  Action _saveAllAction
          Saves all documents, prompting for file names as necessary.
private  Action _saveAsAction
          Asks the user for a file name and saves the active document (in the definitions pane) to that file.
private  FileSaveSelector _saveAsSelector
          Returns the file to save to the model (command pattern).
private  JFileChooser _saveChooser
          For saving files.
private  Action _saveConsoleCopyAction
          Saves a copy of DrJava's output console to a file.
private  Action _saveCopyAction
          Asks the user for a file name and saves a copy of the active document (in the definitions pane) to that file.
private  FileSaveSelector _saveCopySelector
          Returns the file to save to the model (command pattern) without updating the document state.
private  Action _saveHistoryAction
          Save the commands in the interactions window's history to a file
private  Action _saveInteractionsCopyAction
          Save the contents of the interactions window to a file.
private  Action _saveProjectAction
           
private  Action _saveProjectAsAction
           
private  FileSaveSelector _saveSelector
          Returns the file to save to the model (command pattern).
private  Action _selectAllAction
          Selects all text in window.
private  Action _selectionBeginLineAction
          Selects to the "intelligent" beginning of the line.
private  Action _showDebugConsoleAction
          Shows the DebugConsole.
private  boolean _showDebugger
           
private  ConfigOptionListeners.SlaveJVMXMXListener _slaveJvmXmxListener
          Listener for Interactions JVM
private  JPanel _statusBar
          Panel to hold both InteractionsPane and its sync message.
private  JLabel _statusField
           
private  JLabel _statusReport
           
private  Action _stepIntoDebugAction
          Action that steps into the next method call.
private  Action _stepOutDebugAction
          Action that steps out of the next method call.
private  Action _stepOverDebugAction
          Action that executes the next line, without stepping into methods.
private  Action _switchToNextAction
          Action that switches to next document.
private  Action _switchToNextPaneAction
          Switches focus to next pane.
private  Action _switchToPrevAction
          Switches to previous document.
private  Action _switchToPreviousPaneAction
          Switches focus to previous pane.
 JTabbedPane _tabbedPane
           
private  DetachedFrame _tabbedPanesFrame
           
 LinkedList<TabbedPanel> _tabs
           
private  boolean _tabUpdatePending
           
private  ExecutorService _threadPool
          Thread pool for executing asynchronous tasks.
private  Action _toggleBookmarkAction
          Toggles a bookmark.
(package private)  Action _toggleBreakpointAction
          Toggles a breakpoint on the current line
private  Action _toggleDebuggerAction
          Action that enables the debugger.
private  JToolBar _toolBar
           
private  JMenu _toolsMenu
           
private  FileFilter _txtFileFilter
          Filter for text files (.txt)
private  Action _uncommentLinesAction
          Action for un-commenting a block of commented text.
private  DelegatingAction _undoAction
          Undoes the last change to the active definitions document.
private  JButton _undoButton
           
 FocusListener _undoRedoDefinitionsFocusListener
           
private  Object _updateLock
           
private  Action _viewInteractionsClassPathAction
          Defines actions that displays the interactions classpath.
private  boolean _waitAgain
           
private  WindowListener _windowCloseListener
          How DrJava responds to window events.
(package private)  Action completeWordUnderCursorAction
          Auto-completes word the cursor is on.
private static int CONSOLE_TAB
           
(package private)  Action copyAction
          Default copy action.
(package private)  Action cutAction
          Default cut action.
private static int DEBUG_STEP_TIMER_VALUE
          Number of milliseconds to wait before displaying "Stepping..." message after a step is requested in the debugger.
private static String DEBUGGER_OUT_OF_SYNC
           
(package private)  DropTarget dropTarget
          Drag and drop target.
static Icon FIND_ICON
           
private static String ICON_PATH
           
private static int INTERACTIONS_TAB
           
(package private)  Action pasteAction
          Default paste action.
static long UPDATE_DELAY
           
static int UPDATER_PRIORITY
           
private static DataFlavor uriListFlavor
          Linux URI drag-and-drop data flavor.
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MainFrame()
          Creates the main window, and shows it.
 
Method Summary
(package private)  void _addGUIAvailabilityListener(Action a, GUIAvailabilityListener.ComponentType... components)
           
(package private)  void _addGUIAvailabilityListener(Component a, GUIAvailabilityListener.ComponentType... components)
           
private  JMenuItem _addMenuItem(JMenu menu, Action a, VectorOption<KeyStroke> opt, boolean updateKeyboardManager)
          Adds an Action as a menu item to the given menu, using the specified configurable keystroke.
private  JMenuItem _addMenuItem(JMenu menu, Action a, VectorOption<KeyStroke> opt, int index, boolean updateKeyboardManager)
          Inserts an Action as a menu item to the given menu, at the specified index, using the specified configurable keystroke.
private  boolean _checkProjectClose()
           
private  void _clean()
           
private  void _cleanUpDebugger()
           
private  void _close()
          Closes the active document.
private  void _closeAll()
           
private  void _closeFolder()
           
private  void _closeInteractionsScript()
          Closes the currently executing interactions script, if there is one.
(package private)  boolean _closeProject()
           
(package private)  boolean _closeProject(boolean quitting)
          Saves the project file; closes all open project files; and calls _model.closeProject(quitting) the clean up the state of the global model.
private  void _compile()
           
private  void _compileAll()
           
private  void _compileFolder()
           
private  void _compileProject()
           
private  void _completeWordUnderCursor()
          Complete the word the cursor is on.
private  void _configureBrowsing()
           
(package private)  JScrollPane _createDefScrollPane(OpenDefinitionsDocument doc)
          Create new DefinitionsPane and JScrollPane for an open definitions document.
(package private)  JButton _createManualToolbarButton(Action a)
          Creates a toolbar button for undo and redo, which behave differently.
private  void _createTab(TabbedPanel panel)
           
 JButton _createToolbarButton(Action a)
          Sets up all buttons for the toolbar except for undo and redo, which use _createManualToolbarButton.
protected  void _disableInteractionsPane()
          Ensures that the interactions pane is not editable during an interaction.
private  void _disableStepTimer()
          Disable any step timer.
(package private)  void _displayGUIComponentAvailabilityFrame()
           
private  void _doResetInteractions()
           
private  void _editProject()
          Edits project frame.
protected  void _enableInteractionsPane()
          Ensures that the interactions pane is editable after an interaction completes.
private  void _executeExternalProcess()
          Execute an external process and monitor its output.
private  void _fixToolbarHeights()
          Ensures that all toolbar buttons have the same height.
private  void _followFile()
          Open a file for following (like using "less" and F).
private  void _forceQuit()
           
static Set<MainFrameStatics.JavaAPIListEntry> _generateJavaAPISet(String base, String stripPrefix, String suffix)
          Generate Java API class list.
static Set<MainFrameStatics.JavaAPIListEntry> _generateJavaAPISet(String base, String stripPrefix, URL url)
          Generate Java API class list.
private  int _getBeginLinePos()
          Returns the "intelligent" beginning of line.
private  File _getFullFile(File f)
          Gets the absolute file, or if necessary, the canonical file.
private  ImageIcon _getIcon(String name)
          Returns the icon with the given name.
(package private)  void _gotoFileUnderCursor()
          Goes to the file specified by the word the cursor is on.
private  int _gotoLine()
          Ask the user what line they'd like to jump to, then go there.
private  void _hideDebuggerPanel()
           
private  void _initAutoImportDialog()
          Initialize dialog if necessary.
private  void _installNewDocumentListener(OpenDefinitionsDocument d)
          Makes sure save and compile buttons and menu items are enabled and disabled appropriately after document modifications.
 int _jumpToLine(int lineNum)
          Jump to the specified line and return the offset.
private  void _junit()
           
private  void _junitAll()
          Tests all open documents.
private  void _junitFolder()
           
private  void _junitInterrupted(String message)
           
private  void _junitInterrupted(UnexpectedException e)
           
private  void _junitProject()
          Tests the documents in the project source tree.
private  DocumentInfoGetter _makeInfoGetter(OpenDefinitionsDocument doc)
          Gets the information to be saved for a project document.
(package private)  void _moveAllToAuxiliary()
          Converts all external files to auxiliary files.
(package private)  void _moveToAuxiliary()
           
private  void _new()
           
 void _newJavaClass()
           
private  void _newProject()
          Closes all files and makes a new project.
private  void _open()
           
private  void _openFileOrProject()
           
private  void _openFolder()
           
private  void _openFolder(File dir, boolean rec, String ext)
          Opens all the files in the specified directory; it opens all files in nested folders if rec is true.
private  void _openJavadocUnderCursor()
          Opens the Javadoc specified by the word the cursor is on.
private  void _openProject()
          Asks the user to select the project file to open and starts the process of opening the project.
private  void _openProjectHelper(File projectFile)
          Oversees the opening of the project by delegating to the model to parse and initialize the project while resetting the navigator pane and opening up the files itself.
private  void _openProjectUpdate()
           
private  void _pageSetup()
           
private  void _printConsole()
           
private  void _printConsolePreview()
           
private  void _printDefDoc()
           
private  void _printDefDocPreview()
          Opens a new PrintPreview frame.
private  void _printInteractions()
           
private  void _printInteractionsPreview()
           
private  void _processDocs(Collection<OpenDefinitionsDocument> docs, Runnable1<OpenDefinitionsDocument> op)
          Performs op on each document in docs and invalidates the various project file collection properties.
private  void _putTextIntoDefinitions(String text)
          Puts the given text into the current definitions pane at the current caret position.
private  void _reenableScrollBar()
          Addresses Mac OS X bug where the scrollbars are disabled in one document after opening another.
private  void _refreshDefScrollPane()
          Refresh the JScrollPane containing the DefinitionsPane for the active document.
private  void _removeAllAuxiliary()
          Converts all auxiliary files to external files.
private  void _removeAuxiliary()
          Removes selected auxiliary files.
private  void _removeErrorListener(OpenDefinitionsDocument doc)
          Removes the ErrorCaretListener corresponding to the given document, after that document has been closed.
private  boolean _rename()
           
private  void _repaintLineNums()
          Repaints the line numbers on the active scroll pane.
private  void _resetJUnit()
           
private  void _resetNavigatorPane()
          Sets the left navigator pane to the correct component as dictated by the model.
private  void _revert()
           
private  void _revert(OpenDefinitionsDocument doc)
           
private  void _runApplet()
          Internal helper method to run the current document as applet in the interactions pane.
private  void _runMain()
          Internal helper method to run the main method of the current document in the interactions pane.
private  void _runProject()
           
private  boolean _save()
           
(package private)  void _saveAll()
           
(package private)  void _saveAllOld()
           
private  boolean _saveAs()
           
 void _saveConsoleCopy(ConsoleDocument doc)
          Saves a copy of either the console or the interactions pane to a file.
private  boolean _saveCopy()
           
 void _saveDocumentCopy(SwingDocument doc)
          Saves a copy of an error pane to a file.
private  void _saveProject()
           
private  boolean _saveProjectAs()
          Pops up the _saveChooser dialog, asks the user for a new project file name, and sets the project file to the specified file.
(package private)  void _saveProjectHelper(File file)
           
private  void _scanClassFiles()
          Scan the build directory for class files and update the auto-completion list.
private  void _selectAll()
           
private  void _setCurrentDirectory(File file)
          Sets the current directory to be that of the given file.
private  void _setCurrentDirectory(OpenDefinitionsDocument doc)
          Sets the current directory to be that of document's file.
private  void _setDebugMenuItemsEnabled(boolean isEnabled)
          Called every time the debug mode checkbox is toggled.
private  void _setMainFont()
          Sets the font of all panes and panels to the main font.
private  void _setMenuShortcut(JMenuItem item, Action a, VectorOption<KeyStroke> opt, boolean updateKeyboardManager)
          Sets the given menu item to have the specified configurable keystroke.
private  void _setThreadDependentDebugMenuItems(boolean isSuspended)
          Enables and disables the appropriate menu items in the debug menu depending upon the state of the current thread.
private  void _setUpAction(Action a, String icon, String shortDesc)
           
private  void _setUpAction(Action a, String name, String icon, String longDesc)
           
private  void _setUpActions()
          Initializes all action objects.
private  void _setUpContextMenus()
          Sets up the context menu to show in the document pane.
private  JMenu _setUpDebugMenu(int mask, boolean updateKeyboardManager)
          Creates and returns a debug menu.
private  JMenu _setUpEditMenu(int mask, boolean updateKeyboardManager)
          Creates and returns a edit menu.
private  JMenu _setUpFileMenu(int mask, boolean updateKeyboardManager)
          Creates and returns a file menu.
private  void _setUpGUIComponentAvailability()
          Initialize the availability of GUI components.
private  JMenu _setUpHelpMenu(int mask, boolean updateKeyboardManager)
          Creates and returns a help menu.
private  void _setUpKeyBindingMaps()
          Builds the Hashtables in KeyBindingManager that record key-bindings and support live updating, conflict resolution, and intelligent error messages (the ActionToNameMap).
private  JMenu _setUpLanguageLevelMenu(int mask, boolean updateKeyboardManager)
          Creates and returns the language levels menu.
(package private)  void _setUpMenuBar(JMenuBar menuBar)
          Sets up the components of the menu bar and links them to the private fields within MainFrame.
(package private)  void _setUpMenuBar(JMenuBar menuBar, JMenu fileMenu, JMenu editMenu, JMenu toolsMenu, JMenu projectMenu, JMenu debugMenu, JMenu languageLevelMenu, JMenu helpMenu)
           
private  void _setUpPanes()
           
private  void _setUpProjectButtons(File projectFile)
           
private  JMenu _setUpProjectMenu(int mask, boolean updateKeyboardManager)
          Creates and returns a project menu
private  void _setUpStatusBar()
          Sets up the status bar with the filename field.
private  void _setUpTabs()
           
private  void _setUpToolBar()
          Sets up the toolbar with several useful buttons.
private  JMenu _setUpToolsMenu(int mask, boolean updateKeyboardManager)
          Creates and returns a tools menu.
private  void _showAutoImportDialog(String s)
          Imports a class.
(package private)  void _showClassNotFoundError(ClassNotFoundException cnfe)
           
private  void _showConfigException()
          Check if any errors occurred while parsing the config file, and display a message if necessary.
(package private)  void _showDebugError(DebugException de)
           
private  void _showDebuggerPanel()
           
(package private)  void _showError(Throwable e, String title, String message)
           
(package private)  void _showFileMovedError(FileMovedException fme)
           
(package private)  void _showFileNotFoundError(FileNotFoundException fnf)
           
private  void _showFindReplaceTab(boolean showDetachedWindow)
          Shows the find/replace tab in the interactions pane.
(package private)  void _showIOError(IOException ioe)
           
(package private)  void _showJUnitInterrupted(String message)
           
(package private)  void _showJUnitInterrupted(UnexpectedException e)
           
(package private)  void _showNoClassDefError(NoClassDefFoundError ncde)
           
(package private)  void _showProjectFileParseError(MalformedProjectFileException mpfe)
           
(package private)  void _showWarning(Throwable e, String title, String message)
           
private  void _storePositionInfo()
          Stores the current position and size info for window and panes to the config framework.
(package private)  void _switchDefScrollPane()
          Switch to the JScrollPane containing the DefinitionsPane for the active document.
private  void _switchPaneFocus(boolean next)
          This method allows the user to cycle through the definitions pane and all of the open tabs.
private  void _switchToPane(Component c)
          This takes a component and gives it focus, showing it if it's a tab.
private  void _updateBackgroundColor()
          Updates the background color for the doc list.
private  void _updateDebugStatus()
          Checks if debugPanel's status bar displays the DEBUGGER_OUT_OF_SYNC message but the current document is in sync.
private  void _updateDefScrollRowHeader()
          Update the row header (line number enumeration) for the definitions scroll pane.
private  void _updateLineNums()
          Updates the font and colors of the line number display.
private  void _updateNormalColor()
          Updates the text color for the doc list.
(package private)  void _updateSavedConfiguration()
           
 JButton _updateToolbarButton(JButton b, Action a)
          Removes the button b from the toolbar and creates new button in its place.
private  void _updateToolbarButtons()
          Update the toolbar's buttons, following any change to TOOLBAR_ICONS_ENABLED, TOOLBAR_TEXT_ENABLED, or FONT_TOOLBAR (name, style, text)
private  void _updateToolBarVisible()
          Sets the toolbar as either visible or invisible based on the config option.
private  boolean _verifyOverwrite(File f)
          Confirms with the user that the file should be overwritten.
private  boolean _warnFileOpen(File f)
          Warns the user that the current file is open and query them if they wish to save over the currently open file.
 void addComponentListenerToOpenDocumentsList(ComponentListener listener)
           
 void addMenuBarInOtherFrame(JMenuBar menuBar)
           
 void addToBrowserHistory()
          Add the current location to the browser history.
 void addToBrowserHistoryBefore()
          Add the current location to the browser history before the current region.
(package private)  void askToIncreaseMasterMaxHeap()
          Ask the user to increase the master's max heap setting.
(package private)  void askToIncreaseSlaveMaxHeap()
          Ask the user to increase the slave's max heap setting.
 void clearCompleteClassSet()
          Clear the set of all classes.
 void clearJavaAPISet()
          Clears the Java API class set.
 void clearStatusMessage()
          Sets the message text in the status bar to the null string.
(package private)  void closeAll()
           
(package private)  boolean closeProject()
          Closes project when DrJava is not in the process of quitting.
 void commentLines()
          Comment current selection using wing commenting.
 FindResultsPanel createFindResultsPanel(RegionManager<MovingDocumentRegion> rm, MovingDocumentRegion region, String title, String searchString, boolean searchAll, boolean searchSelectionOnly, boolean matchCase, boolean wholeWord, boolean noComments, boolean noTestCases, WeakReference<OpenDefinitionsDocument> doc, FindReplacePanel findReplace)
          Create a new find results tab.
(package private)  void debuggerAutomaticTrace()
          Automatically traces through the entire program with a defined rate for stepping into each line of code
(package private)  void debuggerClearAllBreakpoints()
          Clears all breakpoints from the debugger.
(package private)  void debuggerResume()
          Resumes the debugger's current execution.
(package private)  void debuggerStep(Debugger.StepType type)
          Steps in the debugger.
 void debuggerToggle()
          Toggles whether the debugger is enabled or disabled, and updates the display accordingly.
(package private)  void debuggerToggleBreakpoint()
          Toggles a breakpoint on the current line.
private  void disableAutomaticTrace()
          Disable the automatic trace.
(package private)  void disableFindAgainOnClose(List<OpenDefinitionsDocument> projDocs)
          Disable "Find Again" on "Find All" tabs that use a document that was closed.
 void dispose()
          Clean up model and Swing resources.
 void dragEnter(DropTargetDragEvent dropTargetDragEvent)
          User dragged something into the component.
 void dragExit(DropTargetEvent dropTargetEvent)
           
 void dragOver(DropTargetDragEvent dropTargetDragEvent)
           
 void drop(DropTargetDropEvent dropTargetDropEvent)
          User dropped something on the component.
 void dropActionChanged(DropTargetDragEvent dropTargetDragEvent)
           
 void editPreferences()
           
private  void enableAutomaticTrace()
          Enable automatic trace.
 HashMap<OpenDefinitionsDocument,DocumentInfoGetter> gatherProjectDocInfo()
           
 void generateJavaAPISet()
          Generate Java API class list.
 boolean getAllowKeyEvents()
           
private  File getChosenFile(JFileChooser fc, int choice, File previous, boolean addSourceFileExtension)
          Returns the File selected by the JFileChooser.
private  File[] getChosenFiles(JFileChooser fc, int choice)
          Returns the Files selected by the JFileChooser.
(package private)  JButton getCloseButton()
           
(package private)  JButton getCompileAllButton()
          For testing purposes.
 CompilerErrorPanel getCompilerErrorPanel()
          Returns the compiler error panel.
 Set<MainFrameStatics.GoToFileListEntry> getCompleteClassSet()
           
 DefinitionsPane getCurrentDefPane()
          Returns the current DefinitionsPane.
 File getCurrentProject()
           
 DefinitionsPane getDefPaneGivenODD(OpenDefinitionsDocument doc)
           
 JViewport getDefViewport()
           
 JMenu getEditMenu()
          For test purposes only.
static MainFrame.DJFileDisplayManager getFileDisplayManager20()
           
static MainFrame.DJFileDisplayManager getFileDisplayManager30()
           
 String getFileNameField()
          For test purposes only.
(package private)  FindReplacePanel getFindReplaceDialog()
          Return the find replace dialog.
static ImageIcon getIcon(String name)
           
(package private)  InteractionsController getInteractionsController()
          Returns the frame's interactions controller.
(package private)  InteractionsPane getInteractionsPane()
          Returns the frame's interactions pane.
 Set<MainFrameStatics.JavaAPIListEntry> getJavaAPISet()
           
 JavadocErrorPanel getJavadocErrorPanel()
          Returns the javadoc error panel.
 JUnitPanel getJUnitPanel()
          Returns the JUnit error panel.
 long getLastChangeTime()
          Returns the changed status of the MainFrame.
 SingleDisplayModel getModel()
           
 DisplayManager<INavigatorItem> getNavPaneDisplayManager()
           
static MainFrame.OddDisplayManager getOddDisplayManager20()
           
static MainFrame.OddDisplayManager getOddDisplayManager30()
           
 File[] getOpenFiles(JFileChooser jfc)
          Prompt the user to select a place to open files from, then load them.
 File getSaveFile(JFileChooser jfc)
          Prompt the user to select a place to save the current document.
 CompilerErrorPanel getSelectedErrorPanel()
          Returns the currently shown error panel if there is one.
private  FileFilter getSourceFileFilter()
           
private  String getSuggestedFileExtension()
          Return the suggested file extension that will be appended to a file without extension.
 void gotoFileMatchingMask(String mask)
          Goes to the file matching the specified mask.
 void goToRegionAndHighlight(IDocumentRegion r)
           
 void handleRemoteOpenFile(File f, int lineNo)
          Handles an "open file" request, either from the remote control server or the operating system.
 void hideDebugger()
          Hide the debugger tab and update the Debug menu accordingly.
private  void hideRecentDocFrame()
           
 void hourglassOff()
          Return the cursor to normal.
 void hourglassOn()
          Make the cursor an hourglass.
private  void initCompleteWordDialog()
          Initialize the "Complete Word" dialog.
private  void initDebugFrame()
          Initializes the "Debugger" frame.
private  void initEditExternalProcessDialog()
          Initializes the "Edit External Process" dialog.
private  void initExecuteExternalProcessDialog()
          Initializes the "Execute External Process" dialog.
(package private)  void initGotoFileDialog()
          Initialize dialog if necessary.
private  void initJarOptionsDialog()
          Initializes the "Create Jar from Project" dialog.
(package private)  void initOpenJavadocDialog()
          Initialize dialog if necessary.
private  void initTabbedPanesFrame()
          Initializes the "Tabbed Panes" frame.
 void installModalWindowAdapter(Window w, Runnable1<? super WindowEvent> toFrontAction, Runnable1<? super WindowEvent> closeAction)
          Return the modal window listener if available, otherwise returns a non-modal dummy listener.
 boolean isCompilerTabSelected()
          Returns whether the compiler output tab is currently showing.
(package private)  boolean isDebuggerEnabled()
           
(package private)  boolean isDebuggerReady()
           
private static boolean isDisplayed(TabbedPanel p)
           
 boolean isJavadocTabSelected()
          Returns whether the JavaDoc output tab is currently showing.
(package private)  boolean isProjectActiveAndBuildDirSet()
           
(package private)  boolean isProjectActiveAndMainClassSet()
           
 boolean isSaveEnabled()
          Supports MainFrameTest.
 boolean isTestTabSelected()
          Returns whether the test output tab is currently showing.
 void lostOwnership(Clipboard clipboard, Transferable contents)
          We lost ownership of what we put in the clipboard.
private  DirectoryChooser makeFolderChooser(File workDir)
          Creates the folder chooser during MainFrame initialization which does not run in event thread.
private static
<R extends OrderedDocumentRegion>
Pair<R,R>
maxInterval(Pair<R,R> i, Pair<R,R> j)
           
private  void nextRecentDoc()
           
 void open(FileOpenSelector openSelector)
          Opens all the files returned by the FileOpenSelector prompting the user to handle the cases where files are already open, files are missing, or the action was canceled by the user
static void openExtProcessFile(File file)
          Open stand-alone external process file.
static void openExtProcessJarFile(File file)
          Open external process file in a jar file.
 void openFolder(DirectoryChooser chooser)
          Opens all the files in the directory returned by the FolderSelector.
 void openProject(FileOpenSelector projectSelector)
           
 void pack()
          Ensures that pack() is run in the event thread.
private  void packHelp()
          Helper method that provides access to super.pack() within the anonymous class new Runnable() {...} above
private  void prevRecentDoc()
           
 void projectRunnableChanged()
           
private  File proposeBetterFileName(File f)
           
(package private)  void quit()
          private void _revertAll() { try { _model.revertAllFiles(); } catch (FileMovedException fme) { _showFileMovedError(fme); } catch (IOException ioe) { MainFrameStatics.showIOError(MainFrame.this, ioe); } }
(package private)  void refreshBookmarkHighlightPainter()
          Sets new painters for existing bookmark highlights.
(package private)  void refreshBreakpointHighlightPainter()
          Sets up new painters for existing breakpoint highlights.
(package private)  void refreshFindResultsHighlightPainter(FindResultsPanel panel, LayeredHighlighter.LayerPainter painter)
          Set new painter for existing find results highlights.
 void removeCurrentLocationHighlight()
          Removes the current highlight.
 void removeMenuBarInOtherFrame(JMenuBar menuBar)
           
 void removeModalWindowAdapter(Window w)
          Removes the modal window adapter.
 void removeTab(Component c)
           
 void resetAutoImportDialogPosition()
          Reset the position of the "Open Javadoc" dialog.
 void resetClipboardHistoryDialogPosition()
          Reset the position of the "Clipboard History" dialog.
 void resetCompleteWordDialogPosition()
           
 void resetDebugFrame()
          Reset the position of the "Debugger" dialog.
 void resetEditExternalProcessPosition()
          Reset the position of the "Edit External Process" dialog.
 void resetExecuteExternalProcessPosition()
          Reset the position of the "Execute External Process" dialog.
 void resetGotoFileDialogPosition()
          Reset the position of the "Go to File" dialog.
 void resetJarOptionsDialogPosition()
          Reset the position of the "Create Jar from Project" dialog.
 void resetOpenJavadocDialogPosition()
          Reset the position of the "Open Javadoc" dialog.
 void resetTabbedPanesFrame()
          Reset the position of the "Tabbed Panes" dialog.
 void resetUndo()
          Resets the undo/redo menu items
(package private)  void saveProject()
           
 void scrollToDocumentAndOffset(OpenDefinitionsDocument doc, int offset, boolean shouldHighlight)
          Called when a specific document and offset should be displayed.
 void scrollToDocumentAndOffset(OpenDefinitionsDocument doc, int offset, boolean shouldHighlight, boolean shouldAddToHistory)
          Called when a specific document and offset should be displayed.
 void setAllowKeyEvents(boolean a)
           
 void setAutomaticTraceMenuItemStatus()
           
 void setPopupLoc(Window popup)
          Wrapper for setPopupLoc(Window, Component) that uses the window's owner as the owner to center the popup on.
 void setStatusMessage(String msg)
          Changes the message text toward the right of the status bar
 void setStatusMessageColor(Color c)
          Sets the color of the text in the status bar message
 void setStatusMessageFont(Font f)
          Sets the font of the status bar message
 void setUpDrJavaProperties()
          This method sets up all the DrJava properties that can be used as variables in external process command lines.
private  void setUpKeys()
          Sets up the ctrl-tab listener.
 void setVisible(boolean b)
           
 void showBookmarks()
          Adds the bookmarks panel to the tabbed pane and shows it.
 void showBreakpoints()
          Adds the breakpoints panel to the tabbed pane and shows it.
private  boolean showCleanWarning()
           
 void showDebugger()
          Display the debugger tab and update the Debug menu accordingly.
 void showFindResultsPanel(FindResultsPanel panel)
          Action that shows a find results tab.
 void showTab(Component c, boolean showDetachedWindow)
          Shows the components passed in the appropriate place in the tabbedPane depending on the position of the component in the _tabs list.
 void start()
          Realizes this MainFrame by setting it visibile and configures the tabbed Pane.
private static List<File> textURIListToFileList(String data)
          Convert a string with URIs to a list of files.
 void toggleBookmark()
          Toggle a bookmark.
 void uncommentLines()
          Uncomment current selection using wing commenting.
 void updateStatusField()
          Updates the status field with the current status of the Definitions Pane.
 void updateStatusField(String text)
          ONLY executes in event thread.
 void viewInteractionsClassPath()
          Displays the interactions classpath.
 
Methods inherited from class edu.rice.cs.util.swing.SwingFrame
duringInit, initDone
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

_log

private static final Log _log

INTERACTIONS_TAB

private static final int INTERACTIONS_TAB
See Also:
Constant Field Values

CONSOLE_TAB

private static final int CONSOLE_TAB
See Also:
Constant Field Values

ICON_PATH

private static final String ICON_PATH
See Also:
Constant Field Values

DEBUGGER_OUT_OF_SYNC

private static final String DEBUGGER_OUT_OF_SYNC
See Also:
Constant Field Values

DEBUG_STEP_TIMER_VALUE

private static final int DEBUG_STEP_TIMER_VALUE
Number of milliseconds to wait before displaying "Stepping..." message after a step is requested in the debugger.

See Also:
Constant Field Values

_model

private volatile AbstractGlobalModel _model
The model which controls all logic in DrJava.


_mainListener

private volatile MainFrame.ModelListener _mainListener
The main model listener attached by the main frame to the global model


_defScrollPanes

private HashMap<OpenDefinitionsDocument,JScrollPane> _defScrollPanes
Maps an OpenDefDoc to its JScrollPane. Why doesn't OpenDefDoc contain a defScrollPane field?


_currentDefPane

private volatile DefinitionsPane _currentDefPane
The currently displayed DefinitionsPane.


_currentDefDoc

private volatile DefinitionsDocument _currentDefDoc
The currently displayed DefinitionsDocument.


_fileTitle

private volatile String _fileTitle
The filename currently being displayed.


_tabs

public final LinkedList<TabbedPanel> _tabs

_tabbedPane

public final JTabbedPane _tabbedPane

_findResults

private final LinkedList<Pair<FindResultsPanel,Map<MovingDocumentRegion,HighlightManager.HighlightInfo>>> _findResults

_tabbedPanesFrame

private volatile DetachedFrame _tabbedPanesFrame

_lastFocusOwner

public volatile Component _lastFocusOwner

_compilerErrorPanel

private volatile CompilerErrorPanel _compilerErrorPanel

_junitPanel

private volatile JUnitPanel _junitPanel

_javadocErrorPanel

private volatile JavadocErrorPanel _javadocErrorPanel

_findReplace

private volatile FindReplacePanel _findReplace

_breakpointsPanel

private volatile BreakpointsPanel _breakpointsPanel

_bookmarksPanel

private volatile BookmarksPanel _bookmarksPanel

_debugPanel

private volatile DebugPanel _debugPanel

_consolePane

private volatile InteractionsPane _consolePane

_consoleScroll

private volatile JScrollPane _consoleScroll

_consoleController

private volatile ConsoleController _consoleController

_interactionsPane

private volatile InteractionsPane _interactionsPane

_interactionsContainer

private volatile JPanel _interactionsContainer

_interactionsController

private volatile InteractionsController _interactionsController

_interactionsScriptController

private volatile InteractionsScriptController _interactionsScriptController

_interactionsScriptPane

private volatile InteractionsScriptPane _interactionsScriptPane

_showDebugger

private volatile boolean _showDebugger

_debugFrame

private volatile DetachedFrame _debugFrame

_statusBar

private final JPanel _statusBar
Panel to hold both InteractionsPane and its sync message.


_statusField

private final JLabel _statusField

_statusReport

private final JLabel _statusReport

_currLocationField

private final JLabel _currLocationField

_posListener

private final MainFrame.PositionListener _posListener

_docSplitPane

private volatile JSplitPane _docSplitPane

_debugSplitPane

private volatile JSplitPane _debugSplitPane

_mainSplit

JSplitPane _mainSplit

_compileButton

private volatile JButton _compileButton

_closeButton

private volatile JButton _closeButton

_undoButton

private volatile JButton _undoButton

_redoButton

private volatile JButton _redoButton

_runButton

private volatile JButton _runButton

_junitButton

private volatile JButton _junitButton

_errorsButton

private volatile JButton _errorsButton

_toolBar

private final JToolBar _toolBar

_interactionsHistoryChooser

private final JFileChooser _interactionsHistoryChooser

_menuBar

private final JMenuBar _menuBar

_fileMenu

private volatile JMenu _fileMenu

_editMenu

private volatile JMenu _editMenu

_toolsMenu

private volatile JMenu _toolsMenu

_projectMenu

private volatile JMenu _projectMenu

_languageLevelMenu

private volatile JMenu _languageLevelMenu

_helpMenu

private volatile JMenu _helpMenu

_debugMenu

private volatile JMenu _debugMenu

_debuggerEnabledMenuItem

private volatile JMenuItem _debuggerEnabledMenuItem

_interactionsPanePopupMenu

private JPopupMenu _interactionsPanePopupMenu

_consolePanePopupMenu

private JPopupMenu _consolePanePopupMenu

_configFrame

private volatile ConfigFrame _configFrame

_helpFrame

private final HelpFrame _helpFrame

_quickStartFrame

private final QuickStartFrame _quickStartFrame

_aboutDialog

private volatile AboutDialog _aboutDialog

_recentDocFrame

private volatile RecentDocFrame _recentDocFrame

_recentFileManager

private volatile RecentFileManager _recentFileManager
Keeps track of the recent files list in the File menu.


_recentProjectManager

private volatile RecentFileManager _recentProjectManager
Keeps track of the recent projects list in the Project menu


_currentProjFile

private volatile File _currentProjFile

_debugStepTimer

private volatile Timer _debugStepTimer
Timer to display "Stepping..." message if a step takes longer than a certain amount of time. All accesses must be synchronized on it.


_automaticTraceTimer

private volatile Timer _automaticTraceTimer
Timer to step into another line of code. The delay for each step is recorded in milliseconds.


_currentLocationHighlight

private volatile HighlightManager.HighlightInfo _currentLocationHighlight
The current highlight displaying the current location, used for FindAll and the of the debugger's thread, if there is one. If there is none, this is null.


_documentBreakpointHighlights

private final IdentityHashMap<Breakpoint,HighlightManager.HighlightInfo> _documentBreakpointHighlights
Table to map breakpoints to their corresponding highlight objects.


_documentBookmarkHighlights

private final IdentityHashMap<OrderedDocumentRegion,HighlightManager.HighlightInfo> _documentBookmarkHighlights
Table to map bookmarks to their corresponding highlight objects.


_lastChangeTime

private volatile long _lastChangeTime
The timestamp for the last change to any document.


_promptBeforeQuit

private volatile boolean _promptBeforeQuit
Whether to display a prompt message before quitting.


_slaveJvmXmxListener

private volatile ConfigOptionListeners.SlaveJVMXMXListener _slaveJvmXmxListener
Listener for Interactions JVM


_masterJvmXmxListener

private volatile ConfigOptionListeners.MasterJVMXMXListener _masterJvmXmxListener
Listener for Main JVM


_guiAvailabilityNotifier

final DefaultGUIAvailabilityNotifier _guiAvailabilityNotifier
GUI component availability notifier.


_modalWindowAdapters

protected volatile HashMap<Window,WindowAdapter> _modalWindowAdapters
Window adapter for "pseudo-modal" dialogs, i.e. non-modal dialogs that insist on keeping the focus.


_modalWindowAdapterOwner

protected volatile Window _modalWindowAdapterOwner
The owner of the modal window listener has already been taken by another window.


_openChooser

private volatile JFileChooser _openChooser
For opening files. We have a persistent dialog to keep track of the last directory from which we opened.


_openProjectChooser

private volatile JFileChooser _openProjectChooser
For opening project files.


_saveChooser

private volatile JFileChooser _saveChooser
For saving files. We have a persistent dialog to keep track of the last directory from which we saved.


_projectFilter

private final FileFilter _projectFilter
Filter for drjava project files (.drjava and .xml and .pjt)


_txtFileFilter

private final FileFilter _txtFileFilter
Filter for text files (.txt)


_anyFileFilter

private final FileFilter _anyFileFilter
Filter for any files (*.*)


_threadPool

private volatile ExecutorService _threadPool
Thread pool for executing asynchronous tasks.


_openSelector

private final FileOpenSelector _openSelector
Returns the files to open to the model (command pattern).


_openFileOrProjectSelector

private final FileOpenSelector _openFileOrProjectSelector
Returns the files to open to the model (command pattern).


_openProjectSelector

private final FileOpenSelector _openProjectSelector
Returns the project file to open.


_openAnyFileSelector

private final FileOpenSelector _openAnyFileSelector
Returns the files to open.


_saveSelector

private final FileSaveSelector _saveSelector
Returns the file to save to the model (command pattern).


_saveAsSelector

private final FileSaveSelector _saveAsSelector
Returns the file to save to the model (command pattern).


_saveCopySelector

private final FileSaveSelector _saveCopySelector
Returns the file to save to the model (command pattern) without updating the document state.


_javadocSelector

private final JavadocDialog _javadocSelector
Provides the view's contribution to the Javadoc interaction.


_folderChooser

private volatile DirectoryChooser _folderChooser
Provides a chooser to open a directory


_openRecursiveCheckBox

private final JCheckBox _openRecursiveCheckBox

_moveToAuxiliaryAction

private final Action _moveToAuxiliaryAction

_removeAuxiliaryAction

private final Action _removeAuxiliaryAction

_moveAllToAuxiliaryAction

private final Action _moveAllToAuxiliaryAction

_removeAllAuxiliaryAction

private final Action _removeAllAuxiliaryAction

_newAction

private final Action _newAction
Creates a new blank document and select it in the definitions pane.


_newClassAction

private final Action _newClassAction
Creates a new Java class file.


_newProjectAction

private final Action _newProjectAction

_runProjectAction

private volatile AbstractAction _runProjectAction

_jarOptionsDialog

private volatile JarOptionsDialog _jarOptionsDialog
The jar options dialog.


_jarProjectAction

private final Action _jarProjectAction

_detachTabbedPanesAction

private final Action _detachTabbedPanesAction
Action that detaches the tabbed panes. Only runs in the event thread.


_detachTabbedPanesMenuItem

private volatile JMenuItem _detachTabbedPanesMenuItem

_detachDebugFrameAction

private final Action _detachDebugFrameAction
Action that detaches the debugger pane. Only runs in the event thread.


_detachDebugFrameMenuItem

private volatile JMenuItem _detachDebugFrameMenuItem

_newJUnitTestAction

private final Action _newJUnitTestAction
Sets the document in the definitions pane to a new templated junit test class.


_openAction

private final Action _openAction
Asks user for file name and and reads that file into the definitions pane.


_openFolderAction

private final Action _openFolderAction
Asks user for directory name and and reads it's files (and subdirectories files, on request) to the definitions pane.


_openFileOrProjectAction

private final Action _openFileOrProjectAction
Asks user for file name and and reads that file into the definitions pane.


_openProjectAction

private final Action _openProjectAction
Asks user for project file name and and reads the associated files into the file navigator (and places the first source file in the editor pane)


_closeProjectAction

private final Action _closeProjectAction

_closeAction

private final Action _closeAction
Closes the current active document, prompting to save if necessary.


_closeAllAction

private final Action _closeAllAction
Closes all open documents, prompting to save if necessary.


_closeFolderAction

private final Action _closeFolderAction
Closes all open documents, prompting to save if necessary.


_openAllFolderAction

private final Action _openAllFolderAction
Opens all the files in the current folder.


_openOneFolderAction

private final Action _openOneFolderAction
Opens a files in the current folder.


_newFileFolderAction

public final Action _newFileFolderAction
Creates a new untitled, empty file in the current folder.


_junitFolderAction

private volatile AbstractAction _junitFolderAction
Tests all the files in a folder.


_saveAction

private final Action _saveAction
Saves the current document.


_saveAsAction

private final Action _saveAsAction
Asks the user for a file name and saves the active document (in the definitions pane) to that file.


_saveCopyAction

private final Action _saveCopyAction
Asks the user for a file name and saves a copy of the active document (in the definitions pane) to that file. DrJava's state is not modified (i.e. it does not set the document to 'unchanged').


_renameAction

private final Action _renameAction
Asks the user for a file name and renames and saves the active document (in the definitions pane) to that file.


_saveProjectAction

private final Action _saveProjectAction

_saveProjectAsAction

private final Action _saveProjectAsAction

_exportProjectInOldFormatAction

private final Action _exportProjectInOldFormatAction

_revertAction

private final Action _revertAction
Reverts the current document.


_saveAllAction

final Action _saveAllAction
Saves all documents, prompting for file names as necessary.


_printDefDocAction

private final Action _printDefDocAction
Prints the current document.


_printConsoleAction

private final Action _printConsoleAction
Prints the console document.


_printInteractionsAction

private final Action _printInteractionsAction
Prints the interactions document.


_printDefDocPreviewAction

private final Action _printDefDocPreviewAction
Opens the print preview window.


_printConsolePreviewAction

private final Action _printConsolePreviewAction
Opens the print preview window.


_printInteractionsPreviewAction

private final Action _printInteractionsPreviewAction
Opens the print preview window.


_pageSetupAction

private final Action _pageSetupAction
Opens the page setup window.


_compileAction

private final Action _compileAction
Compiles the document in the definitions pane.


_compileProjectAction

private volatile AbstractAction _compileProjectAction
Compiles all the project.


_compileFolderAction

private volatile AbstractAction _compileFolderAction
Compiles all documents in the navigators active group.


_compileAllAction

private volatile AbstractAction _compileAllAction
Compiles all open documents.


_cleanAction

private volatile AbstractAction _cleanAction
cleans the build directory


_autoRefreshAction

private volatile AbstractAction _autoRefreshAction
auto-refresh the project and open new files


_runAction

private volatile AbstractAction _runAction
Finds and runs the main method of the current document, if it exists.


_runAppletAction

private volatile AbstractAction _runAppletAction
Tries to run the current document as an applet.


_junitAction

private volatile AbstractAction _junitAction
Runs JUnit on the document in the definitions pane.


_junitAllAction

private volatile AbstractAction _junitAllAction
Runs JUnit over all open JUnit tests.


_junitProjectAction

private volatile AbstractAction _junitProjectAction
Runs JUnit over all open JUnit tests in the project directory.


_javadocAllAction

private volatile AbstractAction _javadocAllAction
Runs Javadoc on all open documents (and the files in their packages).


_javadocCurrentAction

private volatile AbstractAction _javadocCurrentAction
Runs Javadoc on the current document.


cutAction

final Action cutAction
Default cut action. Returns focus to the correct pane.


copyAction

final Action copyAction
Default copy action. Returns focus to the correct pane.


pasteAction

final Action pasteAction
Default paste action. Returns focus to the correct pane.


_clipboardHistoryDialog

private volatile ClipboardHistoryFrame _clipboardHistoryDialog
The "Clipboard History" dialog.


_pasteHistoryAction

private final Action _pasteHistoryAction
Asks the user for a file name and goes there.


_copyInteractionToDefinitionsAction

private final Action _copyInteractionToDefinitionsAction
Copies whatever is currently in the interactions pane at the prompt to the definitions pane. If the current string is empty, then it will attempt to return the last entry from the interactions pane's history.


_undoAction

private final DelegatingAction _undoAction
Undoes the last change to the active definitions document.


_redoAction

private final DelegatingAction _redoAction
Redoes the last undo to the active definitions document.


_quitAction

private final Action _quitAction
Quits DrJava. Optionally displays a prompt before quitting.


_forceQuitAction

private final Action _forceQuitAction
Quits DrJava. Optionally displays a prompt before quitting.


_selectAllAction

private final Action _selectAllAction
Selects all text in window.


_findReplaceAction

private final Action _findReplaceAction
Action that shows the find/replace tab. Only executes in the event thread.


_findNextAction

private final Action _findNextAction
Find the next instance of the find word.


_findPrevAction

private final Action _findPrevAction
Does the find next in the opposite direction. If the direction is backward it searches forward.


_gotoLineAction

private final Action _gotoLineAction
Asks the user for a line number and goes there.


_gotoFileDialog

volatile PredictiveInputFrame<MainFrameStatics.GoToFileListEntry> _gotoFileDialog
The "Go to File" dialog instance.


_gotoFileAction

private final Action _gotoFileAction
Action implementing "Go to file" command, which asks the user for a file name and goes there.


_gotoFileUnderCursorAction

final Action _gotoFileUnderCursorAction
Goes to the file specified by the word the cursor is on.


_openJavadocDialog

volatile PredictiveInputFrame<MainFrameStatics.JavaAPIListEntry> _openJavadocDialog
The "Open Javadoc" dialog instance.


_javaAPISet

volatile Set<MainFrameStatics.JavaAPIListEntry> _javaAPISet
The list of Java API classes.


_openJavadocAction

private volatile Action _openJavadocAction
Action that asks the user for a file name and goes there. Only executes in the event thread.


_openJavadocUnderCursorAction

final Action _openJavadocUnderCursorAction
Open Javadoc page specified by the word the cursor is on.


_closeSystemInAction

final Action _closeSystemInAction
Close input stream in the interactions pane.


_completeWordDialog

private volatile AutoCompletePopup _completeWordDialog
The "Complete Word" dialog instance.


completeWordUnderCursorAction

final Action completeWordUnderCursorAction
Auto-completes word the cursor is on.


_indentLinesAction

private final Action _indentLinesAction
Indents the current selection.


_commentLinesAction

private final Action _commentLinesAction
Action for commenting out a block of text using wing comments.


_uncommentLinesAction

private final Action _uncommentLinesAction
Action for un-commenting a block of commented text.


_saveConsoleCopyAction

private final Action _saveConsoleCopyAction
Saves a copy of DrJava's output console to a file.


_clearConsoleAction

private final Action _clearConsoleAction
Clears DrJava's output console.


_showDebugConsoleAction

private final Action _showDebugConsoleAction
Shows the DebugConsole.


_resetInteractionsAction

private final Action _resetInteractionsAction
Resets the Interactions pane.


_viewInteractionsClassPathAction

private final Action _viewInteractionsClassPathAction
Defines actions that displays the interactions classpath.


_helpAction

private final Action _helpAction
Action that shows what help documentation is available. Only executes in the event thread.


_quickStartAction

private final Action _quickStartAction
Action that shows the quick start documentation. Only executes in the event thread.


_aboutAction

private final Action _aboutAction
Action that pops up an info dialog. Only runs in the event thread.


_checkNewVersionAction

private final Action _checkNewVersionAction
Action that pops up a dialog that checks for a new version. Only runs in the event thread.


_errorsAction

private final Action _errorsAction
Action that pops up the DrJava errors dialog. Only runs in the event thread.


_generateCustomDrJavaJarAction

private final Action _generateCustomDrJavaJarAction
Action that pops up the dialog to generate a custom drjava.jar file. Only runs in the event thread.


_newDrJavaInstanceAction

private final Action _newDrJavaInstanceAction
Action that starts a new, blank, unconnected DrJava instance.


_switchToNextAction

private final Action _switchToNextAction
Action that switches to next document. Only runs in the event thread.


_switchToPrevAction

private final Action _switchToPrevAction
Switches to previous document.


_switchToNextPaneAction

private final Action _switchToNextPaneAction
Switches focus to next pane.


_browseBackAction

private final Action _browseBackAction
Browse back in the browser history.


_browseForwardAction

private final Action _browseForwardAction
Browse forward in the browser history.


_nextRegionAction

private final Action _nextRegionAction
Jump to the next region in the tabbed pane.


_prevRegionAction

private final Action _prevRegionAction
Jump to the previous region in the tabbed pane.


_switchToPreviousPaneAction

private final Action _switchToPreviousPaneAction
Switches focus to previous pane.


_gotoClosingBraceAction

private final Action _gotoClosingBraceAction
Go to the closing brace.


_gotoOpeningBraceAction

private final Action _gotoOpeningBraceAction
Go to the opening brace.


_editPreferencesAction

private final Action _editPreferencesAction
Action that calls the ConfigFrame to edit preferences. Only runs in the event thread.


_projectPropertiesAction

private volatile AbstractAction _projectPropertiesAction

_toggleDebuggerAction

private final Action _toggleDebuggerAction
Action that enables the debugger. Only runs in the event thread.


_resumeDebugAction

private final Action _resumeDebugAction
Action that resumes debugging. Only runs in the event thread.


_automaticTraceMenuItem

private volatile JMenuItem _automaticTraceMenuItem

_automaticTraceDebugAction

private final Action _automaticTraceDebugAction
Action that automatically traces through entire program


_stepIntoDebugAction

private final Action _stepIntoDebugAction
Action that steps into the next method call. Only runs in the event thread.


_stepOverDebugAction

private final Action _stepOverDebugAction
Action that executes the next line, without stepping into methods. Only runs in the event thread.


_stepOutDebugAction

private final Action _stepOutDebugAction
Action that steps out of the next method call. Only runs in the event thread.


_toggleBreakpointAction

final Action _toggleBreakpointAction
Toggles a breakpoint on the current line


_clearAllBreakpointsAction

private final Action _clearAllBreakpointsAction
Clears all breakpoints


_breakpointsPanelAction

private final Action _breakpointsPanelAction
Action that shows the breakpoints tab. Only runs in the event thread.


_bookmarksPanelAction

private final Action _bookmarksPanelAction
Action that shows the bookmarks tab. Only runs in the event thread.


_toggleBookmarkAction

private final Action _toggleBookmarkAction
Toggles a bookmark.


_cutLineAction

protected final Action _cutLineAction
Cuts from the caret to the end of the current line to the clipboard.


_clearLineAction

protected final Action _clearLineAction
Deletes text from the caret to the end of the current line.


_beginLineAction

private final Action _beginLineAction
Moves the caret to the "intelligent" beginning of the line.

See Also:
_getBeginLinePos()

_selectionBeginLineAction

private final Action _selectionBeginLineAction
Selects to the "intelligent" beginning of the line.

See Also:
_getBeginLinePos()

_interactionsHistoryFileSelector

private final FileOpenSelector _interactionsHistoryFileSelector

_executeHistoryAction

private final Action _executeHistoryAction
Interprets the commands in a file in the interactions window.


_loadHistoryScriptAction

private final Action _loadHistoryScriptAction
Action to load an interactions history as a replayable script.


_saveInteractionsCopyAction

private final Action _saveInteractionsCopyAction
Save the contents of the interactions window to a file.


_saveHistoryAction

private final Action _saveHistoryAction
Save the commands in the interactions window's history to a file


_clearHistoryAction

private final Action _clearHistoryAction
Clears the commands in the interaction history.


_windowCloseListener

private final WindowListener _windowCloseListener
How DrJava responds to window events.


_resetFindReplaceListener

private final MouseListener _resetFindReplaceListener

_djFileDisplayManager20

private static final MainFrame.DJFileDisplayManager _djFileDisplayManager20

_djFileDisplayManager30

private static final MainFrame.DJFileDisplayManager _djFileDisplayManager30

_oddDisplayManager20

private static final MainFrame.OddDisplayManager _oddDisplayManager20

_oddDisplayManager30

private static final MainFrame.OddDisplayManager _oddDisplayManager30

_djProjectIcon

private static final Icon _djProjectIcon

_navPaneDisplayManager

private final DisplayManager<INavigatorItem> _navPaneDisplayManager
This is what is given to the JTreeSortNavigator. This simply resolves the INavItem to an OpenDefDoc using the model and forwards it to the OddDisplayManager for size 20.


_historyListener

public KeyListener _historyListener
These listeners support the traversal operations that cycle through recent documents.


_focusListenerForRecentDocs

public FocusListener _focusListenerForRecentDocs

_undoRedoDefinitionsFocusListener

public final FocusListener _undoRedoDefinitionsFocusListener

_hourglassNestLevel

private volatile int _hourglassNestLevel

_allowKeyEvents

private volatile boolean _allowKeyEvents

_completeClassSet

HashSet<MainFrameStatics.GoToFileListEntry> _completeClassSet
List with entries for the complete dialog.


_autoImportClassSet

HashSet<MainFrameStatics.JavaAPIListEntry> _autoImportClassSet
List with entries for the auto-import dialog.


_updateLock

private volatile Object _updateLock

_tabUpdatePending

private volatile boolean _tabUpdatePending

_waitAgain

private volatile boolean _waitAgain

_pendingUpdate

private volatile Runnable _pendingUpdate

_pendingDocument

private volatile OpenDefinitionsDocument _pendingDocument

_firstRegion

private volatile OrderedDocumentRegion _firstRegion

_lastRegion

private volatile OrderedDocumentRegion _lastRegion

UPDATE_DELAY

public static long UPDATE_DELAY

UPDATER_PRIORITY

public static int UPDATER_PRIORITY

FIND_ICON

public static final Icon FIND_ICON

dropTarget

DropTarget dropTarget
Drag and drop target.


uriListFlavor

private static DataFlavor uriListFlavor
Linux URI drag-and-drop data flavor.


_autoImportDialog

PredictiveInputFrame<MainFrameStatics.JavaAPIListEntry> _autoImportDialog
The "Auto Import" dialog instance.


_autoImportPackageCheckbox

JCheckBox _autoImportPackageCheckbox

_followFileAction

private final Action _followFileAction
Follow a file.


_executeExternalProcessAction

private final Action _executeExternalProcessAction
Execute an external process.


_executeExternalDialog

private volatile ExecuteExternalDialog _executeExternalDialog
The execute external dialog.


_editExternalDialog

private volatile EditExternalDialog _editExternalDialog
The edit external dialog.


_editExternalProcessesAction

private final Action _editExternalProcessesAction
Action that edits saved processes. Only runs in the event thread.

Constructor Detail

MainFrame

public MainFrame()
Creates the main window, and shows it.

Method Detail

getSourceFileFilter

private FileFilter getSourceFileFilter()
Returns:
the source file filter as directed by the currently selected compiler.

getSuggestedFileExtension

private String getSuggestedFileExtension()
Return the suggested file extension that will be appended to a file without extension.

Returns:
the suggested file extension

proposeBetterFileName

private File proposeBetterFileName(File f)
Returns:
possibly renamed file, if it used an old LL extension and the user wanted it.

_newJavaClass

public void _newJavaClass()

initJarOptionsDialog

private void initJarOptionsDialog()
Initializes the "Create Jar from Project" dialog.


resetJarOptionsDialogPosition

public void resetJarOptionsDialogPosition()
Reset the position of the "Create Jar from Project" dialog.


initTabbedPanesFrame

private void initTabbedPanesFrame()
Initializes the "Tabbed Panes" frame.


resetTabbedPanesFrame

public void resetTabbedPanesFrame()
Reset the position of the "Tabbed Panes" dialog.


initDebugFrame

private void initDebugFrame()
Initializes the "Debugger" frame.


resetDebugFrame

public void resetDebugFrame()
Reset the position of the "Debugger" dialog.


getLastChangeTime

public long getLastChangeTime()
Returns the changed status of the MainFrame.


pack

public void pack()
Ensures that pack() is run in the event thread. Only used in test code

Overrides:
pack in class Window

packHelp

private void packHelp()
Helper method that provides access to super.pack() within the anonymous class new Runnable() {...} above


isSaveEnabled

public boolean isSaveEnabled()
Supports MainFrameTest.


lostOwnership

public void lostOwnership(Clipboard clipboard,
                          Transferable contents)
We lost ownership of what we put in the clipboard.

Specified by:
lostOwnership in interface ClipboardOwner

resetClipboardHistoryDialogPosition

public void resetClipboardHistoryDialogPosition()
Reset the position of the "Clipboard History" dialog.


_showFindReplaceTab

private void _showFindReplaceTab(boolean showDetachedWindow)
Shows the find/replace tab in the interactions pane. Only executes in the event thread.


resetGotoFileDialogPosition

public void resetGotoFileDialogPosition()
Reset the position of the "Go to File" dialog.


initGotoFileDialog

void initGotoFileDialog()
Initialize dialog if necessary.


_gotoFileUnderCursor

void _gotoFileUnderCursor()
Goes to the file specified by the word the cursor is on.


gotoFileMatchingMask

public void gotoFileMatchingMask(String mask)
Goes to the file matching the specified mask.

Parameters:
mask - word specifying the file to go to

resetOpenJavadocDialogPosition

public void resetOpenJavadocDialogPosition()
Reset the position of the "Open Javadoc" dialog.


initOpenJavadocDialog

void initOpenJavadocDialog()
Initialize dialog if necessary. Should NOT be called in the event thread. ???


_generateJavaAPISet

public static Set<MainFrameStatics.JavaAPIListEntry> _generateJavaAPISet(String base,
                                                                         String stripPrefix,
                                                                         String suffix)
Generate Java API class list.


_generateJavaAPISet

public static Set<MainFrameStatics.JavaAPIListEntry> _generateJavaAPISet(String base,
                                                                         String stripPrefix,
                                                                         URL url)
Generate Java API class list.


getCompleteClassSet

public Set<MainFrameStatics.GoToFileListEntry> getCompleteClassSet()
Returns:
the set of all classes, scanned after the last compile.

clearCompleteClassSet

public void clearCompleteClassSet()
Clear the set of all classes.


clearJavaAPISet

public void clearJavaAPISet()
Clears the Java API class set.


getJavaAPISet

public Set<MainFrameStatics.JavaAPIListEntry> getJavaAPISet()
Returns:
the Java API class set.

generateJavaAPISet

public void generateJavaAPISet()
Generate Java API class list.


_openJavadocUnderCursor

private void _openJavadocUnderCursor()
Opens the Javadoc specified by the word the cursor is on. Only executes in the event thread.


initCompleteWordDialog

private void initCompleteWordDialog()
Initialize the "Complete Word" dialog.


_completeWordUnderCursor

private void _completeWordUnderCursor()
Complete the word the cursor is on. Only executes in the event thread.


resetCompleteWordDialogPosition

public void resetCompleteWordDialogPosition()

_saveConsoleCopy

public void _saveConsoleCopy(ConsoleDocument doc)
Saves a copy of either the console or the interactions pane to a file.


_saveDocumentCopy

public void _saveDocumentCopy(SwingDocument doc)
Saves a copy of an error pane to a file.


_doResetInteractions

private void _doResetInteractions()

viewInteractionsClassPath

public void viewInteractionsClassPath()
Displays the interactions classpath.


_switchToPane

private void _switchToPane(Component c)
This takes a component and gives it focus, showing it if it's a tab. The interactionsPane and consolePane are wrapped in scrollpanes, so we have to specifically check for those and unwrap them.

Parameters:
c - the pane to switch focus to

_switchPaneFocus

private void _switchPaneFocus(boolean next)
This method allows the user to cycle through the definitions pane and all of the open tabs.

Parameters:
next - true if we want to go to the next pane, false if the previous.

editPreferences

public void editPreferences()

setAutomaticTraceMenuItemStatus

public void setAutomaticTraceMenuItemStatus()

toggleBookmark

public void toggleBookmark()
Toggle a bookmark.


addToBrowserHistory

public void addToBrowserHistory()
Add the current location to the browser history.


addToBrowserHistoryBefore

public void addToBrowserHistoryBefore()
Add the current location to the browser history before the current region.


createFindResultsPanel

public FindResultsPanel createFindResultsPanel(RegionManager<MovingDocumentRegion> rm,
                                               MovingDocumentRegion region,
                                               String title,
                                               String searchString,
                                               boolean searchAll,
                                               boolean searchSelectionOnly,
                                               boolean matchCase,
                                               boolean wholeWord,
                                               boolean noComments,
                                               boolean noTestCases,
                                               WeakReference<OpenDefinitionsDocument> doc,
                                               FindReplacePanel findReplace)
Create a new find results tab.

Parameters:
rm - the region manager that will contain the regions
title - the title for the panel
searchString - string that was searched for
searchAll - whether all files were searched
doc - weak reference to document in which search occurred (or started, if all documents were searched)
findReplace - the FindReplacePanel that created this FindResultsPanel
Returns:
new find results tab.

disableFindAgainOnClose

void disableFindAgainOnClose(List<OpenDefinitionsDocument> projDocs)
Disable "Find Again" on "Find All" tabs that use a document that was closed.


showFindResultsPanel

public void showFindResultsPanel(FindResultsPanel panel)
Action that shows a find results tab. Only runs in event thread.


_getBeginLinePos

private int _getBeginLinePos()
Returns the "intelligent" beginning of line. If the caret is to fhe right of the first non-whitespace character, the position of the first non-whitespace character is returned. If the caret is on or to the left of the first non-whitespace character, the beginning of the line is returned.


_closeInteractionsScript

private void _closeInteractionsScript()
Closes the currently executing interactions script, if there is one.


getFileDisplayManager20

public static MainFrame.DJFileDisplayManager getFileDisplayManager20()

getFileDisplayManager30

public static MainFrame.DJFileDisplayManager getFileDisplayManager30()

getOddDisplayManager20

public static MainFrame.OddDisplayManager getOddDisplayManager20()

getOddDisplayManager30

public static MainFrame.OddDisplayManager getOddDisplayManager30()

getNavPaneDisplayManager

public DisplayManager<INavigatorItem> getNavPaneDisplayManager()

setVisible

public void setVisible(boolean b)
Overrides:
setVisible in class Window

setUpDrJavaProperties

public void setUpDrJavaProperties()
This method sets up all the DrJava properties that can be used as variables in external process command lines.


refreshBreakpointHighlightPainter

void refreshBreakpointHighlightPainter()
Sets up new painters for existing breakpoint highlights.


refreshBookmarkHighlightPainter

void refreshBookmarkHighlightPainter()
Sets new painters for existing bookmark highlights.


refreshFindResultsHighlightPainter

void refreshFindResultsHighlightPainter(FindResultsPanel panel,
                                        LayeredHighlighter.LayerPainter painter)
Set new painter for existing find results highlights.


makeFolderChooser

private DirectoryChooser makeFolderChooser(File workDir)
Creates the folder chooser during MainFrame initialization which does not run in event thread.


setUpKeys

private void setUpKeys()
Sets up the ctrl-tab listener.


dispose

public void dispose()
Clean up model and Swing resources.

Overrides:
dispose in class Window

getModel

public SingleDisplayModel getModel()
Returns:
The model providing the logic for this view.

getInteractionsPane

InteractionsPane getInteractionsPane()
Returns the frame's interactions pane. (Package private accessor)


getInteractionsController

InteractionsController getInteractionsController()
Returns the frame's interactions controller. (Package private accessor)


getCloseButton

JButton getCloseButton()
Returns:
The frame's close button (Package private accessor).

getCompileAllButton

JButton getCompileAllButton()
For testing purposes.

Returns:
The frame's compileAll button (Package private accessor)

hourglassOn

public void hourglassOn()
Make the cursor an hourglass. Only runs in the event thread.


hourglassOff

public void hourglassOff()
Return the cursor to normal. Only runs in the event thread.


setAllowKeyEvents

public void setAllowKeyEvents(boolean a)

getAllowKeyEvents

public boolean getAllowKeyEvents()

debuggerToggle

public void debuggerToggle()
Toggles whether the debugger is enabled or disabled, and updates the display accordingly. Only runs in the event thread.


showDebugger

public void showDebugger()
Display the debugger tab and update the Debug menu accordingly.


hideDebugger

public void hideDebugger()
Hide the debugger tab and update the Debug menu accordingly.


_showDebuggerPanel

private void _showDebuggerPanel()

_hideDebuggerPanel

private void _hideDebuggerPanel()

updateStatusField

public void updateStatusField(String text)
ONLY executes in event thread.


updateStatusField

public void updateStatusField()
Updates the status field with the current status of the Definitions Pane.


getOpenFiles

public File[] getOpenFiles(JFileChooser jfc)
                    throws OperationCanceledException
Prompt the user to select a place to open files from, then load them. Ask the user if they'd like to save previous changes (if the current document has been modified) before opening.

Parameters:
jfc - the open dialog from which to extract information
Returns:
an array of the files that were chosen
Throws:
OperationCanceledException

getSaveFile

public File getSaveFile(JFileChooser jfc)
                 throws OperationCanceledException
Prompt the user to select a place to save the current document.

Throws:
OperationCanceledException

getCurrentDefPane

public DefinitionsPane getCurrentDefPane()
Returns the current DefinitionsPane.


getCompilerErrorPanel

public CompilerErrorPanel getCompilerErrorPanel()
Returns the compiler error panel.


getJUnitPanel

public JUnitPanel getJUnitPanel()
Returns the JUnit error panel.


getJavadocErrorPanel

public JavadocErrorPanel getJavadocErrorPanel()
Returns the javadoc error panel.


getSelectedErrorPanel

public CompilerErrorPanel getSelectedErrorPanel()
Returns the currently shown error panel if there is one. Otherwise returns null.


isCompilerTabSelected

public boolean isCompilerTabSelected()
Returns whether the compiler output tab is currently showing.


isTestTabSelected

public boolean isTestTabSelected()
Returns whether the test output tab is currently showing.


isJavadocTabSelected

public boolean isJavadocTabSelected()
Returns whether the JavaDoc output tab is currently showing.


_installNewDocumentListener

private void _installNewDocumentListener(OpenDefinitionsDocument d)
Makes sure save and compile buttons and menu items are enabled and disabled appropriately after document modifications.


setStatusMessage

public void setStatusMessage(String msg)
Changes the message text toward the right of the status bar

Parameters:
msg - The message to place in the status bar

clearStatusMessage

public void clearStatusMessage()
Sets the message text in the status bar to the null string.


setStatusMessageFont

public void setStatusMessageFont(Font f)
Sets the font of the status bar message

Parameters:
f - The new font of the status bar message

setStatusMessageColor

public void setStatusMessageColor(Color c)
Sets the color of the text in the status bar message

Parameters:
c - The color of the text

_processDocs

private void _processDocs(Collection<OpenDefinitionsDocument> docs,
                          Runnable1<OpenDefinitionsDocument> op)
Performs op on each document in docs and invalidates the various project file collection properties.


_moveToAuxiliary

void _moveToAuxiliary()

_removeAuxiliary

private void _removeAuxiliary()
Removes selected auxiliary files.


_moveAllToAuxiliary

void _moveAllToAuxiliary()
Converts all external files to auxiliary files.


_removeAllAuxiliary

private void _removeAllAuxiliary()
Converts all auxiliary files to external files.


_new

private void _new()

_open

private void _open()

_openFolder

private void _openFolder()

_openFileOrProject

private void _openFileOrProject()

_putTextIntoDefinitions

private void _putTextIntoDefinitions(String text)
Puts the given text into the current definitions pane at the current caret position.


_resetNavigatorPane

private void _resetNavigatorPane()
Sets the left navigator pane to the correct component as dictated by the model.


_openProject

private void _openProject()
Asks the user to select the project file to open and starts the process of opening the project.


openProject

public void openProject(FileOpenSelector projectSelector)

_openProjectHelper

private void _openProjectHelper(File projectFile)
Oversees the opening of the project by delegating to the model to parse and initialize the project while resetting the navigator pane and opening up the files itself.

Parameters:
projectFile - the file of the project to open

_setUpProjectButtons

private void _setUpProjectButtons(File projectFile)

_openProjectUpdate

private void _openProjectUpdate()

closeProject

boolean closeProject()
Closes project when DrJava is not in the process of quitting.

Returns:
true if the project is closed, false if cancelled.

_closeProject

boolean _closeProject()

_closeProject

boolean _closeProject(boolean quitting)
Saves the project file; closes all open project files; and calls _model.closeProject(quitting) the clean up the state of the global model. It also restores the list view navigator

Parameters:
quitting - whether the project is being closed as part of quitting DrJava
Returns:
true if the project is closed, false if cancelled

_configureBrowsing

private void _configureBrowsing()

_checkProjectClose

private boolean _checkProjectClose()

getCurrentProject

public File getCurrentProject()

open

public void open(FileOpenSelector openSelector)
Opens all the files returned by the FileOpenSelector prompting the user to handle the cases where files are already open, files are missing, or the action was canceled by the user

Parameters:
openSelector - the selector that returns the files to open

openFolder

public void openFolder(DirectoryChooser chooser)
Opens all the files in the directory returned by the FolderSelector.

Parameters:
chooser - the selector that returns the files to open TODO: change the dialog title to give the current path rather than "..."

_openFolder

private void _openFolder(File dir,
                         boolean rec,
                         String ext)
Opens all the files in the specified directory; it opens all files in nested folders if rec is true.

Parameters:
dir - the specified directory
rec - true if files in nested folders should be opened
ext - extension

_close

private void _close()
Closes the active document. The user is queried in some cases.


_closeFolder

private void _closeFolder()

_printDefDoc

private void _printDefDoc()

_printConsole

private void _printConsole()

_printInteractions

private void _printInteractions()

_printDefDocPreview

private void _printDefDocPreview()
Opens a new PrintPreview frame.


_printConsolePreview

private void _printConsolePreview()

_printInteractionsPreview

private void _printInteractionsPreview()

_pageSetup

private void _pageSetup()

closeAll

void closeAll()

_closeAll

private void _closeAll()

_save

private boolean _save()

_saveAs

private boolean _saveAs()

_saveCopy

private boolean _saveCopy()

_rename

private boolean _rename()

_saveAll

void _saveAll()

_saveAllOld

void _saveAllOld()

saveProject

void saveProject()

_saveProject

private void _saveProject()

_editProject

private void _editProject()
Edits project frame. Only runs in the event thread.


_newProject

private void _newProject()
Closes all files and makes a new project.


_saveProjectAs

private boolean _saveProjectAs()
Pops up the _saveChooser dialog, asks the user for a new project file name, and sets the project file to the specified file. Nothing is written in the file system; this action is performed by a subsequent _saveAll().

Returns:
false if the user canceled the action

_saveProjectHelper

void _saveProjectHelper(File file)

gatherProjectDocInfo

public HashMap<OpenDefinitionsDocument,DocumentInfoGetter> gatherProjectDocInfo()

_makeInfoGetter

private DocumentInfoGetter _makeInfoGetter(OpenDefinitionsDocument doc)
Gets the information to be saved for a project document. Implementation may change if the scroll/selection information is later stored in a place other than the definitions pane. Hopefully this info will eventually be backed up in the OpenDefinitionsDocument in which case all this code should be refactored into the model's _saveProject method


_revert

private void _revert()

_revert

private void _revert(OpenDefinitionsDocument doc)

quit

void quit()
private void _revertAll() { try { _model.revertAllFiles(); } catch (FileMovedException fme) { _showFileMovedError(fme); } catch (IOException ioe) { MainFrameStatics.showIOError(MainFrame.this, ioe); } }


_updateSavedConfiguration

void _updateSavedConfiguration()

_forceQuit

private void _forceQuit()

_storePositionInfo

private void _storePositionInfo()
Stores the current position and size info for window and panes to the config framework. Only runs in the event thread.


_cleanUpDebugger

private void _cleanUpDebugger()

_compile

private void _compile()

_compileFolder

private void _compileFolder()

_compileProject

private void _compileProject()

_compileAll

private void _compileAll()

showCleanWarning

private boolean showCleanWarning()

_clean

private void _clean()

_scanClassFiles

private void _scanClassFiles()
Scan the build directory for class files and update the auto-completion list.


_runProject

private void _runProject()

_runMain

private void _runMain()
Internal helper method to run the main method of the current document in the interactions pane.


_runApplet

private void _runApplet()
Internal helper method to run the current document as applet in the interactions pane.


_junit

private void _junit()

_junitFolder

private void _junitFolder()

_junitProject

private void _junitProject()
Tests the documents in the project source tree. Assumes that DrJava is in project mode.


_junitAll

private void _junitAll()
Tests all open documents.


debuggerResume

void debuggerResume()
              throws DebugException
Resumes the debugger's current execution.

Throws:
DebugException

debuggerAutomaticTrace

void debuggerAutomaticTrace()
Automatically traces through the entire program with a defined rate for stepping into each line of code


enableAutomaticTrace

private void enableAutomaticTrace()
Enable automatic trace. Assumes that the debugger is ready.


disableAutomaticTrace

private void disableAutomaticTrace()
Disable the automatic trace. Assumes that the debugger is ready.


debuggerStep

void debuggerStep(Debugger.StepType type)
Steps in the debugger.


debuggerToggleBreakpoint

void debuggerToggleBreakpoint()
Toggles a breakpoint on the current line.


debuggerClearAllBreakpoints

void debuggerClearAllBreakpoints()
Clears all breakpoints from the debugger.


_showFileMovedError

void _showFileMovedError(FileMovedException fme)

_showProjectFileParseError

void _showProjectFileParseError(MalformedProjectFileException mpfe)

_showFileNotFoundError

void _showFileNotFoundError(FileNotFoundException fnf)

_showIOError

void _showIOError(IOException ioe)

_showClassNotFoundError

void _showClassNotFoundError(ClassNotFoundException cnfe)

_showNoClassDefError

void _showNoClassDefError(NoClassDefFoundError ncde)

_showDebugError

void _showDebugError(DebugException de)

_showJUnitInterrupted

void _showJUnitInterrupted(UnexpectedException e)

_showJUnitInterrupted

void _showJUnitInterrupted(String message)

_showError

void _showError(Throwable e,
                String title,
                String message)

_showWarning

void _showWarning(Throwable e,
                  String title,
                  String message)

_showConfigException

private void _showConfigException()
Check if any errors occurred while parsing the config file, and display a message if necessary.


getChosenFile

private File getChosenFile(JFileChooser fc,
                           int choice,
                           File previous,
                           boolean addSourceFileExtension)
                    throws OperationCanceledException
Returns the File selected by the JFileChooser.

Parameters:
fc - File chooser presented to the user
choice - return value from fc
previous - previous file (or null if none)
addSourceFileExtension - whether .java (or another appropriate extension) should be added to files without extension
Returns:
Selected File
Throws:
OperationCanceledException - if file choice canceled
RuntimeException - if fc returns a bad file or choice

getChosenFiles

private File[] getChosenFiles(JFileChooser fc,
                              int choice)
                       throws OperationCanceledException
Returns the Files selected by the JFileChooser.

Parameters:
fc - File chooser presented to the user
choice - return value from fc
Returns:
Selected Files - this array will be size 1 for single-selection dialogs.
Throws:
OperationCanceledException - if file choice canceled
RuntimeException - if fc returns a bad file or choice

_selectAll

private void _selectAll()

_jumpToLine

public int _jumpToLine(int lineNum)
Jump to the specified line and return the offset. Only runs in event thread.

Returns:
offset

_gotoLine

private int _gotoLine()
Ask the user what line they'd like to jump to, then go there.


_removeErrorListener

private void _removeErrorListener(OpenDefinitionsDocument doc)
Removes the ErrorCaretListener corresponding to the given document, after that document has been closed. (Allows pane and listener to be garbage collected...)


_addGUIAvailabilityListener

void _addGUIAvailabilityListener(Action a,
                                 GUIAvailabilityListener.ComponentType... components)

_addGUIAvailabilityListener

void _addGUIAvailabilityListener(Component a,
                                 GUIAvailabilityListener.ComponentType... components)

_displayGUIComponentAvailabilityFrame

void _displayGUIComponentAvailabilityFrame()

_setUpGUIComponentAvailability

private void _setUpGUIComponentAvailability()
Initialize the availability of GUI components. When JUnit is running, the compiler or Javadoc should not be invoked (Javadoc may invoke the compiler).


_setUpActions

private void _setUpActions()
Initializes all action objects. Adds icons and descriptions to several of the actions. Note: this initialization will later be done in the constructor of each action, which will subclass AbstractAction.


_setUpAction

private void _setUpAction(Action a,
                          String name,
                          String icon,
                          String longDesc)

_setUpAction

private void _setUpAction(Action a,
                          String icon,
                          String shortDesc)

_getIcon

private ImageIcon _getIcon(String name)
Returns the icon with the given name. All icons are assumed to reside in the /edu/rice/cs/drjava/ui/icons directory.

Parameters:
name - Name of icon image file
Returns:
ImageIcon object constructed from the file

getIcon

public static ImageIcon getIcon(String name)

addMenuBarInOtherFrame

public void addMenuBarInOtherFrame(JMenuBar menuBar)

removeMenuBarInOtherFrame

public void removeMenuBarInOtherFrame(JMenuBar menuBar)

_setUpMenuBar

void _setUpMenuBar(JMenuBar menuBar)
Sets up the components of the menu bar and links them to the private fields within MainFrame. This method serves to make the code more legible on the higher calling level, i.e., the constructor.


_setUpMenuBar

void _setUpMenuBar(JMenuBar menuBar,
                   JMenu fileMenu,
                   JMenu editMenu,
                   JMenu toolsMenu,
                   JMenu projectMenu,
                   JMenu debugMenu,
                   JMenu languageLevelMenu,
                   JMenu helpMenu)

_addMenuItem

private JMenuItem _addMenuItem(JMenu menu,
                               Action a,
                               VectorOption<KeyStroke> opt,
                               boolean updateKeyboardManager)
Adds an Action as a menu item to the given menu, using the specified configurable keystroke.

Parameters:
menu - Menu to add item to
a - Action for the menu item
opt - Configurable keystroke for the menu item
updateKeyboardManager - true if the keyboard manager should be updated; pass true only for MainFrame!
Returns:
the added menu item

_addMenuItem

private JMenuItem _addMenuItem(JMenu menu,
                               Action a,
                               VectorOption<KeyStroke> opt,
                               int index,
                               boolean updateKeyboardManager)
Inserts an Action as a menu item to the given menu, at the specified index, using the specified configurable keystroke.

Parameters:
menu - Menu to add item to
a - Action for the menu item
opt - Configurable keystroke for the menu item
index - Index at which the action is inserted
updateKeyboardManager - true if the keyboard manager should be updated; pass true only for MainFrame!
Returns:
the added menu item

_setMenuShortcut

private void _setMenuShortcut(JMenuItem item,
                              Action a,
                              VectorOption<KeyStroke> opt,
                              boolean updateKeyboardManager)
Sets the given menu item to have the specified configurable keystroke.

Parameters:
item - Menu item containing the action
a - Action for the menu item
opt - Configurable keystroke for the menu item
updateKeyboardManager - true if the keyboard manager should be updated; pass true only for MainFrame!

_setUpFileMenu

private JMenu _setUpFileMenu(int mask,
                             boolean updateKeyboardManager)
Creates and returns a file menu. Side effects: sets values for _saveMenuItem.

Parameters:
mask - the keystroke modifier to be used
updateKeyboardManager - true if the keyboard manager should be updated; pass true only for MainFrame!

_setUpEditMenu

private JMenu _setUpEditMenu(int mask,
                             boolean updateKeyboardManager)
Creates and returns a edit menu.

Parameters:
mask - the keystroke modifier to be used
updateKeyboardManager - true if the keyboard manager should be updated; pass true only for MainFrame!

_setUpToolsMenu

private JMenu _setUpToolsMenu(int mask,
                              boolean updateKeyboardManager)
Creates and returns a tools menu.

Parameters:
mask - the keystroke modifier to be used
updateKeyboardManager - true if the keyboard manager should be updated; pass true only for MainFrame!

_setUpProjectMenu

private JMenu _setUpProjectMenu(int mask,
                                boolean updateKeyboardManager)
Creates and returns a project menu

Parameters:
mask - the keystroke modifier to be used
updateKeyboardManager - true if the keyboard manager should be updated; pass true only for MainFrame!

_setUpDebugMenu

private JMenu _setUpDebugMenu(int mask,
                              boolean updateKeyboardManager)
Creates and returns a debug menu.

Parameters:
mask - the keystroke modifier to be used
updateKeyboardManager - true if the keyboard manager should be updated; pass true only for MainFrame!

_setDebugMenuItemsEnabled

private void _setDebugMenuItemsEnabled(boolean isEnabled)
Called every time the debug mode checkbox is toggled. The resume and step functions should always be disabled.


_setThreadDependentDebugMenuItems

private void _setThreadDependentDebugMenuItems(boolean isSuspended)
Enables and disables the appropriate menu items in the debug menu depending upon the state of the current thread.

Parameters:
isSuspended - is true when the current thread has just been suspended false if the current thread has just been resumed

_setUpLanguageLevelMenu

private JMenu _setUpLanguageLevelMenu(int mask,
                                      boolean updateKeyboardManager)
Creates and returns the language levels menu.

Parameters:
mask - the keystroke modifier to be used
updateKeyboardManager - true if the keyboard manager should be updated; pass true only for MainFrame!

_setUpHelpMenu

private JMenu _setUpHelpMenu(int mask,
                             boolean updateKeyboardManager)
Creates and returns a help menu.

Parameters:
mask - the keystroke modifier to be used
updateKeyboardManager - true if the keyboard manager should be updated; pass true only for MainFrame!

_createManualToolbarButton

JButton _createManualToolbarButton(Action a)
Creates a toolbar button for undo and redo, which behave differently.


_createToolbarButton

public JButton _createToolbarButton(Action a)
Sets up all buttons for the toolbar except for undo and redo, which use _createManualToolbarButton.


_updateToolbarButton

public JButton _updateToolbarButton(JButton b,
                                    Action a)
Removes the button b from the toolbar and creates new button in its place. Only runs in the event thread.


_setUpToolBar

private void _setUpToolBar()
Sets up the toolbar with several useful buttons. Most buttons are always enabled, but those that are not are maintained in fields to allow enabling and disabling.


_updateToolBarVisible

private void _updateToolBarVisible()
Sets the toolbar as either visible or invisible based on the config option. Only runs in the event thread.


_updateToolbarButtons

private void _updateToolbarButtons()
Update the toolbar's buttons, following any change to TOOLBAR_ICONS_ENABLED, TOOLBAR_TEXT_ENABLED, or FONT_TOOLBAR (name, style, text)


_fixToolbarHeights

private void _fixToolbarHeights()
Ensures that all toolbar buttons have the same height.


_setUpStatusBar

private void _setUpStatusBar()
Sets up the status bar with the filename field. Only called from MainFrame constructor.


_setUpTabs

private void _setUpTabs()

start

public void start()
Realizes this MainFrame by setting it visibile and configures the tabbed Pane. Only runs in the event thread.


_setUpContextMenus

private void _setUpContextMenus()
Sets up the context menu to show in the document pane.


nextRecentDoc

private void nextRecentDoc()

prevRecentDoc

private void prevRecentDoc()

hideRecentDocFrame

private void hideRecentDocFrame()

isDisplayed

private static boolean isDisplayed(TabbedPanel p)

_createDefScrollPane

JScrollPane _createDefScrollPane(OpenDefinitionsDocument doc)
Create new DefinitionsPane and JScrollPane for an open definitions document. Package private for testing purposes.

Parameters:
doc - The open definitions document to wrap
Returns:
JScrollPane containing a DefinitionsPane for the given document.

maxInterval

private static <R extends OrderedDocumentRegion> Pair<R,R> maxInterval(Pair<R,R> i,
                                                                       Pair<R,R> j)

_setUpPanes

private void _setUpPanes()

_switchDefScrollPane

void _switchDefScrollPane()
Switch to the JScrollPane containing the DefinitionsPane for the active document. Must run in event thread.


_refreshDefScrollPane

private void _refreshDefScrollPane()
Refresh the JScrollPane containing the DefinitionsPane for the active document. Must run in event thread.


resetUndo

public void resetUndo()
Resets the undo/redo menu items


getDefPaneGivenODD

public DefinitionsPane getDefPaneGivenODD(OpenDefinitionsDocument doc)

_reenableScrollBar

private void _reenableScrollBar()
Addresses Mac OS X bug where the scrollbars are disabled in one document after opening another.


_getFullFile

private File _getFullFile(File f)
                   throws IOException
Gets the absolute file, or if necessary, the canonical file.

Parameters:
f - the file for which to get the full path
Returns:
the file representing the full path to the given file
Throws:
IOException

_setCurrentDirectory

private void _setCurrentDirectory(File file)
Sets the current directory to be that of the given file.


_setCurrentDirectory

private void _setCurrentDirectory(OpenDefinitionsDocument doc)
Sets the current directory to be that of document's file.


_setMainFont

private void _setMainFont()
Sets the font of all panes and panels to the main font.


_updateNormalColor

private void _updateNormalColor()
Updates the text color for the doc list.


_updateBackgroundColor

private void _updateBackgroundColor()
Updates the background color for the doc list.


_updateLineNums

private void _updateLineNums()
Updates the font and colors of the line number display.


_repaintLineNums

private void _repaintLineNums()
Repaints the line numbers on the active scroll pane.


_updateDefScrollRowHeader

private void _updateDefScrollRowHeader()
Update the row header (line number enumeration) for the definitions scroll pane.


removeCurrentLocationHighlight

public void removeCurrentLocationHighlight()
Removes the current highlight.


_disableStepTimer

private void _disableStepTimer()
Disable any step timer.


_updateDebugStatus

private void _updateDebugStatus()
Checks if debugPanel's status bar displays the DEBUGGER_OUT_OF_SYNC message but the current document is in sync. Clears the debugPanel's status bar in this case. Does not assume that frame is in debug mode. Must be executed in event thread.


_disableInteractionsPane

protected void _disableInteractionsPane()
Ensures that the interactions pane is not editable during an interaction.


_enableInteractionsPane

protected void _enableInteractionsPane()
Ensures that the interactions pane is editable after an interaction completes.


commentLines

public void commentLines()
Comment current selection using wing commenting. public for testing purposes only. Runs in event thread.


uncommentLines

public void uncommentLines()
Uncomment current selection using wing commenting. Public for testing purposes only. Runs in event thread.


scrollToDocumentAndOffset

public void scrollToDocumentAndOffset(OpenDefinitionsDocument doc,
                                      int offset,
                                      boolean shouldHighlight)
Called when a specific document and offset should be displayed. Must be executed only in the event thread.

Parameters:
doc - Document to display
offset - Offset to display
shouldHighlight - true iff the line should be highlighted. Only done in debugger.

goToRegionAndHighlight

public void goToRegionAndHighlight(IDocumentRegion r)

scrollToDocumentAndOffset

public void scrollToDocumentAndOffset(OpenDefinitionsDocument doc,
                                      int offset,
                                      boolean shouldHighlight,
                                      boolean shouldAddToHistory)
Called when a specific document and offset should be displayed. Must be executed only in the event thread.

Parameters:
doc - Document to display
offset - Offset to display
shouldHighlight - true iff the line should be highlighted.
shouldAddToHistory - true if the location before and after the switch should be added to the browser history

isProjectActiveAndMainClassSet

boolean isProjectActiveAndMainClassSet()
Returns:
true if a project is active and a valid main class is set.

isProjectActiveAndBuildDirSet

boolean isProjectActiveAndBuildDirSet()
Returns:
true if a project is active and a valid main class is set.

askToIncreaseSlaveMaxHeap

void askToIncreaseSlaveMaxHeap()
Ask the user to increase the slave's max heap setting.


askToIncreaseMasterMaxHeap

void askToIncreaseMasterMaxHeap()
Ask the user to increase the master's max heap setting.


projectRunnableChanged

public void projectRunnableChanged()

getDefViewport

public JViewport getDefViewport()

removeTab

public void removeTab(Component c)

showBookmarks

public void showBookmarks()
Adds the bookmarks panel to the tabbed pane and shows it.


showBreakpoints

public void showBreakpoints()
Adds the breakpoints panel to the tabbed pane and shows it.


_createTab

private void _createTab(TabbedPanel panel)

showTab

public void showTab(Component c,
                    boolean showDetachedWindow)
Shows the components passed in the appropriate place in the tabbedPane depending on the position of the component in the _tabs list. Only runs in the event thread.

Parameters:
c - the component to show in the tabbedPane
showDetachedWindow - true if the "Detached Panes" window should be shown

_warnFileOpen

private boolean _warnFileOpen(File f)
Warns the user that the current file is open and query them if they wish to save over the currently open file.


_verifyOverwrite

private boolean _verifyOverwrite(File f)
Confirms with the user that the file should be overwritten.

Parameters:
f - file to overwrite
Returns:
true iff the user accepts overwriting.

_resetJUnit

private void _resetJUnit()

_junitInterrupted

private void _junitInterrupted(UnexpectedException e)

_junitInterrupted

private void _junitInterrupted(String message)

isDebuggerReady

boolean isDebuggerReady()

isDebuggerEnabled

boolean isDebuggerEnabled()

getFindReplaceDialog

FindReplacePanel getFindReplaceDialog()
Return the find replace dialog. Package protected for use in tests.


_setUpKeyBindingMaps

private void _setUpKeyBindingMaps()
Builds the Hashtables in KeyBindingManager that record key-bindings and support live updating, conflict resolution, and intelligent error messages (the ActionToNameMap). IMPORTANT: Don't use this mechanism to put an action into the KeyBindingManager if the action is a menu item because menu actions are already included. Putting in again will cause bug #803304 "Uncomment lines wont rebind".


addComponentListenerToOpenDocumentsList

public void addComponentListenerToOpenDocumentsList(ComponentListener listener)
Parameters:
listener - The ComponentListener to add to the open documents list This method allows for testing of the dancing UI (See MainFrameTest.testDancingUI()).

getFileNameField

public String getFileNameField()
For test purposes only. Returns the text in the status bar. Is used to test brace matching


getEditMenu

public JMenu getEditMenu()
For test purposes only. Returns the edit menu


setPopupLoc

public void setPopupLoc(Window popup)
Wrapper for setPopupLoc(Window, Component) that uses the window's owner as the owner to center the popup on.

Parameters:
popup - the Popup window

dragEnter

public void dragEnter(DropTargetDragEvent dropTargetDragEvent)
User dragged something into the component.

Specified by:
dragEnter in interface DropTargetListener

dragExit

public void dragExit(DropTargetEvent dropTargetEvent)
Specified by:
dragExit in interface DropTargetListener

dragOver

public void dragOver(DropTargetDragEvent dropTargetDragEvent)
Specified by:
dragOver in interface DropTargetListener

dropActionChanged

public void dropActionChanged(DropTargetDragEvent dropTargetDragEvent)
Specified by:
dropActionChanged in interface DropTargetListener

drop

public void drop(DropTargetDropEvent dropTargetDropEvent)
User dropped something on the component.

Specified by:
drop in interface DropTargetListener

openExtProcessFile

public static void openExtProcessFile(File file)
Open stand-alone external process file.


openExtProcessJarFile

public static void openExtProcessJarFile(File file)
Open external process file in a jar file.


textURIListToFileList

private static List<File> textURIListToFileList(String data)
Convert a string with URIs to a list of files.

Parameters:
data - string with URIs
Returns:
list of files

handleRemoteOpenFile

public void handleRemoteOpenFile(File f,
                                 int lineNo)
Handles an "open file" request, either from the remote control server or the operating system.

Parameters:
f - file to open
lineNo - line number to jump to, or -1 of not specified

resetAutoImportDialogPosition

public void resetAutoImportDialogPosition()
Reset the position of the "Open Javadoc" dialog.


_initAutoImportDialog

private void _initAutoImportDialog()
Initialize dialog if necessary.


_showAutoImportDialog

private void _showAutoImportDialog(String s)
Imports a class.


_followFile

private void _followFile()
Open a file for following (like using "less" and F). Only runs in the event thread.


_executeExternalProcess

private void _executeExternalProcess()
Execute an external process and monitor its output.


initExecuteExternalProcessDialog

private void initExecuteExternalProcessDialog()
Initializes the "Execute External Process" dialog.


resetExecuteExternalProcessPosition

public void resetExecuteExternalProcessPosition()
Reset the position of the "Execute External Process" dialog.


initEditExternalProcessDialog

private void initEditExternalProcessDialog()
Initializes the "Edit External Process" dialog.


resetEditExternalProcessPosition

public void resetEditExternalProcessPosition()
Reset the position of the "Edit External Process" dialog.


installModalWindowAdapter

public void installModalWindowAdapter(Window w,
                                      Runnable1<? super WindowEvent> toFrontAction,
                                      Runnable1<? super WindowEvent> closeAction)
Return the modal window listener if available, otherwise returns a non-modal dummy listener. Note that the WindowEvent passed to the toFrontAction runnable may not be the WindowEvent that caused the window w to be pushed off the front, it may also be the WindowEvent that restores w as front window after a modal dialog that trumped w was closed.

Parameters:
w - window trying to get the modal window listener
toFrontAction - action to be performed after the window has been moved to the front again
closeAction - action to be performed when the window is closing

removeModalWindowAdapter

public void removeModalWindowAdapter(Window w)
Removes the modal window adapter.

Parameters:
w - window releasing the modal window adapter