public void disconnect() {
}
public void matchFound(PatternMatchEvent event) {
if (event.getSource() instanceof IConsole) {
IConsole console = (IConsole)event.getSource();
if (TomcatUtils.getInstance().isTomcatProcess(console.getProcess())) {
try {
// parse TML Warning
IDocument document = console.getDocument();
String content = document.get(event.getOffset(), event.getLength());
TMLWarning warning = TMLWarning.parse(content);
// compute link offset & length
int linkOffset = event.getOffset();
int linkLength = event.getLength();
int linkStart = content.indexOf(" - ");
if (linkStart != -1) {
linkStart += " - ".length();
int linkEnd = content.indexOf(" - ", linkStart);
if (linkEnd != -1) {
linkOffset += linkStart;
linkLength = linkEnd - linkStart;
}
}
// add hyperlink
console.addLink(new TMLWarningHyperLink(warning), linkOffset, linkLength);
} catch (Exception e) {
WGADesignerPlugin.getDefault().logError(e.getMessage(), e);
}
}
}