Class DialogMatcher
java.lang.Object
com.install4j.api.test.ui.DialogMatcher
- All Implemented Interfaces:
Serializable
Predicate over modal-dialog windows, used by
Session.dialog(DialogMatcher) to identify
the dialog the test wants to interact with. Serializable so it can be evaluated installer-side
in subprocess mode without sending a raw Predicate<Window> across the wire.
Build a matcher by chaining factory and combinator methods:
DialogMatcher.byClassName("com.example.MyDialog").andTitleRegex("Confirm.*")
DialogMatcher.byTitle("Save changes?")
DialogMatcher.dialogClass(JDialog.class).andContainingComponentNamed("yesButton")
A matcher only inspects window-side state: class, title (for JDialog/JFrame),
and the names of components in the window's component tree. It does not run arbitrary code on
the window; that would be wire-hostile.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionandClassName(String fqClassName) Narrow by class name.andContainingComponentNamed(String swingName) Narrow to dialogs that contain a child component with the given Swing name.Narrow by exact title.andTitleRegex(String regex) Narrow by title regex.static DialogMatcherany()A matcher that accepts any modal dialog window.static DialogMatcherbyClassName(String fqClassName) Match by the window's runtime class name (fully qualified).static DialogMatcherMatch by exact title (forJDialog/JFrame).static DialogMatcherbyTitleRegex(String regex) Match by title regex.static DialogMatcherdialogClass(Class<?> dialogClass) Convenience forbyClassName(String)from aClassliteral.booleanWhether the given currently-showing window matches every constraint on this matcher.toString()
-
Method Details
-
any
A matcher that accepts any modal dialog window. -
byClassName
Match by the window's runtime class name (fully qualified). -
dialogClass
Convenience forbyClassName(String)from aClassliteral. -
byTitle
Match by exact title (forJDialog/JFrame). -
byTitleRegex
Match by title regex. The pattern is matched against the window's title. -
andClassName
Narrow by class name. -
andTitle
Narrow by exact title. -
andTitleRegex
Narrow by title regex. -
andContainingComponentNamed
Narrow to dialogs that contain a child component with the given Swing name. -
matches
-
toString
-