KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > util > TransferDragSourceListener


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jface.util;
12
13 import org.eclipse.swt.dnd.DragSourceListener;
14 import org.eclipse.swt.dnd.Transfer;
15
16 /**
17  * A <code>TransferDragSourceListener</code> is a <code>DragSourceListener</code>
18  * that can handle one type of SWT {@link Transfer}.
19  * The purpose of a <code>TransferDragSourceListener</code> is to:
20  * <ul>
21  * <li>Determine enablement for a drag operation. A <code>TransferDragSourceListener</code>
22  * will not be used in a drag operation if the <code>DragSourceEvent#doit</code> field
23  * is set to false in <code>DragSourceListener#dragStart(DragSourceEvent)</code>.
24  * <li>Set data for a single type of drag and <code>Transfer</code> type.
25  * </ul>
26  * <p>
27  * A <code>DelegatingDragAdapter</code> allows these functions to be implemented
28  * separately for unrelated types of drags. <code>DelegatingDragAdapter</code> then
29  * combines the function of each <code>TransferDragSourceListener</code>, while
30  * allowing them to be implemented as if they were the only <code>DragSourceListener</code>.
31  * </p>
32  * @since 3.0
33  */

34 public interface TransferDragSourceListener extends DragSourceListener {
35     /**
36      * Returns the <code>Transfer</code> type that this listener can provide data for.
37      *
38      * @return the <code>Transfer</code> associated with this listener
39      */

40     Transfer getTransfer();
41 }
42
Popular Tags