org.fest.swing.core
Class AbstractComponentMatcher

java.lang.Object
  extended by org.fest.swing.core.AbstractComponentMatcher
All Implemented Interfaces:
ComponentMatcher, ResettableComponentMatcher
Direct Known Subclasses:
GenericTypeMatcher, LabelMatcher, NameMatcher, TypeMatcher

public abstract class AbstractComponentMatcher
extends Object
implements ResettableComponentMatcher

Understands a base class for implementations of ResettableComponentMatcher.

Author:
Yvonne Wang, Alex Ruiz

Constructor Summary
AbstractComponentMatcher()
          Creates a new AbstractComponentMatcher.
AbstractComponentMatcher(boolean requireShowing)
          Creates a new AbstractComponentMatcher.
 
Method Summary
protected  boolean requireShowing()
          Indicates whether the component to match has to be showing.
protected  void requireShowing(boolean shouldBeShowing)
          Updates the value of the flag that indicates if the component to match should be showing or not.
protected  boolean requireShowingMatches(Component c)
          Indicates if the value of the "showing" property of the given component matches the value specified in this matcher.
 void reset(boolean matchFound)
          Resets the internal state of this matcher.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.fest.swing.core.ComponentMatcher
matches
 

Constructor Detail

AbstractComponentMatcher

public AbstractComponentMatcher()
Creates a new AbstractComponentMatcher.


AbstractComponentMatcher

public AbstractComponentMatcher(boolean requireShowing)
Creates a new AbstractComponentMatcher.

Parameters:
requireShowing - indicates if the component to match should be showing or not.
Method Detail

requireShowing

protected final boolean requireShowing()
Indicates whether the component to match has to be showing.

Returns:
true if the component to find has to be showing, false otherwise.

requireShowing

protected final void requireShowing(boolean shouldBeShowing)
Updates the value of the flag that indicates if the component to match should be showing or not.

Parameters:
shouldBeShowing - the new value to set.

requireShowingMatches

@RunsInCurrentThread
protected final boolean requireShowingMatches(Component c)
Indicates if the value of the "showing" property 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 value of the "isShowing" property of the given component matches the value specified in this matcher, false otherwise.

reset

public void reset(boolean matchFound)
Resets the internal state of this matcher.

Specified by:
reset in interface ResettableComponentMatcher
Parameters:
matchFound - indicates whether a match has been found before resetting.
Since:
1.2


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