summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti <silenio_quarti@ca.ibm.com>2012-09-28 10:23:02 -0400
committerSilenio Quarti <silenio_quarti@ca.ibm.com>2012-09-28 10:23:02 -0400
commitc7cbced32992f5cff36e25ce2932835717af3cbb (patch)
tree521cb248692ec44989ff129de1343271ff572a9d
parente9024966202f6bd2eaef5f6ebebe83ee37dcb74e (diff)
downloadeclipse.platform.swt-c7cbced32992f5cff36e25ce2932835717af3cbb.tar.gz
eclipse.platform.swt-c7cbced32992f5cff36e25ce2932835717af3cbb.tar.xz
eclipse.platform.swt-c7cbced32992f5cff36e25ce2932835717af3cbb.zip
Bug 389702 - Drag and drop a tab item to desktop/Finder, a text file is created, not a web link is generated.
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/Clipboard.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DragSource.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DropTarget.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/URLTransfer.java2
4 files changed, 5 insertions, 5 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/Clipboard.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/Clipboard.java
index fe90d62be2..3c311372e5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/Clipboard.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/Clipboard.java
@@ -291,7 +291,7 @@ public Object getContents(Transfer transfer, int clipboards) {
tdata.data = pasteboard.stringForType(type);
} else if (type.isEqual(OS.NSFilenamesPboardType)) {
tdata.data = new NSArray(pasteboard.propertyListForType(type).id);
- } else if (type.isEqual(OS.NSURLPboardType)) {
+ } else if (type.isEqual(OS.NSURLPboardType) || type.getString().equals("public.url")) {
tdata.data = NSURL.URLFromPasteboard(pasteboard);
} else {
tdata.data = pasteboard.dataForType(type);
@@ -459,7 +459,7 @@ public void setContents(Object[] data, Transfer[] dataTypes, int clipboards) {
dataType.isEqual(OS.NSRTFPboardType) ||
dataType.isEqual(OS.NSHTMLPboardType)) {
pasteboard.setString((NSString) tdata, dataType);
- } else if (dataType.isEqual(OS.NSURLPboardType)) {
+ } else if (dataType.isEqual(OS.NSURLPboardType) || dataType.getString().equals("public.url")) {
NSURL url = (NSURL) tdata;
url.writeToPasteboard(pasteboard);
} else if (dataType.isEqual(OS.NSFilenamesPboardType)) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DragSource.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DragSource.java
index 04f7e2efef..70b7149169 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DragSource.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DragSource.java
@@ -751,7 +751,7 @@ void pasteboard_provideDataForType(long /*int*/ id, long /*int*/ sel, long /*int
dataType.isEqual(OS.NSHTMLPboardType) ||
dataType.isEqual(OS.NSRTFPboardType)) {
pasteboard.setString((NSString) tdata, dataType);
- } else if (dataType.isEqual(OS.NSURLPboardType)) {
+ } else if (dataType.isEqual(OS.NSURLPboardType) || dataType.getString().equals("public.url")) {
NSURL url = (NSURL) tdata;
url.writeToPasteboard(pasteboard);
} else if (dataType.isEqual(OS.NSFilenamesPboardType)) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DropTarget.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DropTarget.java
index 6383d896df..79c7a0b691 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DropTarget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DropTarget.java
@@ -692,7 +692,7 @@ boolean drop(NSObject sender) {
type.isEqual(OS.NSHTMLPboardType) ||
type.isEqual(OS.NSRTFPboardType)) {
tdata.data = pasteboard.stringForType(type);
- } else if (type.isEqual(OS.NSURLPboardType)) {
+ } else if (type.isEqual(OS.NSURLPboardType) || type.getString().equals("public.url")) {
tdata.data = NSURL.URLFromPasteboard(pasteboard);
} else if (type.isEqual(OS.NSFilenamesPboardType)) {
tdata.data = new NSArray(pasteboard.propertyListForType(type).id);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/URLTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/URLTransfer.java
index c316886fa9..3266309332 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/URLTransfer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/URLTransfer.java
@@ -30,7 +30,7 @@ import org.eclipse.swt.internal.cocoa.*;
public class URLTransfer extends ByteArrayTransfer {
static URLTransfer _instance = new URLTransfer();
- static final String URL = OS.NSURLPboardType.getString();
+ static final String URL = OS.VERSION >= 0x1060 ? "public.url" /* kUTTypeURL */ : OS.NSURLPboardType.getString();
static final int URL_ID = registerType(URL);
private URLTransfer() {}