String errorMessage = e.getMessage();
try{
StyledText canvas = wText.getStyledText();
// try to parse the error message
Matcher m = pErrorMessage.matcher(errorMessage);
if (m.find()){
String errorSummary = "Error: "+m.group(1).trim();
canvas.setData("lastErrorMessage",errorSummary);
wlSyntaxCheck.setText(errorSummary);
wlSyntaxCheck.setToolTipText(wlSyntaxCheck.getText());
}
// try to parse the error line
m = pErrorLine.matcher(errorMessage);
int errorLine = 0;
int errorCol = 0;
if (m.find()){
errorLine = Integer.valueOf(m.group(1))-1;
canvas.setData("lastErrorLine", errorLine);
canvas.setLineBackground(errorLine, 1, errorLineColor);
}
// try to parse the actual error char
m = pErrorChar.matcher(errorMessage);
if (m.find()){
errorCol = m.group(1).length();
canvas.setSelection(canvas.getOffsetAtLine(errorLine)+errorCol);
}
}
catch(Exception ex){
//ex.printStackTrace();