org.fest.swing.core
Class TypeMatcher

java.lang.Object
  extended by org.fest.swing.core.AbstractComponentMatcher
      extended by org.fest.swing.core.TypeMatcher
All Implemented Interfaces:
ComponentMatcher, ResettableComponentMatcher

public final class TypeMatcher
extends AbstractComponentMatcher

Understands Component matching by type.

Author:
Alex Ruiz

Constructor Summary
TypeMatcher(Class<? extends Component> type)
          Creates a new TypeMatcher.
TypeMatcher(Class<? extends Component> type, boolean requireShowing)
          Creates a new TypeMatcher.
 
Method Summary
 boolean matches(Component c)
          Indicates whether the type and visibility of the given Component matches the value specified in this matcher.
 String toString()
           
 
Methods inherited from class org.fest.swing.core.AbstractComponentMatcher
requireShowing, requireShowing, requireShowingMatches, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TypeMatcher

public TypeMatcher(Class<? extends Component> type)
Creates a new TypeMatcher. The component to match does not have to be showing.

Parameters:
type - the type of the component we are looking for.
Throws:
NullPointerException - if the given type is null.

TypeMatcher

public TypeMatcher(Class<? extends Component> type,
                   boolean requireShowing)
Creates a new TypeMatcher.

Parameters:
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 type is null.
Method Detail

matches

@RunsInCurrentThread
public boolean matches(Component c)
Indicates whether the type and visibility of the given Component matches the value specified in this matcher.

Note: This method is not guaranteed to be executed in the event dispatch thread (EDT.) Clients are responsible for calling this method from the EDT.

Parameters:
c - the Component to verify.
Returns:
true if the type and visibility of the given Component matches the values specified in this matcher, false otherwise.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.