Package org.fest.swing.core
Class GenericTypeMatcher<T extends Component>
java.lang.Object
org.fest.swing.core.AbstractComponentMatcher
org.fest.swing.core.GenericTypeMatcher<T>
- Type Parameters:
T- the type ofComponentsupported by this matcher.
- All Implemented Interfaces:
ComponentMatcher,ResettableComponentMatcher
- Direct Known Subclasses:
NamedComponentMatcherTemplate
Understands a
ComponentMatcher that matches a Component by type and some
custom search criteria.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGenericTypeMatcher(Class<T> supportedType) Creates a newGenericTypeMatcher.GenericTypeMatcher(Class<T> supportedType, boolean requireShowing) Creates a newGenericTypeMatcher. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleanisMatching(T component) Verifies that the given component matches some search criteria.final booleanVerifies that the given: Is an instance of the generic type specified in thisComponentMatches some search criteriaComponentMatcherReturns the supported type of this matcher.Methods inherited from class org.fest.swing.core.AbstractComponentMatcher
requireShowing, requireShowing, requireShowingMatches, reset
-
Field Details
-
supportedType
-
-
Constructor Details
-
GenericTypeMatcher
Creates a newGenericTypeMatcher. The component to match does not have to be showing.- Parameters:
supportedType- the type supported by this matcher.- Throws:
NullPointerException- if the given type isnull.
-
GenericTypeMatcher
Creates a newGenericTypeMatcher.- Parameters:
supportedType- the type supported by this matcher.requireShowing- indicates if the component to match should be showing or not.- Throws:
NullPointerException- if the given type isnull.
-
-
Method Details
-
matches
Verifies that the given:Component- Is an instance of the generic type specified in this
ComponentMatcher - Matches some search criteria
Note: 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 givenComponentis an instance of the generic type of this matcher and matches some search criteria. Otherwise,false.
- Is an instance of the generic type specified in this
-
supportedType
Returns the supported type of this matcher.- Returns:
- the supported type of this matcher.
-
isMatching
Verifies that the given component matches some search criteria.Note: Implementations of this method should not use the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.
- Parameters:
component- theComponentto verify.- Returns:
trueif the given component matches the defined search criteria; otherwise,false.
-