Class GTreeTask

    • Field Detail

      • tree

        protected GTree tree
      • jTree

        protected final javax.swing.JTree jTree
    • Constructor Detail

      • GTreeTask

        protected GTreeTask​(GTree tree)
    • Method Detail

      • runOnSwingThread

        public void runOnSwingThread​(java.lang.Runnable runnable)
      • translatePath

        protected javax.swing.tree.TreePath translatePath​(javax.swing.tree.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