junit.extensions.jfcunit.finder
Class ComponentFinder

java.lang.Object
  extended byjunit.extensions.jfcunit.finder.Finder
      extended byjunit.extensions.jfcunit.finder.ComponentFinder
Direct Known Subclasses:
JFileChooserFinder, JInternalFrameFinder

public class ComponentFinder
extends Finder

A generic Component finder which uses just the type (class) for filtering.

Author:
Vijay Aravamudhan : ThoughtWorks Inc.

Field Summary
private  java.lang.Class m_compCls
          The type of the Component.
 
Fields inherited from class junit.extensions.jfcunit.finder.Finder
OP_CONTAINS, OP_ENDSWITH, OP_EQUALS, OP_MATCH, OP_STARTSWITH
 
Constructor Summary
ComponentFinder(java.lang.Class cls)
          Constructor accepting all arguments needed to filter the Component.
 
Method Summary
 java.lang.Class getComponentClass()
          Get the class associated with the finder.
 void setComponentClass(java.lang.Class cls)
          Set the class of the object to be found.
 boolean testComponent(java.awt.Component comp)
          Method that returns true if the given Component matches the search criteria.
 
Methods inherited from class junit.extensions.jfcunit.finder.Finder
createPatternMatcher, evaluate, find, find, find, find, findAll, findAll, findAll, findAll, findComponentList, getDebug, getDefaultWait, getOperation, getOperation, getOperationString, getShowDebug, getWait, isCaseIndependent, isValidForProcessing, matchPattern, matchPattern, matchPattern, pause, recreatePatternMatcher, setCaseIndependent, setDebug, setDefaultWait, setIgnoreVisibility, setOperation, setShowDebug, setWait
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_compCls

private java.lang.Class m_compCls
The type of the Component.

Constructor Detail

ComponentFinder

public ComponentFinder(java.lang.Class cls)
Constructor accepting all arguments needed to filter the Component.

Parameters:
cls - The desired type of the component.
Method Detail

setComponentClass

public final void setComponentClass(java.lang.Class cls)
Set the class of the object to be found.

Parameters:
cls - Class of the objects to be found.

getComponentClass

public final java.lang.Class getComponentClass()
Get the class associated with the finder.

Returns:
Component class to be found by the finder.

testComponent

public boolean testComponent(java.awt.Component comp)
Method that returns true if the given Component matches the search criteria.

Specified by:
testComponent in class Finder
Parameters:
comp - The component to test
Returns:
true if this component is a match


Licensed under: GNU Lesser General Public License, Ver 2.1, February 1999