Package com.biglybt.ui.swt.utils
Class DragDropUtils
- java.lang.Object
-
- com.biglybt.ui.swt.utils.DragDropUtils
-
public class DragDropUtils extends java.lang.Object
While dragging over an widget, we don't get the data that will be dropped. This utility class overcomes this by monitoring drag start events and storing it for retrieval in drop events.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
DragDropUtils.DragSourceListenerDelegate
private static class
DragDropUtils.DragSourceMonitored
private static class
DragDropUtils.URLDropTarget
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DROPDATA_PREFIX_TAG_UID
private static java.lang.Object
lastDraggedObject
-
Constructor Summary
Constructors Constructor Description DragDropUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.eclipse.swt.dnd.DragSource
createDragSource(org.eclipse.swt.widgets.Control control, int style)
static void
createDropTarget(org.eclipse.swt.widgets.Composite composite, boolean bAllowShareAdd, org.eclipse.swt.widgets.Text url)
private static void
createDropTarget(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.dnd.DropTargetListener dropTargetListener)
static void
createTorrentDropTarget(org.eclipse.swt.widgets.Composite composite, boolean bAllowShareAdd)
static void
createURLDropTarget(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.widgets.Text url)
static java.util.List<DownloadManager>
getDownloadsFromDropData(java.lang.Object dropData, boolean includeFileDrops)
static java.lang.Object
getLastDraggedObject()
static java.util.List<Tag>
getTagsFromDroppedData(java.lang.Object dropData)
-
-
-
Field Detail
-
DROPDATA_PREFIX_TAG_UID
public static final java.lang.String DROPDATA_PREFIX_TAG_UID
- See Also:
- Constant Field Values
-
lastDraggedObject
private static java.lang.Object lastDraggedObject
-
-
Method Detail
-
createDragSource
public static org.eclipse.swt.dnd.DragSource createDragSource(org.eclipse.swt.widgets.Control control, int style)
-
getLastDraggedObject
public static java.lang.Object getLastDraggedObject()
-
getDownloadsFromDropData
public static java.util.List<DownloadManager> getDownloadsFromDropData(java.lang.Object dropData, boolean includeFileDrops)
-
getTagsFromDroppedData
public static java.util.List<Tag> getTagsFromDroppedData(java.lang.Object dropData)
-
createDropTarget
private static void createDropTarget(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.dnd.DropTargetListener dropTargetListener)
-
createDropTarget
public static void createDropTarget(org.eclipse.swt.widgets.Composite composite, boolean bAllowShareAdd, org.eclipse.swt.widgets.Text url)
-
createTorrentDropTarget
public static void createTorrentDropTarget(org.eclipse.swt.widgets.Composite composite, boolean bAllowShareAdd)
-
createURLDropTarget
public static void createURLDropTarget(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.widgets.Text url)
- Parameters:
composite
- the control (usually a Shell) to add the DropTargeturl
- the Text control where to set the link text
-
-