Class 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.
    • 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
    • Constructor Detail

      • DragDropUtils

        public DragDropUtils()
    • 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 DropTarget
        url - the Text control where to set the link text