|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
edu.rice.cs.util.swing.SwingFrame
edu.rice.cs.drjava.ui.MainFrame
public class MainFrame
DrJava's main window.
Nested Class Summary | |
---|---|
static class |
MainFrame.GoToFileListEntry
Wrapper class for the "Go to File" and "Auto-Complete" dialog list entries. |
static class |
MainFrame.JavaAPIListEntry
Wrapper class for the "Open Javadoc" and "Auto Import" dialog list entries. |
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 | |
---|---|
protected Action |
_clearLineAction
Deletes text from the caret to the end of the current line. |
protected Action |
_cutLineAction
Cuts from the caret to the end of the current line to the clipboard. |
FocusListener |
_focusListenerForRecentDocs
|
KeyListener |
_historyListener
These listeners support the traversal operations that cycle through recent documents. |
Component |
_lastFocusOwner
|
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. |
Action |
_newFileFolderAction
Creates a new untitled, empty file in the current folder. |
JTabbedPane |
_tabbedPane
|
LinkedList<TabbedPanel> |
_tabs
|
static Icon |
FIND_ICON
|
static long |
UPDATE_DELAY
|
static int |
UPDATER_PRIORITY
|
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 | |
---|---|
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. |
protected void |
_enableInteractionsPane()
Ensures that the interactions pane is editable after an interaction completes. |
static List<MainFrame.JavaAPIListEntry> |
_generateJavaAPIList(String base,
String stripPrefix,
String suffix)
Generate Java API class list. |
int |
_jumpToLine(int lineNum)
Jump to the specified line and return the offset. |
JButton |
_updateToolbarButton(JButton b,
Action a)
Removes the button b from the toolbar and creates new button in its place. |
void |
addComponentListenerToOpenDocumentsList(ComponentListener listener)
|
void |
addToBrowserHistory()
Add the current location to the browser history. |
void |
clearStatusMessage()
Sets the message text in the status bar to the null string. |
void |
commentLines()
Comment current selection using wing commenting. |
void |
createBookmarks()
Adds the bookmarks panel to the tabbed pane. |
void |
createBreakpoints()
Adds the breakpoints panel to the tabbed pane. |
FindResultsPanel |
createFindResultsPanel(RegionManager<MovingDocumentRegion> rm,
String title,
String searchString,
boolean searchAll,
boolean matchCase,
boolean wholeWord,
boolean noComments,
boolean noTestCases,
WeakReference<OpenDefinitionsDocument> doc,
edu.rice.cs.drjava.ui.FindReplacePanel findReplace)
Create a new find results tab. |
void |
debuggerToggle()
Toggles whether the debugger is enabled or disabled, and updates the display accordingly. |
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 |
enableResetInteractions()
|
HashMap<OpenDefinitionsDocument,DocumentInfoGetter> |
gatherProjectDocInfo()
|
void |
generateJavaAPIList()
Generate Java API class list. |
boolean |
getAllowKeyEvents()
|
DefinitionsPane |
getCurrentDefPane()
Returns the current DefinitionsPane. |
File |
getCurrentProject()
|
DefinitionsPane |
getDefPaneGivenODD(OpenDefinitionsDocument doc)
|
JViewport |
getDefViewport()
|
JMenu |
getEditMenu()
For test purposes only. |
static edu.rice.cs.drjava.ui.MainFrame.DJFileDisplayManager |
getFileDisplayManager20()
|
static edu.rice.cs.drjava.ui.MainFrame.DJFileDisplayManager |
getFileDisplayManager30()
|
String |
getFileNameField()
For test purposes only. |
static ImageIcon |
getIcon(String name)
|
long |
getLastChangeTime()
Returns the changed status of the MainFrame. |
SingleDisplayModel |
getModel()
|
DisplayManager<INavigatorItem> |
getNavPaneDisplayManager()
|
static edu.rice.cs.drjava.ui.MainFrame.OddDisplayManager |
getOddDisplayManager20()
|
static edu.rice.cs.drjava.ui.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. |
ErrorPanel |
getSelectedErrorPanel()
Returns the currently shown error panel if there is one. |
void |
gotoFileMatchingMask(String mask)
Goes to the file matching the specified mask. |
void |
goToRegionAndHighlight(IDocumentRegion r)
|
void |
hideDebugger()
Hide the debugger tab and update the Debug menu accordingly. |
void |
hourglassOff()
Return the cursor to normal. |
void |
hourglassOn()
Make the cursor an hourglass. |
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. |
boolean |
isJavadocTabSelected()
Returns whether the JavaDoc output tab is currently showing. |
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. |
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. |
void |
removeCurrentLocationHighlight()
Removes the current highlight. |
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()
Reset the position of the "Complete Word" dialog. |
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 |
boolean |
saveEnabledHuh()
Supports MainFrameTest. |
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 |
setPopupLoc(Window popup)
Wrapper for setPopupLoc(Window, Component) that uses the window's owner as the owner to center the popup on. |
static void |
setPopupLoc(Window popup,
Component owner)
Determines the location of the popup using a simple, uniform protocol. |
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. |
void |
setVisible(boolean b)
|
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. |
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 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.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
---|
public final LinkedList<TabbedPanel> _tabs
public final JTabbedPane _tabbedPane
public volatile Component _lastFocusOwner
protected HashMap<Window,WindowAdapter> _modalWindowAdapters
protected volatile Window _modalWindowAdapterOwner
public final Action _newFileFolderAction
protected final Action _cutLineAction
protected final Action _clearLineAction
public KeyListener _historyListener
public FocusListener _focusListenerForRecentDocs
public static long UPDATE_DELAY
public static int UPDATER_PRIORITY
public static final Icon FIND_ICON
Constructor Detail |
---|
public MainFrame()
Method Detail |
---|
public void resetJarOptionsDialogPosition()
public void resetTabbedPanesFrame()
public void resetDebugFrame()
public long getLastChangeTime()
public void pack()
pack
in class Window
public boolean saveEnabledHuh()
public void lostOwnership(Clipboard clipboard, Transferable contents)
lostOwnership
in interface ClipboardOwner
public void resetClipboardHistoryDialogPosition()
public void resetGotoFileDialogPosition()
public void gotoFileMatchingMask(String mask)
mask
- word specifying the file to go topublic void resetOpenJavadocDialogPosition()
public static List<MainFrame.JavaAPIListEntry> _generateJavaAPIList(String base, String stripPrefix, String suffix)
public void generateJavaAPIList()
public void resetCompleteWordDialogPosition()
public void enableResetInteractions()
public void viewInteractionsClassPath()
public void toggleBookmark()
public void addToBrowserHistory()
public FindResultsPanel createFindResultsPanel(RegionManager<MovingDocumentRegion> rm, String title, String searchString, boolean searchAll, boolean matchCase, boolean wholeWord, boolean noComments, boolean noTestCases, WeakReference<OpenDefinitionsDocument> doc, edu.rice.cs.drjava.ui.FindReplacePanel findReplace)
rm
- the region manager that will contain the regionstitle
- the title for the panelsearchString
- string that was searched forsearchAll
- whether all files were searcheddoc
- weak reference to document in which search occurred (or started, if all documents were searched)findReplace
- the FindReplacePanel that created this FindResultsPanel
public void showFindResultsPanel(FindResultsPanel panel)
public static edu.rice.cs.drjava.ui.MainFrame.DJFileDisplayManager getFileDisplayManager20()
public static edu.rice.cs.drjava.ui.MainFrame.DJFileDisplayManager getFileDisplayManager30()
public static edu.rice.cs.drjava.ui.MainFrame.OddDisplayManager getOddDisplayManager20()
public static edu.rice.cs.drjava.ui.MainFrame.OddDisplayManager getOddDisplayManager30()
public DisplayManager<INavigatorItem> getNavPaneDisplayManager()
public void setVisible(boolean b)
setVisible
in class Window
public void setUpDrJavaProperties()
public SingleDisplayModel getModel()
public void hourglassOn()
public void hourglassOff()
public void setAllowKeyEvents(boolean a)
public boolean getAllowKeyEvents()
public void debuggerToggle()
public void showDebugger()
public void hideDebugger()
public void updateStatusField(String text)
public void updateStatusField()
public File[] getOpenFiles(JFileChooser jfc) throws OperationCanceledException
jfc
- the open dialog from which to extract information
OperationCanceledException
public File getSaveFile(JFileChooser jfc) throws OperationCanceledException
OperationCanceledException
public DefinitionsPane getCurrentDefPane()
public ErrorPanel getSelectedErrorPanel()
public boolean isCompilerTabSelected()
public boolean isTestTabSelected()
public boolean isJavadocTabSelected()
public void setStatusMessage(String msg)
msg
- The message to place in the status barpublic void clearStatusMessage()
public void setStatusMessageFont(Font f)
f
- The new font of the status bar messagepublic void setStatusMessageColor(Color c)
c
- The color of the textpublic void openProject(FileOpenSelector projectSelector)
public File getCurrentProject()
public void open(FileOpenSelector openSelector)
openSelector
- the selector that returns the files to openpublic void openFolder(DirectoryChooser chooser)
chooser
- the selector that returns the files to open
TODO: change the dialog title to give the current path rather than "..."public HashMap<OpenDefinitionsDocument,DocumentInfoGetter> gatherProjectDocInfo()
public int _jumpToLine(int lineNum)
public static ImageIcon getIcon(String name)
public JButton _createToolbarButton(Action a)
public JButton _updateToolbarButton(JButton b, Action a)
public void start()
public void resetUndo()
public DefinitionsPane getDefPaneGivenODD(OpenDefinitionsDocument doc)
public void removeCurrentLocationHighlight()
protected void _disableInteractionsPane()
protected void _enableInteractionsPane()
public void commentLines()
public void uncommentLines()
public void scrollToDocumentAndOffset(OpenDefinitionsDocument doc, int offset, boolean shouldHighlight)
doc
- Document to displayoffset
- Offset to displayshouldHighlight
- true iff the line should be highlighted. Only done in debugger.public void goToRegionAndHighlight(IDocumentRegion r)
public void scrollToDocumentAndOffset(OpenDefinitionsDocument doc, int offset, boolean shouldHighlight, boolean shouldAddToHistory)
doc
- Document to displayoffset
- Offset to displayshouldHighlight
- true iff the line should be highlighted.shouldAddToHistory
- true if the location before and after the switch should be added to the browser historypublic JViewport getDefViewport()
public void removeTab(Component c)
public void createBookmarks()
public void createBreakpoints()
public void showTab(Component c, boolean showDetachedWindow)
c
- the component to show in the tabbedPaneshowDetachedWindow
- true if the "Detached Panes" window should be shownpublic void addComponentListenerToOpenDocumentsList(ComponentListener listener)
listener
- The ComponentListener to add to the open documents list
This method allows for testing of the dancing UI (See MainFrameTest.testDancingUI()).public String getFileNameField()
public JMenu getEditMenu()
public void setPopupLoc(Window popup)
popup
- the Popup windowpublic static void setPopupLoc(Window popup, Component owner)
popup
- the popup windowowner
- the parent component for the popuppublic void dragEnter(DropTargetDragEvent dropTargetDragEvent)
dragEnter
in interface DropTargetListener
public void dragExit(DropTargetEvent dropTargetEvent)
dragExit
in interface DropTargetListener
public void dragOver(DropTargetDragEvent dropTargetDragEvent)
dragOver
in interface DropTargetListener
public void dropActionChanged(DropTargetDragEvent dropTargetDragEvent)
dropActionChanged
in interface DropTargetListener
public void drop(DropTargetDropEvent dropTargetDropEvent)
drop
in interface DropTargetListener
public static void openExtProcessFile(File file)
public static void openExtProcessJarFile(File file)
public void resetAutoImportDialogPosition()
public void resetExecuteExternalProcessPosition()
public void resetEditExternalProcessPosition()
public void installModalWindowAdapter(Window w, Runnable1<? super WindowEvent> toFrontAction, Runnable1<? super WindowEvent> closeAction)
w
- window trying to get the modal window listenertoFrontAction
- action to be performed after the window has been moved to the front againcloseAction
- action to be performed when the window is closingpublic void removeModalWindowAdapter(Window w)
w
- window releasing the modal window adapter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |