- java.lang.Object
-
- org.testfx.util.NodeQueryUtils
-
public final class NodeQueryUtils extends Object
-
-
Method Summary
Modifier and Type Method Description static Function<javafx.scene.Node,Set<javafx.scene.Node>>
byMatcher(org.hamcrest.Matcher<javafx.scene.Node> matcher)
Returns a function that returns aSet
of allNode
s that match the givenmatcher
.static Function<javafx.scene.Node,Set<javafx.scene.Node>>
byPredicate(Predicate<javafx.scene.Node> predicate)
Returns a function that returns aSet
of allNode
s that pass the givenpredicate
.static Function<javafx.scene.Node,Set<javafx.scene.Node>>
bySelector(String selector)
Returns a function that callsNode.lookup(String)
on each given node.static Function<javafx.scene.Node,Set<javafx.scene.Node>>
byText(String text)
Returns a function that returns aSet
of allLabel
s,TextInputControl
s, or any of their subclasses that have the giventext
.static Function<javafx.scene.Node,Set<javafx.scene.Node>>
combine(Function<javafx.scene.Node,Set<javafx.scene.Node>> function0, Function<javafx.scene.Node,Set<javafx.scene.Node>> function1)
Returns a function that returns aSet
of allNode
s that maps the given node byfunction0
and then byfunction1)
.static Predicate<javafx.scene.Node>
hasId(String id)
Returns a predicate that returns true if the node's id equals the givenid
.static Predicate<javafx.scene.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<javafx.scene.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<javafx.scene.Node>
matchesMatcher(org.hamcrest.Matcher<javafx.scene.Node> matcher)
Returns a predicate that returns true if the given node matches the givenmatcher
.static Set<javafx.scene.Node>
rootOfPopupControl(javafx.scene.control.PopupControl... popupControls)
Returns a set of the given popup controls' scenes' root nodes.static Set<javafx.scene.Node>
rootOfScene(javafx.scene.Scene... scenes)
Returns a set of the given scenes' root nodes.static Set<javafx.scene.Node>
rootOfStage(javafx.stage.Stage... stages)
Returns a set of the given stages' scenes' root nodes.static Set<javafx.scene.Node>
rootOfWindow(javafx.stage.Window... windows)
Returns a set of the given windows' scenes' root nodes.static Set<javafx.scene.Node>
rootsOfWindows(Collection<javafx.stage.Window> windows)
Returns a set of the given windows' scenes' root nodes.
-
-
-
Method Detail
-
rootsOfWindows
public static Set<javafx.scene.Node> rootsOfWindows(Collection<javafx.stage.Window> windows)
Returns a set of the given windows' scenes' root nodes.
-
rootOfWindow
public static Set<javafx.scene.Node> rootOfWindow(javafx.stage.Window... windows)
Returns a set of the given windows' scenes' root nodes.
-
rootOfStage
public static Set<javafx.scene.Node> rootOfStage(javafx.stage.Stage... stages)
Returns a set of the given stages' scenes' root nodes.
-
rootOfScene
public static Set<javafx.scene.Node> rootOfScene(javafx.scene.Scene... scenes)
Returns a set of the given scenes' root nodes.
-
rootOfPopupControl
public static Set<javafx.scene.Node> rootOfPopupControl(javafx.scene.control.PopupControl... popupControls)
Returns a set of the given popup controls' scenes' root nodes.
-
bySelector
public static Function<javafx.scene.Node,Set<javafx.scene.Node>> bySelector(String selector)
Returns a function that callsNode.lookup(String)
on each given node.
-
byPredicate
public static Function<javafx.scene.Node,Set<javafx.scene.Node>> byPredicate(Predicate<javafx.scene.Node> predicate)
Returns a function that returns aSet
of allNode
s that pass the givenpredicate
.
-
byMatcher
public static Function<javafx.scene.Node,Set<javafx.scene.Node>> byMatcher(org.hamcrest.Matcher<javafx.scene.Node> matcher)
Returns a function that returns aSet
of allNode
s that match the givenmatcher
.
-
byText
public static Function<javafx.scene.Node,Set<javafx.scene.Node>> byText(String text)
Returns a function that returns aSet
of allLabel
s,TextInputControl
s, or any of their subclasses that have the giventext
.
-
hasId
public static Predicate<javafx.scene.Node> hasId(String id)
Returns a predicate that returns true if the node's id equals the givenid
.
-
hasText
public static Predicate<javafx.scene.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<javafx.scene.Node> matchesMatcher(org.hamcrest.Matcher<javafx.scene.Node> matcher)
Returns a predicate that returns true if the given node matches the givenmatcher
.
-
isVisible
public static Predicate<javafx.scene.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
-
combine
public static Function<javafx.scene.Node,Set<javafx.scene.Node>> combine(Function<javafx.scene.Node,Set<javafx.scene.Node>> function0, Function<javafx.scene.Node,Set<javafx.scene.Node>> function1)
Returns a function that returns aSet
of allNode
s that maps the given node byfunction0
and then byfunction1)
.
-
-