import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchCommandConstants;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.widgets.Hyperlink;
import org.eclipse.ui.internal.IWorkbenchHelpContextIds;
import org.eclipse.ui.internal.ProductProperties;
import org.eclipse.ui.internal.WorkbenchMessages;
label.setText(key);
label.setBackground(background);
if (value.startsWith("http")) {
- Link link = new Link(scroller, SWT.NONE);
+ GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+ gd.widthHint = 198;
+ final Hyperlink link = new Hyperlink(scroller, SWT.WRAP);
+ link.setLayoutData(gd);
link.setBackground(background);
- link.setText("<a>" + value + "</a>");
- link.addSelectionListener(new SelectionAdapter() {
+ link.setText(value);
+ link.setHref(value);
+ link.addHyperlinkListener(new HyperlinkAdapter() {
@Override
- public void widgetSelected(SelectionEvent e) {
+ public void linkActivated(HyperlinkEvent e) {
try {
// Open default external browser
- PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL(e.text));
+ PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL(link.getHref().toString()));
} catch (Exception ex) {
}
}
org.eclipse.emf.common.util,
org.eclipse.emf.ecore,
org.eclipse.emf.ecore.util,
+ org.eclipse.ui.forms.events,
+ org.eclipse.ui.forms.widgets,
org.osgi.service.event;version="1.2.0",
org.w3c.dom,
org.w3c.dom.css;version="2.0.0",