org.fest.swing.finder
Class FrameFinder

java.lang.Object
  extended by org.fest.swing.finder.ComponentFinderTemplate<T>
      extended by org.fest.swing.finder.WindowFinderTemplate<Frame>
          extended by org.fest.swing.finder.FrameFinder

public class FrameFinder
extends WindowFinderTemplate<Frame>

Understands a finder for Frames. This class cannot be used directly, please see WindowFinder.

Author:
Alex Ruiz, Yvonne Wang

Constructor Summary
protected FrameFinder(Class<? extends Frame> frameType)
          Creates a new FrameFinder.
protected FrameFinder(GenericTypeMatcher<? extends Frame> matcher)
          Creates a new FrameFinder.
protected FrameFinder(String frameName)
          Creates a new FrameFinder.
 
Method Summary
protected  Frame cast(Component c)
          Casts the given Component to Frame.
 FrameFixture using(Robot robot)
          Finds a Frame by name or type.
 FrameFinder withTimeout(long timeout)
          Sets the timeout for this finder.
 FrameFinder withTimeout(long timeout, TimeUnit unit)
          Sets the timeout for this finder.
 
Methods inherited from class org.fest.swing.finder.ComponentFinderTemplate
findComponentWith
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FrameFinder

protected FrameFinder(String frameName)
Creates a new FrameFinder.

Parameters:
frameName - the name of the Frame to look for.

FrameFinder

protected FrameFinder(GenericTypeMatcher<? extends Frame> matcher)
Creates a new FrameFinder.

Parameters:
matcher - specifies the search criteria to use when looking up a Frame.

FrameFinder

protected FrameFinder(Class<? extends Frame> frameType)
Creates a new FrameFinder.

Parameters:
frameType - the type of Frame to look for.
Method Detail

withTimeout

public FrameFinder withTimeout(long timeout)
Sets the timeout for this finder. The window to search should be found within the given time period.

Overrides:
withTimeout in class WindowFinderTemplate<Frame>
Parameters:
timeout - the number of milliseconds before stopping the search.
Returns:
this finder.

withTimeout

public FrameFinder withTimeout(long timeout,
                               TimeUnit unit)
Sets the timeout for this finder. The window to search should be found within the given time period.

Overrides:
withTimeout in class WindowFinderTemplate<Frame>
Parameters:
timeout - the period of time the search should be performed.
unit - the time unit for timeout.
Returns:
this finder.

using

public FrameFixture using(Robot robot)
Finds a Frame by name or type.

Specified by:
using in class WindowFinderTemplate<Frame>
Parameters:
robot - contains the underlying finding to delegate the search to.
Returns:
a FrameFixture managing the found Frame.
Throws:
WaitTimedOutError - if a Frame could not be found.

cast

protected Frame cast(Component c)
Casts the given Component to Frame.

Specified by:
cast in class ComponentFinderTemplate<Frame>
Parameters:
c - the given Component.
Returns:
the given Component, casted to Frame.


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