//(the first line is: TestName Status: status Time: time\n\n)
//See: org.python.pydev.debug.pyunit.PyUnitView.notifyTest(PyUnitTestResult, boolean)
int firstSpace = hoverInfo.indexOf(' ');
if (firstSpace > 0) {
StyleRangeWithCustomData range = new StyleRangeWithCustomData();
range.fontStyle = SWT.BOLD;
range.underline = true;
try {
range.underlineStyle = SWT.UNDERLINE_LINK;
} catch (Throwable e) {
//Ignore (not available on earlier versions of eclipse)
}
range.start = 0;
range.length = firstSpace;
if (this.data instanceof PyUnitTestResult) {
final PyUnitTestResult pyUnitTestResult = (PyUnitTestResult) this.data;
range.customData = new IHyperlink() {
public void linkExited() {
}
public void linkEntered() {
}
public void linkActivated() {
pyUnitTestResult.open();
}
};
}
presentation.addStyleRange(range);
}
PythonConsoleLineTracker lineTracker = new PythonConsoleLineTracker();
lineTracker.init(new ILinkContainer() {
public void addLink(IHyperlink link, int offset, int length) {
StyleRangeWithCustomData range = new StyleRangeWithCustomData();
range.underline = true;
try {
range.underlineStyle = SWT.UNDERLINE_LINK;
} catch (Throwable e) {
//Ignore (not available on earlier versions of eclipse)