junit.extensions.jfcunit.finder
Class JFileChooserFinder

java.lang.Object
  extended byjunit.extensions.jfcunit.finder.Finder
      extended byjunit.extensions.jfcunit.finder.ComponentFinder
          extended byjunit.extensions.jfcunit.finder.JFileChooserFinder

public class JFileChooserFinder
extends ComponentFinder

This class locates the JFileChooser with the given title. The container may be the window which owns the JFileChooser. Owned windows will be explored.

Author:
Kevin L Wilson

Field Summary
private  java.lang.String m_title
          Title to be compared.
 
Fields inherited from class junit.extensions.jfcunit.finder.ComponentFinder
 
Fields inherited from class junit.extensions.jfcunit.finder.Finder
OP_CONTAINS, OP_ENDSWITH, OP_EQUALS, OP_MATCH, OP_STARTSWITH
 
Constructor Summary
JFileChooserFinder(java.lang.String title)
          Constructor accepting all arguments needed to filter component.
 
Method Summary
 java.awt.Component find(java.awt.Container[] conts, int index)
          Find all of the components under the specified containers.
protected  java.util.List findAll(java.awt.Container[] cont, java.util.List results)
          This findAll will also explore the owned windows if a container is a window.
 java.lang.String getTitle()
          Get the title to be matched.
 void setTitle(java.lang.String title)
          Set the title to be matched.
 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.ComponentFinder
getComponentClass, setComponentClass
 
Methods inherited from class junit.extensions.jfcunit.finder.Finder
createPatternMatcher, evaluate, find, find, find, 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_title

private java.lang.String m_title
Title to be compared.

Constructor Detail

JFileChooserFinder

public JFileChooserFinder(java.lang.String title)
Constructor accepting all arguments needed to filter component.

Parameters:
title - The desired pattern for the title of the component.
Method Detail

setTitle

public final void setTitle(java.lang.String title)
Set the title to be matched.

Parameters:
title - to be matched.

getTitle

public final java.lang.String getTitle()
Get the title to be matched.

Returns:
title to be found.

testComponent

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

Overrides:
testComponent in class ComponentFinder
Parameters:
comp - The component to test
Returns:
true if this component is a match

find

public java.awt.Component find(java.awt.Container[] conts,
                               int index)
Find all of the components under the specified containers. owned windows will also be explored.

Overrides:
find in class Finder
Parameters:
conts - Container[] to be searched.
index - int index of chooser to return.
Returns:
Component JFileChooser located.

findAll

protected java.util.List findAll(java.awt.Container[] cont,
                                 java.util.List results)
This findAll will also explore the owned windows if a container is a window.

Overrides:
findAll in class Finder
Parameters:
cont - Containers to be explored.
results - items which have been found.
Returns:
List result items.


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