Package ghidra.framework.main.datatree

# Class DataTreeDragNDropHandler

java.lang.Object
ghidra.framework.main.datatree.DataTreeDragNDropHandler

All Implemented Interfaces:
  `GTreeDragNDropHandler`, `GTreeTransferHandler`

public class DataTreeDragNDropHandler extends Object implements GTreeDragNDropHandler

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static DataFlavor[]`
  `allSupportedFlavors`
  `static DataFlavor`
  `localDomainFileFlavor`
  `static DataFlavor`
  `localDomainFileTreeFlavor`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `addActiveDataFlavorHandler(DataFlavor flavor, DataTreeFlavorHandler handler)`
  `void`
  `drop(GTreeNode destination, Transferable transferable, int dropAction)`
  Add the given transferable's data to the destination user data.
  `DataFlavor[]`
  `getSupportedDataFlavors(List<GTreeNode> transferNodes)`
  Returns the DataFlavors for the types of data that this transferable supports, based upon the given selection.
  `int`
  `getSupportedDragActions()`
  Returns the supported Drag actions for this tree.
  `Object`
  `getTransferData(List<GTreeNode> transferNodes, DataFlavor flavor)`
  Gets the transfer data from the selection based upon the given flavor.
  `boolean`
  `isDropSiteOk(GTreeNode destUserData, DataFlavor[] flavors, int dropAction)`
  Return true if the drop site is valid for the given target.
  `boolean`
  `isStartDragOk(List<GTreeNode> dragUserData, int dragAction)`
  Return true if the dragUserData can be dragged.
  `static DataTreeFlavorHandler`
  `removeActiveDataFlavorHandler(DataFlavor flavor)`
  `void`
  `setProjectActive(boolean b)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### localDomainFileTreeFlavor

    public static DataFlavor localDomainFileTreeFlavor

  - ### localDomainFileFlavor

    public static DataFlavor localDomainFileFlavor

  - ### allSupportedFlavors

    public static DataFlavor[] allSupportedFlavors

- ## Method Details

  - ### drop

    public void drop(GTreeNode destination, Transferable transferable, int dropAction)
    Description copied from interface: `GTreeDragNDropHandler`
    Add the given transferable's data to the destination user data.
    Specified by:
      `drop` in interface `GTreeDragNDropHandler`
    Parameters:
      `destination` - destination node for the data.
      `transferable` - the transferable being dragged whose data will be dropped.
      `dropAction` - user action for drop operation

  - ### getSupportedDragActions

    public int getSupportedDragActions()
    Description copied from interface: `GTreeDragNDropHandler`
    Returns the supported Drag actions for this tree. For available actions see `DnDConstants`.
    Specified by:
      `getSupportedDragActions` in interface `GTreeDragNDropHandler`
    Returns:
      the supported Drag actions.

  - ### isDropSiteOk

    public boolean isDropSiteOk(GTreeNode destUserData, DataFlavor[] flavors, int dropAction)
    Description copied from interface: `GTreeDragNDropHandler`
    Return true if the drop site is valid for the given target.
    Specified by:
      `isDropSiteOk` in interface `GTreeDragNDropHandler`
    Parameters:
      `destUserData` - destination for node being dragged
      `flavors` - flavor(s) being dragged
      `dropAction` - user action for drop operation

  - ### isStartDragOk

    public boolean isStartDragOk(List<GTreeNode> dragUserData, int dragAction)
    Description copied from interface: `GTreeDragNDropHandler`
    Return true if the dragUserData can be dragged.
    Specified by:
      `isStartDragOk` in interface `GTreeDragNDropHandler`
    Parameters:
      `dragUserData` - data where user is initiating the drag operation
      `dragAction` - user action for the drag operation

  - ### getSupportedDataFlavors

    public DataFlavor[] getSupportedDataFlavors(List<GTreeNode> transferNodes)
    Description copied from interface: `GTreeTransferHandler`
    Returns the DataFlavors for the types of data that this transferable supports, based upon the given selection.
    Specified by:
      `getSupportedDataFlavors` in interface `GTreeTransferHandler`
    Parameters:
      `transferNodes` - The nodes to base the DataFlavor selection upon.
    Returns:
      the DataFlavors for the types of data that this transferable supports, based upon the given selection.

  - ### getTransferData

    public Object getTransferData(List<GTreeNode> transferNodes, DataFlavor flavor) throws UnsupportedFlavorException
    Description copied from interface: `GTreeTransferHandler`
    Gets the transfer data from the selection based upon the given flavor.
    Specified by:
      `getTransferData` in interface `GTreeTransferHandler`
    Parameters:
      `transferNodes` - The nodes from which to get the data.
      `flavor` - The flavor of data to retrieve from the given selection.
    Returns:
      the transfer data from the selection based upon the given flavor.
    Throws:
      `UnsupportedFlavorException` - if the given flavor is not one of the supported flavors returned by `GTreeTransferHandler.getSupportedDataFlavors(List)`.

  - ### addActiveDataFlavorHandler

    public static void addActiveDataFlavorHandler(DataFlavor flavor, DataTreeFlavorHandler handler)

  - ### removeActiveDataFlavorHandler

    public static DataTreeFlavorHandler removeActiveDataFlavorHandler(DataFlavor flavor)

  - ### setProjectActive

    public void setProjectActive(boolean b)