|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.text.JTextComponent | +--javax.swing.JEditorPane | +--edu.rice.cs.drjava.ui.JUnitPanel.JUnitErrorListPane
A pane to show JUnit errors. It acts a bit like a listbox (clicking selects an item) but items can each wrap, etc.
Inner Class Summary | |
private class |
JUnitPanel.JUnitErrorListPane.CompilerErrorColorOptionListener
The OptionListener for compiler COMPILER_ERROR_COLOR |
private class |
JUnitPanel.JUnitErrorListPane.PopupAdapter
private MouseAdapter _mouseListener = new MouseAdapter() { public void mouseClicked(MouseEvent e) { JUnitError error = _errorAtPoint(e.getPoint()); if (error == null) { selectNothing(); } else { _errorListPane.switchToError(error); } } }; |
Inner classes inherited from class javax.swing.JEditorPane |
JEditorPane.AccessibleJEditorPane, JEditorPane.AccessibleJEditorPaneHTML, JEditorPane.HeaderParser, JEditorPane.JEditorPaneAccessibleHypertextSupport, JEditorPane.PageLoader, JEditorPane.PlainEditorKit |
Inner classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent, JComponent.ActionStandin, JComponent.IntVector, JComponent.KeyboardState |
Inner classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.AWTTreeLock |
Field Summary | |
private JLabel |
_errorLabel
|
private Position[] |
_errorListPositions
The start position of each error in the list. |
private Hashtable |
_errorTable
Table mapping Positions in the error list to JUnitErrors. |
private JLabel |
_fileLabel
|
private HighlightManager |
_highlightManager
|
private DefinitionsPane |
_lastDefPane
The DefinitionsPane with the current error highlight. |
private HighlightManager.HighlightInfo |
_listHighlightTag
|
private JPopupMenu |
_popMenu
|
private JUnitPanel.JUnitErrorListPane.PopupAdapter |
_popupAdapter
|
private int |
_selectedIndex
Index into _errorListPositions of the currently selected error. |
private Window |
_stackFrame
|
private JTextArea |
_stackTextArea
|
private JLabel |
_testLabel
|
Fields inherited from class javax.swing.JEditorPane |
charSetName, kit, kitLoaderRegistryKey, kitRegistryKey, kitTypeRegistryKey, managingFocus, pageLoadedListener, pageProperties, typeHandlers, uiClassID |
Fields inherited from class javax.swing.text.JTextComponent |
caret, caretColor, caretEvent, composedText, composedTextCaret, composedTextContent, composedTextEnd, composedTextStart, DEFAULT_KEYMAP, defaultClipboardOwner, disabledTextColor, editable, editor, FOCUS_ACCELERATOR_KEY, focusAccelerator, focusedComponent, highlighter, inputMethodRequestsHandler, keymap, keymapTable, margin, model, needToSendKeyTypedEvent, originalCaret, selectedTextColor, selectionColor |
Fields inherited from class java.awt.Container |
component, containerListener, containerSerializedDataVersion, dbg, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, needsPaint, printing, printingThreads, serialVersionUID |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
JUnitPanel.JUnitErrorListPane()
Constructs the ErrorListPane. |
Method Summary | |
private void |
_checkSync(Document doc)
Checks the document being tested to see if it's in sync. |
private void |
_createPopupMenu()
|
private void |
_displayStackTrace(JUnitError e)
|
private JUnitError |
_errorAtPoint(Point p)
Returns JUnitError associated with the given visual coordinates. |
private int |
_getIndexForError(JUnitError error)
Returns the index into _errorListPositions corresponding to the given JUnitError. |
private void |
_gotoErrorSourceLocation(OpenDefinitionsDocument doc,
int idx)
Jumps to error location in source |
private void |
_insertErrorText(JUnitError[] array,
int i,
Document doc)
Puts an error message into the array of errors at the specified index. |
private void |
_removeListHighlight()
When the selection of the current error changes, remove the highlight in the error pane. |
private void |
_setupStackTraceFrame()
|
private void |
_updateNoErrors(boolean haveTestsRun)
Used to show that the last compile was successful. |
private void |
_updateWithErrors()
Used to show that the last compile was unsuccessful. |
DefinitionsPane |
getLastDefPane()
Gets the last DefinitionsPane with an error highlight. |
int |
getSelectedIndex()
Get the index of the current error in the error array. |
void |
selectItem(JUnitError error)
Selects the given error inside the error list pane. |
void |
selectNothing()
Don't select any errors in the error pane. |
void |
setJUnitInProgress(OpenDefinitionsDocument odd)
Puts the error pane into "compilation in progress" state. |
void |
setLastDefPane(DefinitionsPane pane)
Allows the ErrorListPane to remember which DefinitionsPane currently has an error highlight. |
boolean |
shouldShowHighlightsInSource()
Returns true if the errors should be highlighted in the source |
(package private) void |
switchToError(int index)
Another interface to switchToError. |
(package private) void |
switchToError(JUnitError error)
Change all state to select a new error, including moving the caret to the error, if a corresponding position exists. |
void |
updateListPane(boolean haveTestsRun)
Update the pane which holds the list of errors for the viewer. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
Field Detail |
private int _selectedIndex
private Position[] _errorListPositions
private final Hashtable _errorTable
private DefinitionsPane _lastDefPane
private HighlightManager.HighlightInfo _listHighlightTag
private JPopupMenu _popMenu
private JUnitPanel.JUnitErrorListPane.PopupAdapter _popupAdapter
private Window _stackFrame
private JTextArea _stackTextArea
private final JLabel _errorLabel
private final JLabel _testLabel
private final JLabel _fileLabel
private HighlightManager _highlightManager
Constructor Detail |
public JUnitPanel.JUnitErrorListPane()
Method Detail |
private void _createPopupMenu()
private void _setupStackTraceFrame()
private void _checkSync(Document doc)
private void _displayStackTrace(JUnitError e)
public boolean shouldShowHighlightsInSource()
public int getSelectedIndex()
public void setLastDefPane(DefinitionsPane pane)
public DefinitionsPane getLastDefPane()
private JUnitError _errorAtPoint(Point p)
private int _getIndexForError(JUnitError error)
public void updateListPane(boolean haveTestsRun)
public void setJUnitInProgress(OpenDefinitionsDocument odd)
private void _updateNoErrors(boolean haveTestsRun) throws BadLocationException
private void _updateWithErrors() throws BadLocationException
private void _insertErrorText(JUnitError[] array, int i, Document doc) throws BadLocationException
array
- the array of errorsi
- the index at which the message will be inserteddoc
- the document in the error paneprivate void _removeListHighlight()
public void selectNothing()
public void selectItem(JUnitError error)
void switchToError(JUnitError error)
doc
- OpenDefinitionsDocument containing this errorerrorNum
- Error number, which is either in _errorsWithoutPositions
(if errorNum < _errorsWithoutPositions.length) or in _errors (otherwise).
If it's in _errors, we need to subtract _errorsWithoutPositions.length
to get the index into the array.void switchToError(int index)
index
- Index into the array of positions in the ErrorListPaneprivate void _gotoErrorSourceLocation(OpenDefinitionsDocument doc, int idx)
doc
- OpenDefinitionsDocument containing the erroridx
- Index into _errors array
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |