Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeronika Irvine2001-07-10 20:38:47 +0000
committerVeronika Irvine2001-07-10 20:38:47 +0000
commit160b2ac54493b2ae0dd5abbba9e49b8d158b1aea (patch)
tree1abd032b450541d2ecc85b783fff9a0be46e009b
parent33bede9bca7b3133dd11674be462364ea93b7387 (diff)
downloadeclipse.platform.swt-160b2ac54493b2ae0dd5abbba9e49b8d158b1aea.tar.gz
eclipse.platform.swt-160b2ac54493b2ae0dd5abbba9e49b8d158b1aea.tar.xz
eclipse.platform.swt-160b2ac54493b2ae0dd5abbba9e49b8d158b1aea.zip
*** empty log message ***
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/Clipboard.java18
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/FileTransfer.java10
2 files changed, 19 insertions, 9 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/Clipboard.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/Clipboard.java
index 3294570fae..8ad4710a57 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/Clipboard.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/Clipboard.java
@@ -76,16 +76,18 @@ public Object getContents(Transfer transfer) {
return result;
}
public void setContents(Object[] data, Transfer[] transferAgents){
-
+ if (display.isDisposed() ) return;
+
if (data == null) {
- DND.error(SWT.ERROR_NOT_IMPLEMENTED);
+ int ig = OS.PhInputGroup(0);
+ if (OS.PhClipboardCopy((short)ig, 0, null) != 0) {
+ DND.error(DND.ERROR_CANNOT_SET_CLIPBOARD);
+ }
}
if (transferAgents == null || data.length != transferAgents.length) {
DND.error(SWT.ERROR_INVALID_ARGUMENT);
}
- int status = -1;
- int ig = OS.PhInputGroup(0);
byte[] clips = new byte[0];
int count = 0;
for (int i = 0; i < transferAgents.length; i++) {
@@ -120,11 +122,11 @@ public void setContents(Object[] data, Transfer[] transferAgents){
}
if (count > 0){
- status = OS.PhClipboardCopy((short)ig, count, clips);
+ int ig = OS.PhInputGroup(0);
+ if (OS.PhClipboardCopy((short)ig, count, clips) != 0) {
+ DND.error(DND.ERROR_CANNOT_SET_CLIPBOARD);
+ }
}
-
- if (status != 0)
- DND.error(DND.ERROR_CANNOT_SET_CLIPBOARD);
}
/*
* Note: getAvailableTypeNames is a tool for writing a Transfer sub-class only. It should
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/FileTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/FileTransfer.java
index 89d54947b3..6254278446 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/FileTransfer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/FileTransfer.java
@@ -33,9 +33,17 @@ public void javaToNative(Object object, TransferData transferData) {
}
public Object nativeToJava(TransferData transferData) {
+System.out.println("data is "+transferData.pData+" with length "+transferData.length);
byte[] data = (byte[])super.nativeToJava(transferData);
+System.out.println("data byte[] length is "+data.length);
+for (int i = 0; i < data.length; i++) {
+ System.out.println("data["+i+"] = "+(char)data[i]);
+}
if (data == null) return null;
- String string = new String(data);
+ char [] unicode = org.eclipse.swt.internal.Converter.mbcsToWcs (null, data);
+ String string = new String (unicode);
+System.out.println("nativeToJava string is "+string);
+
// parse data and convert string to array of files
int start = string.indexOf("file:");
if (start == -1) return null;

Back to the top