- java.lang.Object
-
- org.testfx.util.NodeQueryUtils
-
public final class NodeQueryUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Function<Node,Set<Node>>byMatcher(org.hamcrest.Matcher<Node> matcher)Returns a function that returns aSetof allNodes that match the givenmatcher.static Function<Node,Set<Node>>byPredicate(Predicate<Node> predicate)Returns a function that returns aSetof allNodes that pass the givenpredicate.static Function<Node,Set<Node>>bySelector(String selector)Returns a function that callsNode.lookup(String)on each given node.static Function<Node,Set<Node>>byText(String text)Returns a function that returns aSetof allLabels,TextInputControls, or any of their subclasses that have the giventext.static Function<Node,Set<Node>>combine(Function<Node,Set<Node>> function0, Function<Node,Set<Node>> function1)Returns a function that returns aSetof allNodes that maps the given node byfunction0and then byfunction1).static Predicate<Node>hasId(String id)Returns a predicate that returns true if the node's id equals the givenid.static Predicate<Node>hasText(String text)Returns a predicate that returns true if the node is aLabel,TextInputControl, or any of their subclasses whose text equals the giventext.static Predicate<Node>isVisible()Returns a predicate that returns true if the given node is visible, the given tree is visible, or the node's local bounds are within its scene's boundsstatic Predicate<Node>matchesMatcher(org.hamcrest.Matcher<Node> matcher)Returns a predicate that returns true if the given node matches the givenmatcher.static Set<Node>rootOfPopupControl(PopupControl... popupControls)Returns a set of the given popup controls' scenes' root nodes.static Set<Node>rootOfScene(Scene... scenes)Returns a set of the given scenes' root nodes.static Set<Node>rootOfStage(Stage... stages)Returns a set of the given stages' scenes' root nodes.static Set<Node>rootOfWindow(Window... windows)Returns a set of the given windows' scenes' root nodes.static Set<Node>rootsOfWindows(Collection<Window> windows)Returns a set of the given windows' scenes' root nodes.
-
-
-
Method Detail
-
rootsOfWindows
public static Set<Node> rootsOfWindows(Collection<Window> windows)
Returns a set of the given windows' scenes' root nodes.
-
rootOfWindow
public static Set<Node> rootOfWindow(Window... windows)
Returns a set of the given windows' scenes' root nodes.
-
rootOfStage
public static Set<Node> rootOfStage(Stage... stages)
Returns a set of the given stages' scenes' root nodes.
-
rootOfScene
public static Set<Node> rootOfScene(Scene... scenes)
Returns a set of the given scenes' root nodes.
-
rootOfPopupControl
public static Set<Node> rootOfPopupControl(PopupControl... popupControls)
Returns a set of the given popup controls' scenes' root nodes.
-
bySelector
public static Function<Node,Set<Node>> bySelector(String selector)
Returns a function that callsNode.lookup(String)on each given node.
-
byPredicate
public static Function<Node,Set<Node>> byPredicate(Predicate<Node> predicate)
Returns a function that returns aSetof allNodes that pass the givenpredicate.
-
byMatcher
public static Function<Node,Set<Node>> byMatcher(org.hamcrest.Matcher<Node> matcher)
Returns a function that returns aSetof allNodes that match the givenmatcher.
-
byText
public static Function<Node,Set<Node>> byText(String text)
Returns a function that returns aSetof allLabels,TextInputControls, or any of their subclasses that have the giventext.
-
hasId
public static Predicate<Node> hasId(String id)
Returns a predicate that returns true if the node's id equals the givenid.
-
hasText
public static Predicate<Node> hasText(String text)
Returns a predicate that returns true if the node is aLabel,TextInputControl, or any of their subclasses whose text equals the giventext.
-
matchesMatcher
public static Predicate<Node> matchesMatcher(org.hamcrest.Matcher<Node> matcher)
Returns a predicate that returns true if the given node matches the givenmatcher.
-
isVisible
public static Predicate<Node> isVisible()
Returns a predicate that returns true if the given node is visible, the given tree is visible, or the node's local bounds are within its scene's bounds
-
-