summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuong Nguyen <dnguyen>2008-01-31 00:02:58 +0000
committerDuong Nguyen <dnguyen>2008-01-31 00:02:58 +0000
commitd3ab70598558239dfbba5286fff86a903ec7ab74 (patch)
tree556f4000d6c8b3bb7a54d720121afde3b94ac2f7
parent7a922c7d2b814bfd5d82c3bf89128d892b6c828f (diff)
downloadeclipse.platform.swt-d3ab70598558239dfbba5286fff86a903ec7ab74.tar.gz
eclipse.platform.swt-d3ab70598558239dfbba5286fff86a903ec7ab74.tar.xz
eclipse.platform.swt-d3ab70598558239dfbba5286fff86a903ec7ab74.zip
Bug 215388 - Add API to make the DropTarget more open
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/wpf/org/eclipse/swt/dnd/DragSource.java7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/wpf/org/eclipse/swt/dnd/DropTarget.java7
2 files changed, 6 insertions, 8 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/wpf/org/eclipse/swt/dnd/DragSource.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/wpf/org/eclipse/swt/dnd/DragSource.java
index d5c6134ffa..48868312d0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/wpf/org/eclipse/swt/dnd/DragSource.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/wpf/org/eclipse/swt/dnd/DragSource.java
@@ -94,7 +94,6 @@ import org.eclipse.swt.widgets.*;
public class DragSource extends Widget {
private static final String DEFAULT_DRAG_SOURCE_EFFECT = "DEFAULT_DRAG_SOURCE_EFFECT"; //$NON-NLS-1$
- private static final String DRAGSOURCEID = "DragSource"; //$NON-NLS-1$
static int checkStyle (int style) {
if (style == SWT.NONE) return DND.DROP_MOVE;
return style;
@@ -140,9 +139,9 @@ public class DragSource extends Widget {
public DragSource(Control control, int style) {
super (control, checkStyle(style));
this.control = control;
- if (control.getData(DRAGSOURCEID) != null)
+ if (control.getData(DND.DRAG_SOURCE_KEY) != null)
DND.error(DND.ERROR_CANNOT_INIT_DRAG);
- control.setData(DRAGSOURCEID, this);
+ control.setData(DND.DRAG_SOURCE_KEY, this);
jniRef = OS.NewGlobalRef (this);
if (jniRef == 0) SWT.error(SWT.ERROR_NO_HANDLES);
@@ -320,7 +319,7 @@ void onDispose() {
jniRef = 0;
controlListener = null;
- control.setData(DRAGSOURCEID, null);
+ control.setData(DND.DRAG_SOURCE_KEY, null);
control = null;
transferAgents = null;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/wpf/org/eclipse/swt/dnd/DropTarget.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/wpf/org/eclipse/swt/dnd/DropTarget.java
index e5faaca242..00a0716f15 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/wpf/org/eclipse/swt/dnd/DropTarget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/wpf/org/eclipse/swt/dnd/DropTarget.java
@@ -70,7 +70,6 @@ import org.eclipse.swt.widgets.*;
public class DropTarget extends Widget {
static final String DEFAULT_DROP_TARGET_EFFECT = "DEFAULT_DROP_TARGET_EFFECT"; //$NON-NLS-1$
- static final String DROPTARGETID = "DropTarget"; //$NON-NLS-1$
static int checkStyle (int style) {
if (style == SWT.NONE) return DND.DROP_MOVE;
return style;
@@ -128,9 +127,9 @@ public class DropTarget extends Widget {
public DropTarget(Control control, int style) {
super (control, checkStyle(style));
this.control = control;
- if (control.getData(DROPTARGETID) != null)
+ if (control.getData(DND.DROP_TARGET_KEY) != null)
DND.error(DND.ERROR_CANNOT_INIT_DROP);
- control.setData(DROPTARGETID, this);
+ control.setData(DND.DROP_TARGET_KEY, this);
jniRef = OS.NewGlobalRef (this);
if (jniRef == 0) SWT.error(SWT.ERROR_NO_HANDLES);
@@ -509,7 +508,7 @@ void onDispose () {
if (jniRef != 0) OS.DeleteGlobalRef (jniRef);
jniRef = 0;
controlListener = null;
- control.setData(DROPTARGETID, null);
+ control.setData(DND.DROP_TARGET_KEY, null);
transferAgents = null;
control = null;
}