@@ -0,0 +1,951 @@
+/*-%0A * Copyright 2015 Diamond Light Source Ltd.%0A *%0A * All rights reserved. This program and the accompanying materials%0A * are made available under the terms of the Eclipse Public License v1.0%0A * which accompanies this distribution, and is available at%0A * http://www.eclipse.org/legal/epl-v10.html%0A */%0A%0Apackage org.eclipse.dawnsci.analysis.api.tree;%0A%0Apublic class TreeUtils %7B%0A%0A%09/**%0A%09 * Get the path%0A%09 * @param tree%0A%09 * @param node%0A%09 * @return path to node, return null if not found%0A%09 */%0A%09public static String getPath(Tree tree, Node node) %7B%0A%09%09return getPathDepthFirst(tree.getGroupNode(), node);%0A%09%7D%0A%0A%09private static String getPathDepthFirst(final GroupNode group, final Node node) %7B%0A%09%09for (NodeLink l : group) %7B%0A%09%09%09if (l.getDestination() == node) %7B%0A%09%09%09%09return l.getFullName();%0A%09%09%09%7D else if (l.isDestinationGroup()) %7B%0A%09%09%09%09String p = getPathDepthFirst((GroupNode) l.getDestination(), node);%0A%09%09%09%09if (p != null)%0A%09%09%09%09%09return p;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return null;%0A%09%7D%0A%7D%0A

Add helper method to find the path to a node in a tree