| Constructor and Description |
|---|
NodeQueryImpl() |
| Modifier and Type | Method and Description |
|---|---|
NodeQuery |
from(java.util.Collection<javafx.scene.Node> parentNodes)
Stores all given
parentNodes within this NodeQuery. |
NodeQuery |
from(javafx.scene.Node... parentNodes)
Stores all given
parentNodes within this NodeQuery. |
NodeQuery |
lookup(java.util.function.Function<javafx.scene.Node,java.util.Set<javafx.scene.Node>> function)
Sifts through stored nodes and uses
function to determine which nodes to keep and which to remove. |
<T> NodeQuery |
lookup(org.hamcrest.Matcher<T> matcher)
Sifts through stored nodes and keeps only those
Nodes that match the given matcher. |
<T extends javafx.scene.Node> |
lookup(java.util.function.Predicate<T> predicate)
Sifts through stored nodes and keeps only those
Nodes that pass the given predicate. |
NodeQuery |
lookup(java.lang.String query)
Sifts through stored nodes by their id ("#id"), their class (".class"), or the text it has ("text"),
depending on the query used, and keeps only those
Nodes that meet the query. |
<T> NodeQuery |
match(org.hamcrest.Matcher<T> matcher)
Sifts through stored nodes and keeps only those
Nodes that match the given matcher. |
<T extends javafx.scene.Node> |
match(java.util.function.Predicate<T> predicate)
Sifts through stored nodes and keeps only those
Nodes that pass the given predicate. |
NodeQuery |
nth(int index)
Keeps the nth
Node in stored nodes and removes all others. |
<T extends javafx.scene.Node> |
query()
Executes this
NodeQuery and returns the first Node found that matches
this query. |
<T extends javafx.scene.Node> |
queryAll()
Executes this
NodeQuery and returns the Set of all the Nodes that
match this query. |
<T extends javafx.scene.Node> |
queryAllAs(java.lang.Class<T> clazz)
Type-safe version of
NodeQuery.queryAll() that executes this NodeQuery and returns
the Set of all the Nodes that match this query. |
<T extends javafx.scene.Node> |
queryAs(java.lang.Class<T> clazz)
Type-safe version of
NodeQuery.query() that executes this NodeQuery and returns
the first Node found that matches this query. |
java.lang.String |
toString() |
<T extends javafx.scene.Node> |
tryQuery()
Executes this
NodeQuery and returns an Optional that either contains
the first Node found that matches this query or nothing (e.g. |
<T extends javafx.scene.Node> |
tryQueryAs(java.lang.Class<T> clazz)
Type-safe version of
NodeQuery.tryQuery() that executes this NodeQuery and returns an
Optional that either contains the first Node found that matches this query or
nothing (e.g. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitqueryButton, queryComboBox, queryLabeled, queryListView, queryParent, queryTableView, queryText, queryTextFlow, queryTextInputControlpublic NodeQuery from(javafx.scene.Node... parentNodes)
NodeQueryparentNodes within this NodeQuery.public NodeQuery from(java.util.Collection<javafx.scene.Node> parentNodes)
NodeQueryparentNodes within this NodeQuery.public NodeQuery lookup(java.lang.String query)
NodeQueryNodes that meet the query.public <T> NodeQuery lookup(org.hamcrest.Matcher<T> matcher)
NodeQueryNodes that match the given matcher.public <T extends javafx.scene.Node> NodeQuery lookup(java.util.function.Predicate<T> predicate)
NodeQueryNodes that pass the given predicate.public NodeQuery lookup(java.util.function.Function<javafx.scene.Node,java.util.Set<javafx.scene.Node>> function)
NodeQueryfunction to determine which nodes to keep and which to remove.public <T> NodeQuery match(org.hamcrest.Matcher<T> matcher)
NodeQueryNodes that match the given matcher.public <T extends javafx.scene.Node> NodeQuery match(java.util.function.Predicate<T> predicate)
NodeQueryNodes that pass the given predicate.public NodeQuery nth(int index)
NodeQueryNode in stored nodes and removes all others.public <T extends javafx.scene.Node> T query()
NodeQueryNodeQuery and returns the first Node found that matches
this query. If no nodes match this query then an EmptyNodeQueryException is thrown.
The determinism of this method relies on the determinism of Node.lookupAll(String),
for which the JavaDocs specifically state that the result is unordered. The current (9.0.4)
version of JavaFX happens to return the nodes in the order in which they are encountered whilst
traversing the scene graph but this could change in future versions of JavaFX. Thus if there are
multiple nodes matched by this query and you want a specific one it is advised not to use this
method and instead narrow the query so that only one node is matched.
public <T extends javafx.scene.Node> T queryAs(java.lang.Class<T> clazz)
NodeQueryNodeQuery.query() that executes this NodeQuery and returns
the first Node found that matches this query. If no nodes match this query then
an EmptyNodeQueryException is thrown.
The determinism of this method relies on the determinism of Node.lookupAll(String),
for which the JavaDocs specifically state that the result is unordered. The current (9.0.4)
version of JavaFX happens to return the nodes in the order in which they are encountered whilst
traversing the scene graph but this could change in future versions of JavaFX. Thus if there are
multiple nodes matched by this query and you want a specific one it is advised not to use this
method and instead narrow the query so that only one node is matched.
queryAs in interface NodeQueryT - the type that extends Nodeclazz - the concrete sub-type of Node that should be returned by this query
so as to avoid extraneous casting when used inside an "assertThat" assertionpublic <T extends javafx.scene.Node> java.util.Optional<T> tryQuery()
NodeQueryNodeQuery and returns an Optional that either contains
the first Node found that matches this query or nothing (e.g. Optional.empty()
returns true) if no nodes match this query.
The determinism of this method relies on the determinism of Node.lookupAll(String),
for which the JavaDocs specifically state that the result is unordered. The current (9.0.4)
version of JavaFX happens to return the nodes in the order in which they are encountered whilst
traversing the scene graph but this could change in future versions of JavaFX. Thus if there are
multiple nodes matched by this query and you want a specific one it is advised not to use this
method and instead narrow the query so that only one node is matched.
public <T extends javafx.scene.Node> java.util.Optional<T> tryQueryAs(java.lang.Class<T> clazz)
NodeQueryNodeQuery.tryQuery() that executes this NodeQuery and returns an
Optional that either contains the first Node found that matches this query or
nothing (e.g. Optional.empty() returns true) if no nodes match this query.
The determinism of this method relies on the determinism of Node.lookupAll(String),
for which the JavaDocs specifically state that the result is unordered. The current (9.0.4)
version of JavaFX happens to return the nodes in the order in which they are encountered whilst
traversing the scene graph but this could change in future versions of JavaFX. Thus if there are
multiple nodes matched by this query and you want a specific one it is advised not to use this
method and instead narrow the query so that only one node is matched.
tryQueryAs in interface NodeQueryT - the type that extends Nodeclazz - the concrete sub-type of Node that should be contained in the
Optional returned by this query so as to avoid extraneous casting when used inside
an "assertThat" assertionOptional if the query does not match any nodespublic <T extends javafx.scene.Node> java.util.Set<T> queryAll()
NodeQueryNodeQuery and returns the Set of all the Nodes that
match this query. If no nodes match this query, the empty set is returned.public <T extends javafx.scene.Node> java.util.Set<T> queryAllAs(java.lang.Class<T> clazz)
NodeQueryNodeQuery.queryAll() that executes this NodeQuery and returns
the Set of all the Nodes that match this query. If no nodes match this query,
the empty set is returned.queryAllAs in interface NodeQueryT - the type that extends Nodeclazz - the concrete sub-type of Node the set of which should be returned by
this query so as to avoid extraneous casting when used inside an "assertThat" assertionpublic java.lang.String toString()
toString in class java.lang.Object