Package eu.simuline.testhelpers
Class GUIRunner.TreePathIterator
- java.lang.Object
-
- eu.simuline.testhelpers.GUIRunner.TreePathIterator
-
- Enclosing class:
- GUIRunner
static class GUIRunner.TreePathIterator extends java.lang.ObjectRepresents a pathcurrPathin the tree of testsuites represented bytreeModel. This is initialized bysetFirstPath()to the uppermost complete path, can be incremented viaincPath()and be returned bygetPath().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classGUIRunner.TreePathIterator.TreePathUpdaterExpands the tree along the current path, forGUIRunner.TreePathIterator.TreePathUpdater.Genericafter incrementing the current path.
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.tree.TreePathcurrPathprivate javax.swing.tree.TreeModeltreeModelA model of the tree of testsuites and tests.private GUIRunner.TreePathIterator.TreePathUpdatertreePathUpdaterDecides how to update the current path: For the first path, just inkoke ***** .
-
Constructor Summary
Constructors Constructor Description TreePathIterator(javax.swing.JTree tree, int index)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) javax.swing.tree.TreePathgetPath()(package private) javax.swing.tree.TreePathincPath()IncrementscurrPathand returns the result.(package private) static javax.swing.tree.TreePathprolonguePath(javax.swing.tree.TreePath path)Prolongues path as long as possible in each step with 0th child.(package private) voidsetFirstPath()private intshortenPath()ReplacescurrPathremoving the last node as long as the last node in the path is the last child of the last but one node and after having done this returns the index of the last node as a child of the last but one node.(package private) voidupdatePathI()
-
-
-
Field Detail
-
treeModel
private final javax.swing.tree.TreeModel treeModel
A model of the tree of testsuites and tests.
-
currPath
private javax.swing.tree.TreePath currPath
-
treePathUpdater
private GUIRunner.TreePathIterator.TreePathUpdater treePathUpdater
Decides how to update the current path: For the first path, just inkoke ***** .
-
-
Method Detail
-
updatePathI
void updatePathI()
-
setFirstPath
void setFirstPath()
-
prolonguePath
static javax.swing.tree.TreePath prolonguePath(javax.swing.tree.TreePath path)
Prolongues path as long as possible in each step with 0th child.
-
shortenPath
private int shortenPath()
ReplacescurrPathremoving the last node as long as the last node in the path is the last child of the last but one node and after having done this returns the index of the last node as a child of the last but one node.CAUTION: This method shall be invoked only if
currPathcan be incremented.- Throws:
java.lang.NullPointerException- ifcurrPathcannot be incremented.
-
incPath
javax.swing.tree.TreePath incPath()
IncrementscurrPathand returns the result.
-
getPath
javax.swing.tree.TreePath getPath()
-
-