diff org.eclipse.jface/src/org/eclipse/jface/util/TransferDragSourceListener.d @ 12:bc29606a740c

Added dwt-addons in original directory structure of eclipse.org
author Frank Benoit <benoit@tionex.de>
date Sat, 14 Mar 2009 18:23:29 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.jface/src/org/eclipse/jface/util/TransferDragSourceListener.d	Sat Mar 14 18:23:29 2009 +0100
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 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
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.jface.util.TransferDragSourceListener;
+
+import org.eclipse.swt.dnd.DragSourceListener;
+import org.eclipse.swt.dnd.Transfer;
+
+import java.lang.all;
+import java.util.Set;
+
+/**
+ * A <code>TransferDragSourceListener</code> is a <code>DragSourceListener</code>
+ * that can handle one type of SWT {@link Transfer}.
+ * The purpose of a <code>TransferDragSourceListener</code> is to:
+ * <ul>
+ *   <li>Determine enablement for a drag operation. A <code>TransferDragSourceListener</code>
+ *  will not be used in a drag operation if the <code>DragSourceEvent#doit</code> field
+ *  is set to false in <code>DragSourceListener#dragStart(DragSourceEvent)</code>.
+ *   <li>Set data for a single type of drag and <code>Transfer</code> type.
+ * </ul>
+ * <p>
+ * A <code>DelegatingDragAdapter</code> allows these functions to be implemented
+ * separately for unrelated types of drags. <code>DelegatingDragAdapter</code> then
+ * combines the function of each <code>TransferDragSourceListener</code>, while
+ * allowing them to be implemented as if they were the only <code>DragSourceListener</code>.
+ * </p>
+ * @since 3.0
+ */
+public interface TransferDragSourceListener : DragSourceListener {
+    /**
+     * Returns the <code>Transfer</code> type that this listener can provide data for.
+     *
+     * @return the <code>Transfer</code> associated with this listener
+     */
+    Transfer getTransfer();
+}