Class DragDropUtils

java.lang.Object
com.biglybt.ui.swt.utils.DragDropUtils

public class DragDropUtils extends 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 Details

    • DROPDATA_PREFIX_TAG_UID

      public static final String DROPDATA_PREFIX_TAG_UID
      See Also:
    • lastDraggedObject

      private static Object lastDraggedObject
  • Constructor Details

    • DragDropUtils

      public DragDropUtils()
  • Method Details

    • createDragSource

      public static org.eclipse.swt.dnd.DragSource createDragSource(org.eclipse.swt.widgets.Control control, int style)
    • getLastDraggedObject

      public static Object getLastDraggedObject()
    • getDownloadsFromDropData

      public static List<DownloadManager> getDownloadsFromDropData(Object dropData, boolean includeFileDrops)
    • getTagsFromDroppedData

      public static List<Tag> getTagsFromDroppedData(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)
    • createDropTarget

      public static void createDropTarget(org.eclipse.swt.widgets.Composite composite, boolean bAllowShareAdd, org.eclipse.swt.custom.StyledText 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
    • createURLDropTarget

      public static void createURLDropTarget(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.custom.StyledText url)