edu.rice.cs.drjava.ui
Class JUnitErrorCaretListener
java.lang.Object
|
+--edu.rice.cs.drjava.ui.JUnitErrorCaretListener
- All Implemented Interfaces:
- CaretListener, EventListener
- public class JUnitErrorCaretListener
- extends Object
- implements CaretListener
Listens to the caret in a particular DefinitionsPane and
highlights the source containing JUnitErrors as appropriate.
- Version:
- $Id: JUnitErrorCaretListener.java,v 1.5 2002/09/02 21:24:12 csreis Exp $
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
_openDoc
private final OpenDefinitionsDocument _openDoc
_errorListPane
private final JUnitPanel.JUnitErrorListPane _errorListPane
_definitionsPane
private final DefinitionsPane _definitionsPane
_document
private final Document _document
_model
private JUnitErrorModel _model
_positions
private Position[] _positions
_shouldHighlight
private boolean _shouldHighlight
JUnitErrorCaretListener
public JUnitErrorCaretListener(OpenDefinitionsDocument doc,
JUnitPanel.JUnitErrorListPane errorListPane,
DefinitionsPane defPane)
- Constructs a new caret listener to highlight JUnit errors.
getOpenDefDoc
public OpenDefinitionsDocument getOpenDefDoc()
- Gets the OpenDefinitionsDocument corresponding to this listener.
resetErrorModel
public void resetErrorModel()
- Resets the JUnitErrorModel after a new test.
caretUpdate
public void caretUpdate(CaretEvent evt)
- After each update to the caret, determine if changes in
highlighting need to be made.
- Specified by:
caretUpdate
in interface CaretListener
updateHighlight
public void updateHighlight(int curPos)
- Update the highlight appropriately.
shouldHighlight
public void shouldHighlight(boolean sH)
- Sets whether the given error should or should not be highlighted. Errors without
location do not highlight the source.
shouldHighlight
public boolean shouldHighlight()
- Indicates that the given error should or should not be highlighted. Errors without
location do not highlight the source.
_highlightErrorInSource
private void _highlightErrorInSource(int newIndex)
- Highlights the given error in the source.
- Parameters:
newIndex
- Index into _errors array