ABOUTPAGE: Change widget from link to hyperlink widget for styling SWT.WRAP
authorYoonki Park <yoonki.park@samsung.com>
Fri, 19 Aug 2016 01:58:40 +0000 (10:58 +0900)
committerYoonki Park <yoonki.park@samsung.com>
Fri, 19 Aug 2016 01:58:40 +0000 (10:58 +0900)
- Set swt wrap style due to release note url.

Change-Id: If81a697f08bb08aeac4c3c003f739e37f2af1316
Signed-off-by: Yoonki Park <yoonki.park@samsung.com>
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/AboutDialog.java
bundles/org.eclipse.ui.workbench/META-INF/MANIFEST.MF

index b14032c..c49843f 100644 (file)
@@ -59,11 +59,13 @@ import org.eclipse.swt.widgets.Button;
 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;
@@ -354,15 +356,19 @@ public class AboutDialog extends TrayDialog {
                        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) {
                                                }
                                        }
index 7f70eaa..a1d94b8 100644 (file)
@@ -127,6 +127,8 @@ Import-Package: com.ibm.icu.text,
  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",