org.eclipse.swt.dnd.DragSourceListener Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.eclipse.swt.win32.win32.x86 Show documentation
Show all versions of org.eclipse.swt.win32.win32.x86 Show documentation
SWT is an open source widget toolkit for Java designed to provide efficient, portable access to the user-interface facilities of the operating systems on which it is implemented.
The newest version!
/*******************************************************************************
* Copyright (c) 2000, 2011 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.swt.dnd;
import org.eclipse.swt.internal.SWTEventListener;
/**
* The DragSourceListener
class provides event notification to the application for DragSource events.
*
* When the user drops data on a DropTarget
, the application which defines the DragSource
* must provide the dropped data by implementing dragSetData
. In the dragSetData, the application
* must support all the data types that were specified in the DragSource#setTransfer method.
*
* After the drop has completed successfully or has been aborted, the application which defines the
* DragSource
is required to take the appropriate cleanup action. In the case of a successful
* move operation, the application must remove the data that was transferred.
*
*/
public interface DragSourceListener extends SWTEventListener {
/**
* The user has begun the actions required to drag the widget. This event gives the application
* the chance to decide if a drag should be started.
*
* The following fields in the DragSourceEvent apply:
*
* - (in)widget
*
- (in)time
*
- (in,out)doit
*
*
* @param event the information associated with the drag start event
*
* @see DragSourceEvent
*/
public void dragStart(DragSourceEvent event);
/**
* The data is required from the drag source.
*
* The following fields in the DragSourceEvent apply:
*
* - (in)widget
*
- (in)time
*
- (in)dataType - the type of data requested.
*
- (out)data - the application inserts the actual data here (must match the dataType)
*
- (out)doit - set this to cancel the drag
*
*
* @param event the information associated with the drag set data event
*
* @see DragSourceEvent
*/
public void dragSetData(DragSourceEvent event);
/**
* The drop has successfully completed(mouse up over a valid target) or has been terminated (such as hitting
* the ESC key). Perform cleanup such as removing data from the source side on a successful move operation.
*
* The following fields in the DragSourceEvent apply:
*
* - (in)widget
*
- (in)time
*
- (in)doit
*
- (in)detail
*
*
* @param event the information associated with the drag finished event
*
* @see DragSourceEvent
*/
public void dragFinished(DragSourceEvent event);
}