Class DefaultDNDProvider

  • All Implemented Interfaces:
    DNDProvider

    public class DefaultDNDProvider
    extends java.lang.Object
    implements DNDProvider
    Default implementation of a DNDProvider. This will support local transfers for copy, move and link operations in an EMF environment.
    Author:
    Johannes Faltermeier
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected int getDNDOperations()
      The drag&drop operations which will be returned by getDragOperations() and getDragOperations().
      protected org.eclipse.swt.dnd.Transfer[] getDNDTransferTypes()
      The transfers which will be returned getDragTransferTypes() and getDropTransferTypes().
      org.eclipse.swt.dnd.DragSourceListener getDragListener​(org.eclipse.jface.viewers.TreeViewer treeViewer)
      Returns the DragSourceListener used to setup the drag support for the viewer.
      int getDragOperations()
      Returns the drag operations bits used to setup the drag support for the viewer.
      org.eclipse.swt.dnd.Transfer[] getDragTransferTypes()
      Returns the drag transfer types used to setup the drag support for the viewer.
      org.eclipse.swt.dnd.DropTargetListener getDropListener​(org.eclipse.emf.edit.domain.EditingDomain editingDomain, org.eclipse.jface.viewers.TreeViewer treeViewer)
      Returns the DragSourceListener used to setup the drop support for the viewer.
      int getDropOperations()
      Returns the drag operations bits used to setup the drop support for the viewer.
      org.eclipse.swt.dnd.Transfer[] getDropTransferTypes()
      Returns the drag transfer types used to setup the drop support for the viewer.
      boolean hasDND()
      Whether DND support should be added to the tree.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultDNDProvider

        public DefaultDNDProvider()
    • Method Detail

      • getDragOperations

        public int getDragOperations()
        Description copied from interface: DNDProvider
        Returns the drag operations bits used to setup the drag support for the viewer.
        Specified by:
        getDragOperations in interface DNDProvider
        Returns:
        the drag operations
      • getDragTransferTypes

        public org.eclipse.swt.dnd.Transfer[] getDragTransferTypes()
        Description copied from interface: DNDProvider
        Returns the drag transfer types used to setup the drag support for the viewer.
        Specified by:
        getDragTransferTypes in interface DNDProvider
        Returns:
        the drag transfer types
      • getDragListener

        public org.eclipse.swt.dnd.DragSourceListener getDragListener​(org.eclipse.jface.viewers.TreeViewer treeViewer)
        Description copied from interface: DNDProvider
        Returns the DragSourceListener used to setup the drag support for the viewer.
        Specified by:
        getDragListener in interface DNDProvider
        Parameters:
        treeViewer - the treeviewer
        Returns:
        the listener
      • getDropOperations

        public int getDropOperations()
        Description copied from interface: DNDProvider
        Returns the drag operations bits used to setup the drop support for the viewer.
        Specified by:
        getDropOperations in interface DNDProvider
        Returns:
        the drop operations
      • getDropTransferTypes

        public org.eclipse.swt.dnd.Transfer[] getDropTransferTypes()
        Description copied from interface: DNDProvider
        Returns the drag transfer types used to setup the drop support for the viewer.
        Specified by:
        getDropTransferTypes in interface DNDProvider
        Returns:
        the drop transfer types
      • getDropListener

        public org.eclipse.swt.dnd.DropTargetListener getDropListener​(org.eclipse.emf.edit.domain.EditingDomain editingDomain,
                                                                      org.eclipse.jface.viewers.TreeViewer treeViewer)
        Description copied from interface: DNDProvider
        Returns the DragSourceListener used to setup the drop support for the viewer.
        Specified by:
        getDropListener in interface DNDProvider
        Parameters:
        editingDomain - the editing domain
        treeViewer - the treeviewer
        Returns:
        the listener
      • hasDND

        public boolean hasDND()
        Description copied from interface: DNDProvider
        Whether DND support should be added to the tree.
        Specified by:
        hasDND in interface DNDProvider
        Returns:
        true if DND will be added, based on the other methods of this interface, or false if DND should not be added