comparison dwt/dnd/DragSourceEvent.d @ 97:d5f4a7c8aa74

Ported dwt.dnd.DragSourceEvent
author Jacob Carlborg <doob@me.com>
date Tue, 30 Dec 2008 20:57:46 +0100
parents d8635bb48c7c
children 2e671fa40eec
comparison
equal deleted inserted replaced
96:bc175cd0484a 97:d5f4a7c8aa74
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 *
11 * Port to the D programming language:
12 * Jacob Carlborg <doob@me.com>
10 *******************************************************************************/ 13 *******************************************************************************/
11 module dwt.dnd.DragSourceEvent; 14 module dwt.dnd.DragSourceEvent;
12 15
13 import dwt.dwthelper.utils; 16 import dwt.dwthelper.utils;
14 17
15 import dwt.events.TypedEvent; 18 import dwt.events.TypedEvent;
16 import dwt.graphics.Image; 19 import dwt.graphics.Image;
17 20
21 import dwt.dnd.DNDEvent;
22 import dwt.dnd.TransferData;
23
18 /** 24 /**
19 * The DragSourceEvent contains the event information passed in the methods of the DragSourceListener. 25 * The DragSourceEvent contains the event information passed in the methods of the DragSourceListener.
20 * 26 *
21 * @see DragSourceListener 27 * @see DragSourceListener
22 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> 28 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
23 */ 29 */
24 public class DragSourceEvent extends TypedEvent { 30 public class DragSourceEvent : TypedEvent {
25 /** 31 /**
26 * The operation that was performed. 32 * The operation that was performed.
27 * @see DND#DROP_NONE 33 * @see DND#DROP_NONE
28 * @see DND#DROP_MOVE 34 * @see DND#DROP_MOVE
29 * @see DND#DROP_COPY 35 * @see DND#DROP_COPY
89 * 95 *
90 * @since 3.5 96 * @since 3.5
91 */ 97 */
92 public int offsetY; 98 public int offsetY;
93 99
94 static final long serialVersionUID = 3257002142513770808L; 100 static const long serialVersionUID = 3257002142513770808L;
95 101
96 /** 102 /**
97 * Constructs a new instance of this class based on the 103 * Constructs a new instance of this class based on the
98 * information in the given untyped event. 104 * information in the given untyped event.
99 * 105 *
100 * @param e the untyped event containing the information 106 * @param e the untyped event containing the information
101 */ 107 */
102 public DragSourceEvent(DNDEvent e) { 108 public this(DNDEvent e) {
103 super(e); 109 super(e);
104 this.data = e.data; 110 this.data = e.data;
105 this.detail = e.detail; 111 this.detail = e.detail;
106 this.doit = e.doit; 112 this.doit = e.doit;
107 this.dataType = e.dataType; 113 this.dataType = e.dataType;
130 * 136 *
131 * @return a string representation of the event 137 * @return a string representation of the event
132 */ 138 */
133 public String toString() { 139 public String toString() {
134 String string = super.toString (); 140 String string = super.toString ();
135 return string.substring (0, string.length() - 1) // remove trailing '}' 141 return Format("{}{}{}{}{}{}{}", string.substring (0, string.length() - 1) // remove trailing '}'
136 + " operation=" + detail 142 , " operation=" , detail
137 + " type=" + (dataType !is null ? dataType.type : 0) 143 , " type=" , (dataType !is null ? dataType.type : 0)
138 + " doit=" + doit 144 , " doit=" , doit
139 + "}"; 145 , "}");
140 } 146 }
141 } 147 }