use of us.mn.state.dot.tms.utils.wysiwyg.WEditorError in project iris by mnit-rtmc.
the class WMsgErrorPanel method updateErrorList.
/**
* Update the error list from the error manager.
*/
public void updateErrorList() {
// clear the list first
errListModel.clear();
// iterate over the errors in the manager and add them to the list
Iterator<WEditorError> it = errMan.iterator();
while (it.hasNext()) {
WEditorError err = it.next();
errListModel.addElement(err.getLongErrStr());
}
}
use of us.mn.state.dot.tms.utils.wysiwyg.WEditorError in project iris by mnit-rtmc.
the class WMsgMultiPanel method highlightErrors.
/**
* Highlight any error-producing tokens
*/
public void highlightErrors(WEditorErrorManager errMan) {
if (errMan.hasErrors()) {
Highlighter h = textBox.getHighlighter();
HighlightPainter hp = new DefaultHighlighter.DefaultHighlightPainter(Color.RED);
String txt = textBox.getText();
Iterator<WEditorError> it = errMan.iterator();
while (it.hasNext()) {
WEditorError e = it.next();
if (e.hasToken()) {
String ts = e.getToken().toString();
// if this error has a token, highlight it
int a = txt.indexOf(ts);
if (a < 0)
continue;
int b = a + ts.length();
String s = txt.substring(a, b);
if (s == ts) {
try {
h.addHighlight(a, b, hp);
} catch (BadLocationException ex) {
// just ignore this
ex.printStackTrace();
}
}
}
}
}
}
Aggregations