Mercurial > projects > dwt-mac
diff dwt/dnd/DropTargetEvent.d @ 45:d8635bb48c7c
Merge with SWT 3.5
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Mon, 01 Dec 2008 17:07:00 +0100 |
parents | 1a8b3cb347e0 |
children | 1c12673c65ca |
line wrap: on
line diff
--- a/dwt/dnd/DropTargetEvent.d Tue Oct 21 15:20:04 2008 +0200 +++ b/dwt/dnd/DropTargetEvent.d Mon Dec 01 17:07:00 2008 +0100 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -8,15 +8,19 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ -module dwt.dnd; +module dwt.dnd.DropTargetEvent; + +import dwt.dwthelper.utils; import dwt.events.TypedEvent; import dwt.widgets.Widget; /** * The DropTargetEvent contains the event information passed in the methods of the DropTargetListener. + * + * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> */ -public class DropTargetEvent : TypedEvent { +public class DropTargetEvent extends TypedEvent { /** * The x-cordinate of the cursor relative to the <code>Display</code> */ @@ -87,7 +91,7 @@ * * @param e the untyped event containing the information */ -public this(DNDEvent e) { +public DropTargetEvent(DNDEvent e) { super(e); this.data = e.data; this.x = e.x; @@ -112,4 +116,31 @@ 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 !is null) { + for (int i = 0; i < dataTypes.length; i++) { + sb.append(dataTypes[i].type); sb.append(' '); + } + } + sb.append('}'); + sb.append(" currentDataType="); sb.append(currentDataType !is null ? currentDataType.type : '0'); + sb.append('}'); + return sb.toString(); } +}