}
e.gc.setForeground(shell.getForeground());
sp.printString();
} else if (e.type == SWT.MouseMove) {
if (sp != null) {
URLInfo hitUrl = sp.getHitUrl(e.x, e.y);
if (hitUrl != null) {
canvas.setCursor(canvas.getDisplay().getSystemCursor(
SWT.CURSOR_HAND));
canvas.setToolTipText(hitUrl.url);
} else {
canvas.setCursor(canvas.getDisplay().getSystemCursor(
SWT.CURSOR_ARROW));
canvas.setToolTipText(null);
}
}
} else if (e.type == SWT.MouseUp) {
if (sp != null) {
URLInfo hitUrl = sp.getHitUrl(e.x, e.y);
if (hitUrl != null && !hitUrl.url.startsWith(":")) {
Utils.launch(hitUrl.url);
}
}
}