Class AbstractComponentMatcher

java.lang.Object
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.
  • Field Details

    • requireShowing

      private boolean requireShowing
  • Constructor Details

    • AbstractComponentMatcher

      public AbstractComponentMatcher()
    • AbstractComponentMatcher

      public AbstractComponentMatcher(boolean requireShowing)
      Parameters:
      requireShowing - indicates if the component to match should be showing or not.
  • Method Details

    • 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 executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in 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