Class DndHelper


public class DndHelper extends Object
The drag-drop helper for properties and tree/table viewers.
Christopher Mindus
  • Constructor Details

    • DndHelper

      public DndHelper()
  • Method Details

    • saveNavigatorContentService

      public static void saveNavigatorContentService(INavigatorContentService service)
      Saves the content service from the common navigator.
    • register

      public static void register(Viewer viewer)
      Registers the Viewer for Drag-and-Drop.
    • getViewer

      public static Viewer getViewer(Control control)
      Gets a Viewer from a Control.
      control - control.
      The viewer for the control or null for none.
    • register

      public static void register(int dragOperations, int dropOperations, StructuredViewer viewer)
      Registers the TreeViewer or TableViewer control.
      dragOperations - The supported drag operations.
      dropOperations - The supported drop operations.
      viewer - The TreeViewer or TableViewer, if wrong class, an assert exception is thrown.
    • getActualTarget

      public static IContainer getActualTarget(IResource mouseTarget)
      Returns the actual target of the drop, given the resource under the mouse. If the mouse target is a file, then the drop actually occurs in its parent. If the drop location is before or after the mouse target and feedback is enabled, the target is also the parent.
    • createCommonContentProvider

      public static ITreeContentProvider createCommonContentProvider()
      Creates a common navigator content provider.
    • createCommonLabelProvider

      public static NavigatorDecoratingLabelProviderEx createCommonLabelProvider()
      Creates the common label provider.