Package-level declarations

Types

Link copied to clipboard

A lazy handle to the single component targeted by a query. The target is resolved against the live AWT tree each time it is needed, so it always reflects the current tree after recomposition.

Link copied to clipboard

A lazy handle to the set of components matched by a query. The match set is resolved against the live AWT tree each time it is needed, so it reflects the current tree.

Link copied to clipboard

A lazy handle to the single top-level window targeted by a window query. The target is resolved against the live set of realized windows each time it is needed, so it always reflects windows appearing and disappearing across recomposition.

Link copied to clipboard

A lazy handle to the set of realized windows matched by a window query. The match set is resolved against the live set of realized windows each time it is needed, so it reflects windows appearing and disappearing across recomposition.

Functions

Link copied to clipboard
fun <T : Component, V> SwingNodeInteraction<T>.assertProperty(expected: V, message: String? = null, actual: T.() -> V): SwingNodeInteraction<T>

Asserts that the value actual reads off the matched node equals expected, and returns this interaction for chaining.

Link copied to clipboard
suspend fun <T : Component> SwingNodeInteraction<T>.assertTreeMatches(expected: Component, allowSubclasses: Boolean = true): SwingNodeInteraction<T>

Asserts that the matched node and expected describe the same user interface - the same widgets, nested the same way, holding the same state - and returns this interaction for chaining.

Link copied to clipboard

Returns a handle to the matched node's ancestors, nearest first, up to and including the root the node was found under. A node that is itself a root yields an empty collection.

Link copied to clipboard

Returns a handle to the matched node's only direct child. Resolution fails unless the node holds exactly one child.

Link copied to clipboard

Returns a handle to the matched node's direct child at index. Convenience for onChildren()[index].

Link copied to clipboard

Returns a handle to the matched node's children, in their container's order. A node with no children yields an empty collection.

Link copied to clipboard

Returns a handle to every component below the matched node, at any depth, in depth-first pre-order. The node itself is excluded, which is how a query scopes to one subtree:

Link copied to clipboard

Returns a handle to the parent of the matched node.

Link copied to clipboard

Returns a handle to the matched node's only sibling. Resolution fails unless the node's parent holds exactly two children.

Link copied to clipboard

Returns a handle to the matched node's siblings: every other child of its parent, in the parent's order. A node with no parent yields an empty collection.

Link copied to clipboard
suspend fun <T : Component> SwingNodeInteraction<T>.performClick(position: Point? = null, button: Int = MouseEvent.BUTTON1, clicks: Int = 1, modifiers: Int = 0): SwingNodeInteraction<T>

Clicks the primary mouse button on the matched node at position, then settles the composition. position defaults to the middle of the node, in the node's own coordinates.

Link copied to clipboard

Makes the platform's context-menu gesture on the matched node at position, then settles the composition. position defaults to the middle of the node, in the node's own coordinates.

Link copied to clipboard

Delivers the event event builds for the matched node, then settles the composition.

Link copied to clipboard

Delivers a focus-gained notification to the matched node and settles the composition.

Link copied to clipboard

Delivers a focus-lost notification to the matched node and settles the composition.

Link copied to clipboard
suspend fun <T : Component> SwingNodeInteraction<T>.performKeyPress(keyCode: Int, modifiers: Int = 0): SwingNodeInteraction<T>

Presses and releases the key keyCode on the matched node, holding modifiers for both, then settles the composition. keyCode is a KeyEvent.VK_* constant and modifiers a mask of InputEvent.*_DOWN_MASK values, empty by default.

Link copied to clipboard

Drags the primary mouse button across the matched node from from to to, then settles the composition. Both points are in the node's own coordinates.

Link copied to clipboard

Brings the pointer onto the matched node at position and settles the composition. position defaults to the middle of the node, in the node's own coordinates.

Link copied to clipboard

Takes the pointer off the matched node at position and settles the composition. position defaults to the middle of the node, in the node's own coordinates.

Link copied to clipboard

Moves the pointer to position over the matched node, then settles the composition. position is in the node's own coordinates.

Link copied to clipboard

Presses the primary mouse button on the matched node at position, then settles the composition. position defaults to the middle of the node, in the node's own coordinates.

Link copied to clipboard

Releases the primary mouse button on the matched node at position, then settles the composition. position defaults to the middle of the node, in the node's own coordinates.

Link copied to clipboard
suspend fun <T : Component> SwingNodeInteraction<T>.performMouseWheel(rotation: Int, position: Point? = null): SwingNodeInteraction<T>

Turns the mouse wheel over the matched node by rotation notches - negative away from the user, positive toward them - then settles the composition. position defaults to the middle of the node, in the node's own coordinates.

Link copied to clipboard

Clicks the tab at index on the matched JTabbedPane and settles the composition.

Link copied to clipboard

Types text onto the end of the matched JTextComponent's current content, then settles the composition.

Link copied to clipboard

Pastes text into the matched JTextComponent over its current selection, then settles the composition.

Link copied to clipboard

Replaces the matched JTextComponent's entire content with text, then settles the composition.

Link copied to clipboard

Types text on the matched node one character at a time, then settles the composition.