changeset 4880:5044e490ca48

RT-27006: unread transferData field in FXCanvas [fix was to comment out the variable]
author snorthov
date Wed, 28 Aug 2013 13:13:31 -0400
parents 470b1208edc5
children 2e57da87f2fc
files modules/swt/src/main/java/javafx/embed/swt/FXCanvas.java
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/modules/swt/src/main/java/javafx/embed/swt/FXCanvas.java	Wed Aug 28 13:02:07 2013 -0400
+++ b/modules/swt/src/main/java/javafx/embed/swt/FXCanvas.java	Wed Aug 28 13:13:31 2013 -0400
@@ -711,7 +711,12 @@
             dropTarget.setTransfer(getAllTransfers());
             dropTarget.addDropListener(new DropTargetListener() {
                 Object data;
-                TransferData [] transferData;
+                // In SWT, the list of available types that the source can provide
+                // is part of the event.  FX queries this directly from the operating
+                // system and bypasses SWT.  This variable is commented out to remind
+                // us of this potential inconsistency.
+                //
+                //TransferData [] transferData;
                 TransferData currentTransferData;
                 boolean ignoreLeave;
                 int detail = DND.DROP_NONE, operations = DND.DROP_NONE;
@@ -736,7 +741,7 @@
                     }
                     public void dragDropEnd(TransferMode performedAction) {
                         data = null;
-                        transferData = null;
+                        //transferData = null;
                         currentTransferData = null;
                     }
                 };
@@ -749,7 +754,7 @@
                 public void dragLeave(DropTargetEvent event) {
                     detail = operations = DND.DROP_NONE;
                     data = null;
-                    transferData = null;
+                    //transferData = null;
                     currentTransferData = null;
                     getDisplay().asyncExec(new Runnable () {
                         public void run () {
@@ -768,7 +773,7 @@
                     dragOver (event, false, detail);
                 }
                 public void dragOver(DropTargetEvent event, boolean enter, int detail) {
-                    transferData = event.dataTypes;
+                    //transferData = event.dataTypes;
                     currentTransferData = event.currentDataType;
                     Point pt = toControl(event.x, event.y);
                     if (detail == DND.DROP_NONE) detail = DND.DROP_COPY;
@@ -784,14 +789,14 @@
                     detail = event.detail;
                     operations = event.operations;
                     data = event.data;
-                    transferData = event.dataTypes;
+                    //transferData = event.dataTypes;
                     currentTransferData = event.currentDataType;
                     Point pt = toControl(event.x, event.y);
                     TransferMode recommendedDropAction = getTransferMode(event.detail);
                     TransferMode acceptedMode = fxDropTarget.handleDragDrop(pt.x, pt.y, event.x, event.y, recommendedDropAction);
                     event.detail = getDragAction(acceptedMode);
                     data = null;
-                    transferData = null;
+                    //transferData = null;
                     currentTransferData = null;
                 }
                 public void dropAccept(DropTargetEvent event) {