Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Georgi2017-09-04 05:15:32 -0400
committerLakshmi Shanmugam2018-01-17 07:02:01 -0500
commit247d7f9a4fdc740d6f8a82838c37cd93fd029b14 (patch)
tree3e9591deb59d101f8aed5182018a7cb02fb85fcc /bundles/org.eclipse.swt/Eclipse SWT/win32
parent11509fa4f109d7a79da5f9e9fce6d3b1fd75d9b5 (diff)
downloadeclipse.platform.swt-247d7f9a4fdc740d6f8a82838c37cd93fd029b14.tar.gz
eclipse.platform.swt-247d7f9a4fdc740d6f8a82838c37cd93fd029b14.tar.xz
eclipse.platform.swt-247d7f9a4fdc740d6f8a82838c37cd93fd029b14.zip
Bug 525305 - [API]Provide SWT.OpenUrl event
Introduces new SWT.OpenUrl event type. On Mac, the SWT.OpenUrl event will be generated whenever Equinox calls the application:openUrls: selector. One event will be generated for each URL received from OS X. On Windows we emit the OpenUrl event if a valid URL is passed in, otherwise the OpenDocument event is sent, preserving compatibility. (Linux implementation is not included) Bug: 351303 Change-Id: Ic0cce76ce21fed0f2b182d24a29e51b821264093 Signed-off-by: Mads Mætzke Tandrup <mads@maetzke-tandrup.dk> Signed-off-by: Christian Georgi <christian.georgi@sap.com> Signed-off-by: Lakshmi Shanmugam <lshanmug@in.ibm.com>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
index 33c9b33b7e..0ef8749b54 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.swt.widgets;
+import java.net.*;
import java.util.*;
import java.util.function.*;
@@ -3440,9 +3441,14 @@ long /*int*/ messageProc (long /*int*/ hwnd, long /*int*/ msg, long /*int*/ wPar
item.sendSelectionEvent (SWT.Selection);
}
} else {
- Event event = new Event();
+ Event event = new Event ();
event.text = filename;
- sendEvent(SWT.OpenDocument, event);
+ try {
+ new URI (filename);
+ sendEvent (SWT.OpenUrl, event);
+ } catch (URISyntaxException e) {
+ sendEvent (SWT.OpenDocument, event);
+ }
}
wakeThread ();
}

Back to the top