1 11 package org.eclipse.jdt.internal.debug.ui.console; 12 13 14 import org.eclipse.jface.text.BadLocationException; 15 import org.eclipse.ui.console.IHyperlink; 16 import org.eclipse.ui.console.IPatternMatchListenerDelegate; 17 import org.eclipse.ui.console.PatternMatchEvent; 18 import org.eclipse.ui.console.TextConsole; 19 20 23 public class JavaConsoleTracker implements IPatternMatchListenerDelegate { 24 25 28 private TextConsole fConsole; 29 30 33 public void connect(TextConsole console) { 34 fConsole = console; 35 } 36 37 40 public void disconnect() { 41 fConsole = null; 42 } 43 44 protected TextConsole getConsole() { 45 return fConsole; 46 } 47 48 51 public void matchFound(PatternMatchEvent event) { 52 try { 53 int offset = event.getOffset(); 54 int length = event.getLength(); 55 IHyperlink link = new JavaStackTraceHyperlink(fConsole); 56 fConsole.addHyperlink(link, offset+1, length-2); 57 } catch (BadLocationException e) { 58 } 59 } 60 61 } 62 | Popular Tags |