Mercurial > projects > dwt-linux
comparison dwt/dnd/DropTarget.d @ 259:c0d810de7093
Update SWT 3.4M7 to 3.4
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 29 Jun 2008 14:33:38 +0200 |
parents | ce446666f5a2 |
children |
comparison
equal
deleted
inserted
replaced
257:cc1d3de0e80b | 259:c0d810de7093 |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2007 IBM Corporation and others. | 2 * Copyright (c) 2000, 2008 IBM Corporation and others. |
3 * All rights reserved. This program and the accompanying materials | 3 * All rights reserved. This program and the accompanying materials |
4 * are made available under the terms of the Eclipse Public License v1.0 | 4 * are made available under the terms of the Eclipse Public License v1.0 |
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 * |
90 * <dl> | 90 * <dl> |
91 * <dt><b>Styles</b></dt> <dd>DND.DROP_NONE, DND.DROP_COPY, DND.DROP_MOVE, DND.DROP_LINK</dd> | 91 * <dt><b>Styles</b></dt> <dd>DND.DROP_NONE, DND.DROP_COPY, DND.DROP_MOVE, DND.DROP_LINK</dd> |
92 * <dt><b>Events</b></dt> <dd>DND.DragEnter, DND.DragLeave, DND.DragOver, DND.DragOperationChanged, | 92 * <dt><b>Events</b></dt> <dd>DND.DragEnter, DND.DragLeave, DND.DragOver, DND.DragOperationChanged, |
93 * DND.DropAccept, DND.Drop </dd> | 93 * DND.DropAccept, DND.Drop </dd> |
94 * </dl> | 94 * </dl> |
95 * | |
96 * @see <a href="http://www.eclipse.org/swt/snippets/#dnd">Drag and Drop snippets</a> | |
97 * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: DNDExample</a> | |
98 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> | |
95 */ | 99 */ |
96 public class DropTarget : Widget { | 100 public class DropTarget : Widget { |
97 | 101 |
98 Control control; | 102 Control control; |
99 Listener controlListener; | 103 Listener controlListener; |
351 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> | 355 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
352 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | 356 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
353 * </ul> | 357 * </ul> |
354 * | 358 * |
355 * @see DropTargetListener | 359 * @see DropTargetListener |
360 * @see #getDropListeners | |
356 * @see #removeDropListener | 361 * @see #removeDropListener |
357 * @see DropTargetEvent | 362 * @see DropTargetEvent |
358 */ | 363 */ |
359 public void addDropListener(DropTargetListener listener) { | 364 public void addDropListener(DropTargetListener listener) { |
360 if (listener is null) DND.error (DWT.ERROR_NULL_ARGUMENT); | 365 if (listener is null) DND.error (DWT.ERROR_NULL_ARGUMENT); |
581 /** | 586 /** |
582 * Returns an array of listeners who will be notified when a drag and drop | 587 * Returns an array of listeners who will be notified when a drag and drop |
583 * operation is in progress, by sending it one of the messages defined in | 588 * operation is in progress, by sending it one of the messages defined in |
584 * the <code>DropTargetListener</code> interface. | 589 * the <code>DropTargetListener</code> interface. |
585 * | 590 * |
591 * @return the listeners who will be notified when a drag and drop | |
592 * operation is in progress | |
593 * | |
586 * @exception DWTException <ul> | 594 * @exception DWTException <ul> |
587 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> | 595 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
588 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | 596 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
589 * </ul> | 597 * </ul> |
590 * | 598 * |
686 | 694 |
687 /** | 695 /** |
688 * Removes the listener from the collection of listeners who will | 696 * Removes the listener from the collection of listeners who will |
689 * be notified when a drag and drop operation is in progress. | 697 * be notified when a drag and drop operation is in progress. |
690 * | 698 * |
691 * @param listener the listener which should be notified | 699 * @param listener the listener which should no longer be notified |
692 * | 700 * |
693 * @exception IllegalArgumentException <ul> | 701 * @exception IllegalArgumentException <ul> |
694 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> | 702 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> |
695 * </ul> | 703 * </ul> |
696 * @exception DWTException <ul> | 704 * @exception DWTException <ul> |
698 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | 706 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
699 * </ul> | 707 * </ul> |
700 * | 708 * |
701 * @see DropTargetListener | 709 * @see DropTargetListener |
702 * @see #addDropListener | 710 * @see #addDropListener |
711 * @see #getDropListeners | |
703 */ | 712 */ |
704 public void removeDropListener(DropTargetListener listener) { | 713 public void removeDropListener(DropTargetListener listener) { |
705 if (listener is null) DND.error (DWT.ERROR_NULL_ARGUMENT); | 714 if (listener is null) DND.error (DWT.ERROR_NULL_ARGUMENT); |
706 removeListener (DND.DragEnter, listener); | 715 removeListener (DND.DragEnter, listener); |
707 removeListener (DND.DragLeave, listener); | 716 removeListener (DND.DragLeave, listener); |