Package docking.widgets.tree

# Class GTreeTask

java.lang.Object
ghidra.util.worker.Job
ghidra.util.worker.PriorityJob
docking.widgets.tree.GTreeTask

Direct Known Subclasses:
  `GTreeBulkTask`, `GTreeClearSelectionTask`, `GTreeClearTreeFilterTask`, `GTreeCollapseAllTask`, `GTreeExpandAllTask`, `GTreeExpandNodeToDepthTask`, `GTreeExpandPathsTask`, `GTreeFilterTask`, `GTreeLoadChildrenTask`, `GTreeRestoreTreeStateTask`, `GTreeSelectNodeByNameTask`, `GTreeSelectPathsTask`, `GTreeStartEditingTask`

public abstract class GTreeTask extends PriorityJob

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final JTree`
  `jTree`
  `protected GTree`
  `tree`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `GTreeTask(GTree tree)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `runOnSwingThread(Runnable runnable)`
  `protected void`
  `setTaskMonitor(TaskMonitor monitor)`
  `protected TreePath`
  `translatePath(TreePath path, TaskMonitor monitor)`
  This method allows us to take a TreePath from a previous tree and apply that path to a new tree (or a tree that has been reloaded with new nodes).

  ### Methods inherited from class ghidra.util.worker.PriorityJob

  `getID, getPriority`

  ### Methods inherited from class ghidra.util.worker.Job

  `cancel, getError, hasError, isCancelled, isCompleted, run, setCompleted, setError`

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

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

- ## Field Details

  - ### tree

    protected GTree tree

  - ### jTree

    protected final JTree jTree

- ## Constructor Details

  - ### GTreeTask

    protected GTreeTask(GTree tree)

- ## Method Details

  - ### setTaskMonitor

    protected void setTaskMonitor(TaskMonitor monitor)
    Overrides:
      `setTaskMonitor` in class `Job`

  - ### runOnSwingThread

    public void runOnSwingThread(Runnable runnable)

  - ### translatePath

    protected TreePath translatePath(TreePath path, TaskMonitor monitor)
    This method allows us to take a TreePath from a previous tree and apply that path to a new tree (or a tree that has been reloaded with new nodes). This method is required due to the fact that JTree allows you to set any path values, valid or not, and will return those path values on later calls to getSelectedPaths(). So, to handle that 'feature' of the JTree, we need to translate the given path to the equivalent path in the current tree (this code may not be needed in all uses of this task, but it protects us from the aforementioned case).
    Parameters:
      `path` - the path to translate
      `monitor` - the monitor
    Returns:
      the translated path