summaryrefslogtreecommitdiffstats
path: root/bundles
diff options
context:
space:
mode:
authorDuong Nguyen <dnguyen>2008-07-24 18:20:52 +0000
committerDuong Nguyen <dnguyen>2008-07-24 18:20:52 +0000
commit4c3988ce8a0271ca00c04b5918fcaf66828ff3b9 (patch)
tree51c4af31ff9339c6cb5240be04cdbece733b3357 /bundles
parent9e0e5dcedd6cb4a0442b6a1a1e3bbd82f4332b36 (diff)
downloadeclipse.platform.swt-4c3988ce8a0271ca00c04b5918fcaf66828ff3b9.tar.gz
eclipse.platform.swt-4c3988ce8a0271ca00c04b5918fcaf66828ff3b9.tar.xz
eclipse.platform.swt-4c3988ce8a0271ca00c04b5918fcaf66828ff3b9.zip
Added toString() for DragSourceEvent and DropTargetEvent
Diffstat (limited to 'bundles')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DragSourceEvent.java14
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DropTargetEvent.java27
2 files changed, 41 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DragSourceEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DragSourceEvent.java
index 284094a752..335ec7a683 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DragSourceEvent.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DragSourceEvent.java
@@ -122,4 +122,18 @@ void updateEvent(DNDEvent e) {
e.offsetX = this.offsetX;
e.offsetY = this.offsetY;
}
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public String toString() {
+ String string = super.toString ();
+ return string.substring (0, string.length() - 1) // remove trailing '}'
+ + " operation=" + detail
+ + " type=" + (dataType != null ? dataType.type : 0)
+ + " doit=" + doit
+ + "}";
+}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DropTargetEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DropTargetEvent.java
index a2a6957428..e9d72f6d42 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DropTargetEvent.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common/org/eclipse/swt/dnd/DropTargetEvent.java
@@ -114,4 +114,31 @@ void updateEvent(DNDEvent e) {
e.feedback = this.feedback;
e.item = this.item;
}
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public String toString() {
+ String string = super.toString ();
+ StringBuffer sb = new StringBuffer();
+ sb.append(string.substring (0, string.length() - 1)); // remove trailing '}'
+ sb.append(" x="); sb.append(x);
+ sb.append(" y="); sb.append(y);
+ sb.append(" item="); sb.append(item);
+ sb.append(" operations="); sb.append(operations);
+ sb.append(" operation="); sb.append(detail);
+ sb.append(" feedback="); sb.append(feedback);
+ sb.append(" dataTypes={ ");
+ if (dataTypes != null) {
+ for (int i = 0; i < dataTypes.length; i++) {
+ sb.append(dataTypes[i].type); sb.append(' ');
+ }
+ }
+ sb.append('}');
+ sb.append(" currentDataType="); sb.append(currentDataType != null ? currentDataType.type : '0');
+ sb.append('}');
+ return sb.toString();
+}
}