Java JTree Path resourceFromTreePath(TreePath path)

Here you can find the source of resourceFromTreePath(TreePath path)

Description

resource From Tree Path

License

Open Source License

Declaration

public static String resourceFromTreePath(TreePath path) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.tree.TreePath;

public class Main {
    public static String resourceFromTreePath(TreePath path) {
        StringBuilder resource = new StringBuilder("");
        if (path.getPathCount() > 1) {
            for (int i = 2; i < path.getPathCount(); i++) {
                if (i > 2) {
                    resource.append('/');
                }/*from  ww  w.ja  v a  2  s  .  com*/
                resource.append(path.getPathComponent(i).toString());
            }
        }
        return resource.toString();
    }
}

Related

  1. makeLocalFilePath(TreePath treePath)
  2. makeTreePath(TreeNode treeNode)
  3. pathByAddingChildAsStr(TreePath currPath, String child)
  4. pathContains(TreePath[] paths, Class clazz)
  5. pathToDepth(TreePath path, int depth)
  6. restoreSelectionPath(JTree parentTree)
  7. searchForNodeV2(TreeNode node, String query, JTree tree, TreePath actualPath, boolean isRoot)
  8. selectCategoryTreePath(JTree tree, TreePath treePath)
  9. setTreeState(@Nonnull final JTree tree, @Nonnull final TreePath path, final boolean recursively, final boolean unfold)