Package org.fest.swing.core
Class NameMatcher
java.lang.Object
org.fest.swing.core.AbstractComponentMatcher
org.fest.swing.core.NameMatcher
- All Implemented Interfaces:
ComponentMatcher,ResettableComponentMatcher
Understands
Component matching by name and (optionally) by type.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNameMatcher(String name) Creates a new.NameMatcherNameMatcher(String name, boolean requireShowing) Creates a new.NameMatcherNameMatcher(String name, Class<? extends Component> type) Creates a new.NameMatcherNameMatcher(String name, Class<? extends Component> type, boolean requireShowing) Creates a new.NameMatcher -
Method Summary
Methods inherited from class org.fest.swing.core.AbstractComponentMatcher
requireShowing, requireShowing, requireShowingMatches, reset
-
Field Details
-
name
-
type
-
-
Constructor Details
-
NameMatcher
Creates a new. The component to match does not have to be showing.NameMatcher- Parameters:
name- the name of the component we are looking for.- Throws:
NullPointerException- if the given name isnull.IllegalArgumentException- if the given name is empty.
-
NameMatcher
Creates a new.NameMatcher- Parameters:
name- the name of the component we are looking for.requireShowing- indicates if the component to match should be showing or not.- Throws:
NullPointerException- if the given name isnull.IllegalArgumentException- if the given name is empty.
-
NameMatcher
Creates a new. The component to match does not have to be showing.NameMatcher- Parameters:
name- the name of the component we are looking for.type- the type of the component we are looking for.- Throws:
NullPointerException- if the given name is empty.IllegalArgumentException- if the given name is empty.NullPointerException- if the given type isnull.
-
NameMatcher
Creates a new.NameMatcher- Parameters:
name- the name of the component we are looking for.type- the type of the component we are looking for.requireShowing- indicates if the component to match should be showing or not.- Throws:
NullPointerException- if the given name is empty.IllegalArgumentException- if the given name is empty.NullPointerException- if the given type isnull.
-
-
Method Details
-
matches
Indicates whether the name and visibility of the givenmatches the value specified in this matcher.ComponentNote: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.
- Parameters:
c- theComponentto verify.- Returns:
trueif the name and visibility of the givenComponentmatches the values specified in this matcher,falseotherwise.
-
toString
-