public interface NodeQuery
| 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
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
query() that executes this NodeQuery and returns
the first Node found that matches this query. |
default javafx.scene.control.Button |
queryButton()
Executes this
NodeQuery and returns the first Button found that matches
this query. |
default <T> javafx.scene.control.ComboBox<T> |
queryComboBox()
Executes this
NodeQuery and returns the first ComboBox found that matches
this query. |
default javafx.scene.control.Labeled |
queryLabeled()
Executes this
NodeQuery and returns the first Labeled found that matches
this query. |
default <T> javafx.scene.control.ListView<T> |
queryListView()
Executes this
NodeQuery and returns the first ListView found that matches
this query. |
default javafx.scene.Parent |
queryParent()
Executes this
NodeQuery and returns the first Parent found that matches
this query. |
default <T> javafx.scene.control.TableView<T> |
queryTableView()
Executes this
NodeQuery and returns the first TableView found that matches
this query. |
default javafx.scene.text.Text |
queryText()
Executes this
NodeQuery and returns the first Text found that matches
this query. |
default javafx.scene.text.TextFlow |
queryTextFlow()
Executes this
NodeQuery and returns the first TextFlow found that matches
this query. |
default javafx.scene.control.TextInputControl |
queryTextInputControl()
Executes this
NodeQuery and returns the first TextInputControl found that matches
this query. |
<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
tryQuery() that executes this NodeQuery and returns an
Optional that either contains the first Node found that matches this query or
nothing (e.g. |
NodeQuery from(javafx.scene.Node... parentNodes)
parentNodes within this NodeQuery.parentNodes - the parentNodes to storeNodeQuery from(java.util.Collection<javafx.scene.Node> parentNodes)
parentNodes within this NodeQuery.parentNodes - the parentNodes to storeNodeQuery lookup(java.lang.String query)
Nodes that meet the query.query - the query to use<T> NodeQuery lookup(org.hamcrest.Matcher<T> matcher)
Nodes that match the given matcher.T - matcher typematcher - the matcher used to determine which Nodes to keep and which to remove<T extends javafx.scene.Node> NodeQuery lookup(java.util.function.Predicate<T> predicate)
Nodes that pass the given predicate.T - type that extends Nodepredicate - the predicate used to determine which Nodes to keep and which to remove.NodeQuery lookup(java.util.function.Function<javafx.scene.Node,java.util.Set<javafx.scene.Node>> function)
function to determine which nodes to keep and which to remove.function - that returns the Nodes to keep<T> NodeQuery match(org.hamcrest.Matcher<T> matcher)
Nodes that match the given matcher.T - matcher typematcher - that determines which Nodes to keep<T extends javafx.scene.Node> NodeQuery match(java.util.function.Predicate<T> predicate)
Nodes that pass the given predicate.T - predicate typepredicate - that indicates which Nodes to keepNodeQuery nth(int index)
Node in stored nodes and removes all others.index - within the collection of Nodes<T extends javafx.scene.Node> T query()
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.
T - the type that extends NodeEmptyNodeQueryException - if no TextFlow nodes match this querydefault javafx.scene.control.Button queryButton()
NodeQuery and returns the first Button 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.
Button found that matches this query, if anyEmptyNodeQueryException - if no Button nodes match this querydefault <T> javafx.scene.control.ComboBox<T> queryComboBox()
NodeQuery and returns the first ComboBox 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.
ComboBox found that matches this query, if anyEmptyNodeQueryException - if no ComboBox nodes match this querydefault javafx.scene.control.Labeled queryLabeled()
NodeQuery and returns the first Labeled 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.
Labeled found that matches this query, if anyEmptyNodeQueryException - if no Labeled nodes match this querydefault <T> javafx.scene.control.ListView<T> queryListView()
NodeQuery and returns the first ListView 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.
ListView found that matches this query, if anyEmptyNodeQueryException - if no ListView nodes match this querydefault javafx.scene.Parent queryParent()
NodeQuery and returns the first Parent 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.
Parent found that matches this query, if anyEmptyNodeQueryException - if no Parent nodes match this querydefault <T> javafx.scene.control.TableView<T> queryTableView()
NodeQuery and returns the first TableView 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.
TableView found that matches this query, if anyEmptyNodeQueryException - if no TableView nodes match this querydefault javafx.scene.text.Text queryText()
NodeQuery and returns the first Text 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.
Text found that matches this query, if anyEmptyNodeQueryException - if no Text nodes match this querydefault javafx.scene.text.TextFlow queryTextFlow()
NodeQuery and returns the first TextFlow 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.
TextFlow found that matches this query, if anyEmptyNodeQueryException - if no TextFlow nodes match this querydefault javafx.scene.control.TextInputControl queryTextInputControl()
NodeQuery and returns the first TextInputControl 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.
TextInputControl found that matches this query, if anyEmptyNodeQueryException - if no TextInputControl nodes match this query<T extends javafx.scene.Node> T queryAs(java.lang.Class<T> clazz)
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.
T - 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" assertionEmptyNodeQueryException - if no nodes match this query<T extends javafx.scene.Node> java.util.Optional<T> tryQuery()
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.
T - the type that extends NodeOptional if the query does not match any nodes<T extends javafx.scene.Node> java.util.Optional<T> tryQueryAs(java.lang.Class<T> clazz)
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.
T - 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 nodes<T extends javafx.scene.Node> java.util.Set<T> queryAll()
NodeQuery and returns the Set of all the Nodes that
match this query. If no nodes match this query, the empty set is returned.T - the type that extends Node<T extends javafx.scene.Node> java.util.Set<T> queryAllAs(java.lang.Class<T> clazz)
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.T - 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" assertion