public final class DialogMatcher extends NamedComponentMatcherTemplate<Dialog>
Dialog
by name, title and visibility on the screen.ANY, name
Modifier and Type | Method and Description |
---|---|
DialogMatcher |
andShowing()
Indicates that the
to match should be showing on the screen. |
DialogMatcher |
andTitle(Pattern titlePattern)
Specifies the title to match.
|
DialogMatcher |
andTitle(String newTitle)
Specifies the title to match.
|
static DialogMatcher |
any()
Creates a new
that matches any . |
protected boolean |
isMatching(Dialog dialog)
Indicates whether:
the name of the given
Dialog is equal to the name in this matcher, and
the title of the given Dialog matches the text (or pattern) in this matcher
|
String |
toString() |
static DialogMatcher |
withName(String name)
Creates a new
that matches a that:
has a matching name
(optionally) has matching title
(optionally) is showing on the screen |
static DialogMatcher |
withTitle(Pattern titlePattern)
Creates a new
that matches a by its title. |
static DialogMatcher |
withTitle(String title)
Creates a new
that matches a by its title. |
arePropertyValuesMatching, isNameMatching, quoted, quotedName
matches, supportedType
requireShowing, requireShowing, requireShowingMatches, reset
public static DialogMatcher withName(String name)
DialogMatcher
that matches a Dialog
that:
The following code listing shows how to match a
by name and title:
Dialog
DialogMatcher m =withName
("saveFile").andTitle
("Save File");
The following code listing shows how to match a
, that should be showing on the screen,
by name and title:
Dialog
DialogMatcher m =withName
("saveFile").andTitle
("Save File").andShowing
();
name
- the id to match.public static DialogMatcher withTitle(String title)
DialogMatcher
that matches a Dialog
by its title.
The following code listing shows how to match a
title:
Dialog
DialogMatcher m = withTitle
("Save File");
The following code listing shows how to match a
, that should be showing on the screen,
by title:
Dialog
DialogMatcher m =withTitle
("Save File").andShowing
();
title
- the title to match. It can be a regular expression.public static DialogMatcher withTitle(Pattern titlePattern)
DialogMatcher
that matches a Dialog
by its title.
The following code listing shows how to match a
title, using a regular expression
pattern:
Dialog
DialogMatcher m = withTitle
(Pattern.compile("Sav.*"));
The following code listing shows how to match a
, that should be showing on the screen,
by title, using a regular expression pattern:
Dialog
DialogMatcher m =withTitle
(Pattern.compile("Sav.*")).andShowing
();
titlePattern
- the regular expression pattern to match.public static DialogMatcher any()
DialogMatcher
that matches any Dialog
.public DialogMatcher andTitle(String newTitle)
withTitle(String)
or
withTitle(Pattern)
, this method will simply update the title to match.newTitle
- the new title to match. It can be a regular expression.public DialogMatcher andTitle(Pattern titlePattern)
withTitle(String)
, or
withTitle(Pattern)
this method will simply update the title to match.titlePattern
- the regular expression pattern to match.public DialogMatcher andShowing()
Dialog
to match should be showing on the screen.@RunsInCurrentThread protected boolean isMatching(Dialog dialog)
Dialog
is equal to the name in this matcher, andDialog
matches the text (or pattern) in this matcherNote: This method is not guaranteed to be executed in the event dispatch thread (EDT.) Clients are responsible for calling this method from the EDT.
isMatching
in class GenericTypeMatcher<Dialog>
dialog
- the Dialog
to match.true
if the Dialog
matches the search criteria in this matcher.Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.