Class DragAndDropSelectionListener

java.lang.Object
com._1c.g5.v8.dt.form.service.dnd.DragAndDropSelectionListener
All Implemented Interfaces:
IDragAndDropListener
Direct Known Subclasses:
DragAndDropWysiwygListener

public abstract class DragAndDropSelectionListener extends Object implements IDragAndDropListener
Listener of drag-and-drop events when some IStructuredSelection is being dragged.
  • Constructor Details

    • DragAndDropSelectionListener

      public DragAndDropSelectionListener(Form sourceForm, List<IDropDelegate> delegates)
      Creates new listener instance.
      Parameters:
      delegates - the drop delegates which will process the drop events
  • Method Details

    • isTransferDataSupported

      public boolean isTransferDataSupported(org.eclipse.swt.dnd.TransferData transferData)
      Returns whether specified transfer data is supported by this listener.
      Parameters:
      transferData - transfer data to check
      Returns:
      true if transfer data is supported, false otherwise
    • getTransfer

      public FormElementTransfer getTransfer()
      Returns transfer object associated with this listener.
      Returns:
      transfer object
    • setSourceForm

      public void setSourceForm(Form form)
    • onDragStart

      public void onDragStart(org.eclipse.swt.dnd.DragSourceEvent event)
      Description copied from interface: IDragAndDropListener
      Called when dragStart event is being initiated.
      Specified by:
      onDragStart in interface IDragAndDropListener
      Parameters:
      event - the drag source event, cannot be null
    • onDragEnter

      public void onDragEnter(org.eclipse.swt.dnd.DropTargetEvent event)
      Description copied from interface: IDragAndDropListener
      Called when dragEnter event is being initiated.
      Specified by:
      onDragEnter in interface IDragAndDropListener
      Parameters:
      event - the drop target event, cannot be null
    • onDragLeave

      public void onDragLeave(org.eclipse.swt.dnd.DropTargetEvent event)
      Description copied from interface: IDragAndDropListener
      Called when dragLeave event is being initiated.
      Specified by:
      onDragLeave in interface IDragAndDropListener
      Parameters:
      event - the drop target event, cannot be null
    • onDragOver

      public void onDragOver(org.eclipse.swt.dnd.DropTargetEvent event)
      Description copied from interface: IDragAndDropListener
      Called when dragOver event is being initiated.
      Specified by:
      onDragOver in interface IDragAndDropListener
      Parameters:
      event - the drop target event, cannot be null
    • onDrop

      public void onDrop(org.eclipse.swt.dnd.DropTargetEvent event)
      Description copied from interface: IDragAndDropListener
      Called when drop event is being initiated.
      Specified by:
      onDrop in interface IDragAndDropListener
      Parameters:
      event - the drop target event, cannot be null
    • getTransferObjectsToDrag

      protected abstract Collection<TransferObject<?>> getTransferObjectsToDrag(org.eclipse.swt.dnd.DragSourceEvent event)
      Returns collection of the TransferObject to be dragged. Called when dragStart event is being initiated.
      Parameters:
      event - the drag source event
      Returns:
      collection of the TransferObject to be dragged or null if nothing to drag
    • findDropDelegate

      protected IDropDelegate findDropDelegate(Collection<TransferObject<?>> transferObjects, DropEvent event)
      Returns drop delegate which supports the given selection.
      Parameters:
      transferObjects - the TransferObject for which to find supported drop delegate
      event - drop target event
      Returns:
      the drop delegate found or null
    • getTransferSelection

      protected Collection<TransferObject<?>> getTransferSelection()
      Returns current transfer objects.
      Returns:
      collection of the TransferObject
    • getSourceForm

      protected Form getSourceForm()
      Returns source form.
      Returns:
      source form