Class FSBActionContext

java.lang.Object
docking.DefaultActionContext
ghidra.plugins.fsbrowser.FSBActionContext
All Implemented Interfaces:
ActionContext

public class FSBActionContext extends DefaultActionContext
FileSystemBrowserPlugin-specific action.
  • Constructor Details

    • FSBActionContext

      public FSBActionContext(ghidra.plugins.fsbrowser.FileSystemBrowserComponentProvider provider, FSBNode[] selectedNodes, MouseEvent event, GTree gTree)
      Creates a new FileSystemBrowserPlugin-specific action context.
      Parameters:
      provider - the ComponentProvider that generated this context.
      selectedNodes - selected nodes in the tree
      event - MouseEvent that caused the update, or null
      gTree - FileSystemBrowserPlugin provider tree.
  • Method Details

    • notBusy

      public boolean notBusy()
      Returns true if the GTree is not busy
      Returns:
      boolean true if GTree is not busy
    • isBusy

      public boolean isBusy()
      Returns true if the GTree is busy
      Returns:
      boolean true if the GTree is busy
    • getTree

      public GTree getTree()
      Gets the FileSystemBrowserPlugin provider's tree.
      Returns:
      The FileSystemBrowserPlugin provider's tree.
    • hasSelectedNodes

      public boolean hasSelectedNodes()
      Returns true if there are selected nodes in the browser tree.
      Returns:
      boolean true if there are selected nodes in the browser tree
    • getSelectedNodes

      public List<FSBNode> getSelectedNodes()
      Returns a list of the currently selected tree nodes.
      Returns:
      list of currently selected tree nodes
    • getFSRL

      public FSRL getFSRL(boolean dirsOk)
      Returns the FSRL of the currently selected item, as long as it conforms to the dirsOk requirement.
      Parameters:
      dirsOk - boolean flag, if true the selected item can be either a file or directory element, if false, it must be a file or the root of a file system that has a container file
      Returns:
      FSRL of the single selected item, null if no items selected or more than 1 item selected
    • isSelectedAllDirs

      public boolean isSelectedAllDirs()
      Returns true if the currently selected items are all directory items
      Returns:
      boolean true if the currently selected items are all directory items
    • getSelectedNode

      public FSBNode getSelectedNode()
      Returns the currently selected tree node
      Returns:
      the currently selected tree node, or null if no nodes or more than 1 node is selected
    • getRootOfSelectedNode

      public FSBRootNode getRootOfSelectedNode()
      Returns the FSBRootNode that contains the currently selected tree node.
      Returns:
      FSBRootNode that contains the currently selected tree node, or null nothing selected
    • getSelectedCount

      public int getSelectedCount()
      Returns the number of selected nodes in the tree.
      Returns:
      returns the number of selected nodes in the tree.
    • getFSRLs

      public List<FSRL> getFSRLs(boolean dirsOk)
      Returns a list of FSRLs of the currently selected nodes in the tree.
      Parameters:
      dirsOk - boolean flag, if true the selected items can be either a file or directory element, if false, it must be a file or the root of a file system that has a container file before being included in the resulting list
      Returns:
      list of FSRLs of the currently selected items, maybe empty but never null
    • getFileFSRLs

      public List<FSRL> getFileFSRLs()
      Returns a list of FSRLs of the currently selected file nodes in the tree.
      Returns:
      list of FSRLs of the currently selected file items, maybe empty but never null
    • getFileFSRL

      public FSRL getFileFSRL()
      Returns the FSRL of the currently selected file node
      Returns:
      FSRL of the currently selected file, or null if not file or more than 1 selected
    • getFormattedTreePath

      public String getFormattedTreePath()
      Converts the tree-node hierarchy of the currently selected item into a string path using "/" separators.
      Returns:
      string path of the currently selected tree item
    • getLoadableFSRL

      public FSRL getLoadableFSRL()
      Returns the FSRL of the currently selected item, if it is a 'loadable' item.
      Returns:
      FSRL of the currently selected loadable item, or null if nothing selected or more than 1 selected
    • getLoadableFSRLs

      public List<FSRL> getLoadableFSRLs()
      Returns a list of FSRLs of the currently selected loadable items.
      Returns:
      list of FSRLs of currently selected loadable items, maybe empty but never null