edu.rice.cs.drjava.ui
Class CompilerErrorCaretListener

java.lang.Object
  |
  +--edu.rice.cs.drjava.ui.CompilerErrorCaretListener
All Implemented Interfaces:
CaretListener, EventListener

public class CompilerErrorCaretListener
extends Object
implements CaretListener

Listens to the caret in a particular DefinitionsPane and highlights the source containing CompilerErrors as appropriate.

Version:
$Id: CompilerErrorCaretListener.java,v 1.6 2002/08/15 23:03:58 jhsia Exp $

Field Summary
private  DefinitionsPane _definitionsPane
           
private  Document _document
           
private  CompilerErrorPanel.ErrorListPane _errorListPane
           
private  CompilerErrorModel _model
           
private  OpenDefinitionsDocument _openDoc
           
private  Position[] _positions
           
 
Constructor Summary
CompilerErrorCaretListener(OpenDefinitionsDocument doc, CompilerErrorPanel.ErrorListPane errorListPane, DefinitionsPane defPane)
          Constructs a new caret listener to highlight compiler errors.
 
Method Summary
private  void _highlightErrorInSource(int newIndex)
          Highlights the given error in the source.
 void caretUpdate(CaretEvent evt)
          After each update to the caret, determine if changes in highlighting need to be made.
 OpenDefinitionsDocument getOpenDefDoc()
          Gets the OpenDefinitionsDocument corresponding to this listener.
 void resetErrorModel()
          Resets the CompilerErrorModel after a new compile.
 void updateHighlight(int curPos)
          Update the highlight appropriately.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

_openDoc

private final OpenDefinitionsDocument _openDoc

_errorListPane

private final CompilerErrorPanel.ErrorListPane _errorListPane

_definitionsPane

private final DefinitionsPane _definitionsPane

_document

private final Document _document

_model

private CompilerErrorModel _model

_positions

private Position[] _positions
Constructor Detail

CompilerErrorCaretListener

public CompilerErrorCaretListener(OpenDefinitionsDocument doc,
                                  CompilerErrorPanel.ErrorListPane errorListPane,
                                  DefinitionsPane defPane)
Constructs a new caret listener to highlight compiler errors.
Method Detail

getOpenDefDoc

public OpenDefinitionsDocument getOpenDefDoc()
Gets the OpenDefinitionsDocument corresponding to this listener.

resetErrorModel

public void resetErrorModel()
Resets the CompilerErrorModel after a new compile.

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.

_highlightErrorInSource

private void _highlightErrorInSource(int newIndex)
Highlights the given error in the source.
Parameters:
newIndex - Index into _errors array