Package ghidra.framework.main.datatree
Class DataTreeDragNDropHandler
java.lang.Object
ghidra.framework.main.datatree.DataTreeDragNDropHandler
- All Implemented Interfaces:
GTreeDragNDropHandler,GTreeTransferHandler
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddActiveDataFlavorHandler(DataFlavor flavor, DataTreeFlavorHandler handler) voiddrop(GTreeNode destination, Transferable transferable, int dropAction) Add the given transferable's data to the destination user data.getSupportedDataFlavors(List<GTreeNode> transferNodes) Returns the DataFlavors for the types of data that this transferable supports, based upon the given selection.intReturns the supported Drag actions for this tree.getTransferData(List<GTreeNode> transferNodes, DataFlavor flavor) Gets the transfer data from the selection based upon the given flavor.booleanisDropSiteOk(GTreeNode destUserData, DataFlavor[] flavors, int dropAction) Return true if the drop site is valid for the given target.booleanisStartDragOk(List<GTreeNode> dragUserData, int dragAction) Return true if the dragUserData can be dragged.static DataTreeFlavorHandlervoidsetProjectActive(boolean b)
-
Field Details
-
localDomainFileTreeFlavor
-
localDomainFileFlavor
-
allSupportedFlavors
-
-
Method Details
-
drop
Description copied from interface:GTreeDragNDropHandlerAdd the given transferable's data to the destination user data.- Specified by:
dropin interfaceGTreeDragNDropHandler- 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:GTreeDragNDropHandlerReturns the supported Drag actions for this tree. For available actions seeDnDConstants.- Specified by:
getSupportedDragActionsin interfaceGTreeDragNDropHandler- Returns:
- the supported Drag actions.
-
isDropSiteOk
Description copied from interface:GTreeDragNDropHandlerReturn true if the drop site is valid for the given target.- Specified by:
isDropSiteOkin interfaceGTreeDragNDropHandler- Parameters:
destUserData- destination for node being draggedflavors- flavor(s) being draggeddropAction- user action for drop operation- Returns:
- true if the drop site is valid for the given target
-
isStartDragOk
Description copied from interface:GTreeDragNDropHandlerReturn true if the dragUserData can be dragged.- Specified by:
isStartDragOkin interfaceGTreeDragNDropHandler- Parameters:
dragUserData- data where user is initiating the drag operationdragAction- user action for the drag operation- Returns:
- true if the dragUserData can be dragged
-
getSupportedDataFlavors
Description copied from interface:GTreeTransferHandlerReturns the DataFlavors for the types of data that this transferable supports, based upon the given selection.- Specified by:
getSupportedDataFlavorsin interfaceGTreeTransferHandler- 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:GTreeTransferHandlerGets the transfer data from the selection based upon the given flavor.- Specified by:
getTransferDatain interfaceGTreeTransferHandler- 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 byGTreeTransferHandler.getSupportedDataFlavors(List).
-
addActiveDataFlavorHandler
-
removeActiveDataFlavorHandler
-
setProjectActive
public void setProjectActive(boolean b)
-