From 7b284503d08592dbddb77a19eb2de58b2bbcf267 Mon Sep 17 00:00:00 2001 From: Silenio Quarti Date: Fri, 16 Nov 2012 11:36:11 -0500 Subject: Bug 389702 - Drag and drop a tab item to desktop/Finder, a text file is created, not a web link is generated --- .../cocoa/org/eclipse/swt/dnd/URLTransfer.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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 482addd71e..8d060e68f7 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,8 +30,10 @@ import org.eclipse.swt.internal.cocoa.*; public class URLTransfer extends ByteArrayTransfer { static URLTransfer _instance = new URLTransfer(); - static final String URL = (OS.VERSION >= 0x1060 ? OS.kUTTypeURL : OS.NSURLPboardType).getString(); + static final String URL = OS.NSURLPboardType.getString(); + static final String URL1 = OS.kUTTypeURL.getString(); static final int URL_ID = registerType(URL); + static final int URL_ID1 = registerType(URL1); private URLTransfer() {} @@ -83,11 +85,19 @@ public Object nativeToJava(TransferData transferData){ } protected int[] getTypeIds(){ - return new int[] {URL_ID}; + if (OS.VERSION >= 0x1060) { + return new int[] {URL_ID, URL_ID1}; + } else { + return new int[] {URL_ID}; + } } protected String[] getTypeNames(){ - return new String[] {URL}; + if (OS.VERSION >= 0x1060) { + return new String[] {URL, URL1}; + } else { + return new String[] {URL}; + } } boolean checkURL(Object object) { -- cgit