Class DataTreeClipboardUtils


  • public class DataTreeClipboardUtils
    extends java.lang.Object
    Manages Ghidra integration with the system clipboard when doing cut/copy/paste operations on domainFiles and domainFolders in a data tree widget.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void clearCuttables()
      Clears the isCut flag on any GTreeNodes that are pointed to by the system clipboard.
      static void clearCuttables​(java.awt.datatransfer.Transferable transferable)
      Clears the isCut flag on any GTreeNodes that are pointed to by the specified Transferable
      static java.util.List<GTreeNode> getDataTreeNodesFromClipboard()
      Fetches any GTreeNodes from the system clipboard.
      static boolean isCuttablePresent()
      Returns true if the system clipboard has any GTreeNodes that have the Cuttable.isCut() flag set.
      static void setClipboardContents​(DataTree tree, javax.swing.tree.TreePath[] paths)
      Pushes the GTreeNodes in the specified TreePath array to the clipboard.
      • Methods inherited from class java.lang.Object

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

      • DataTreeClipboardUtils

        public DataTreeClipboardUtils()
    • Method Detail

      • setClipboardContents

        public static void setClipboardContents​(DataTree tree,
                                                javax.swing.tree.TreePath[] paths)
        Pushes the GTreeNodes in the specified TreePath array to the clipboard.
        Parameters:
        tree - DataTree that contains the GTreeNodes
        paths - array of TreePaths containing nodes to be pushed to clipboard.
      • clearCuttables

        public static void clearCuttables()
        Clears the isCut flag on any GTreeNodes that are pointed to by the system clipboard.
      • clearCuttables

        public static void clearCuttables​(java.awt.datatransfer.Transferable transferable)
        Clears the isCut flag on any GTreeNodes that are pointed to by the specified Transferable
        Parameters:
        transferable - contains clipboard contents
      • isCuttablePresent

        public static boolean isCuttablePresent()
        Returns true if the system clipboard has any GTreeNodes that have the Cuttable.isCut() flag set.
        Returns:
        boolean true if there are any cut nodes in the clipboard
      • getDataTreeNodesFromClipboard

        public static java.util.List<GTreeNode> getDataTreeNodesFromClipboard()
        Fetches any GTreeNodes from the system clipboard.
        Returns:
        List of GTreeNodes that were in the system clipboard, or empty list if no nodes or some other access error.