1 /*******************************************************************************
2 * Copyright (c) 2000, 2016 IBM Corporation and others.
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
9 * SPDX-License-Identifier: EPL-2.0
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.dnd;
18 * This adapter class provides default implementations for the
19 * methods described by the <code>DropTargetListener</code> interface.
21 * Classes that wish to deal with <code>DropTargetEvent</code>s can
22 * extend this class and override only the methods which they are
27 * Please note, there are subtle difference in DND behavior on different OS's.
28 * For example during a file transfer, Windows will put out the file path
29 * as soon as the drag begins, where as Linux will make it available only
30 * on a drop operation. For correct crossplatform behavior, it is recommended
31 * to delay OS interaction until drop has occurred or verify the correctness of
32 * the operation across platforms.
36 * @see DropTargetListener
37 * @see DropTargetEvent
38 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
39 * @see <a href="https://eclipse.org/articles/Article-SWT-DND/DND-in-SWT.html"> Eclipse corner article on DND </a>
41 public class DropTargetAdapter implements DropTargetListener {
44 * This implementation of <code>dragEnter</code> permits the default
45 * operation defined in <code>event.detail</code>to be performed on the current data type
46 * defined in <code>event.currentDataType</code>.
47 * For additional information see <code>DropTargetListener.dragEnter</code>.
49 * @param event the information associated with the drag enter event
52 public void dragEnter(DropTargetEvent event){}
55 * This implementation of <code>dragLeave</code> does nothing.
56 * For additional information see <code>DropTargetListener.dragOperationChanged</code>.
58 * @param event the information associated with the drag leave event
61 public void dragLeave(DropTargetEvent event){}
64 * This implementation of <code>dragOperationChanged</code> permits the default
65 * operation defined in <code>event.detail</code>to be performed on the current data type
66 * defined in <code>event.currentDataType</code>.
67 * For additional information see <code>DropTargetListener.dragOperationChanged</code>.
69 * @param event the information associated with the drag operation changed event
72 public void dragOperationChanged(DropTargetEvent event){}
75 * This implementation of <code>dragOver</code> permits the default
76 * operation defined in <code>event.detail</code>to be performed on the current data type
77 * defined in <code>event.currentDataType</code>.
78 * For additional information see <code>DropTargetListener.dragOver</code>.
80 * @param event the information associated with the drag over event
83 public void dragOver(DropTargetEvent event){}
86 * This implementation of <code>drop</code> does nothing.
87 * For additional information see <code>DropTargetListener.drop</code>.
89 * @param event the information associated with the drop event
92 public void drop(DropTargetEvent event){}
95 * This implementation of <code>dropAccept</code> permits the default
96 * operation defined in <code>event.detail</code>to be performed on the current data type
97 * defined in <code>event.currentDataType</code>.
98 * For additional information see <code>DropTargetListener.dropAccept</code>.
100 * @param event the information associated with the drop accept event
103 public void dropAccept(DropTargetEvent event){}