org.fest.swing.driver
Class ComponentShownWaiter

java.lang.Object
  extended by java.awt.event.ComponentAdapter
      extended by org.fest.swing.driver.ComponentShownWaiter
All Implemented Interfaces:
ComponentListener, EventListener

public final class ComponentShownWaiter
extends ComponentAdapter

Understands waiting for a Component to be shown.

Author:
Alex Ruiz

Method Summary
 void componentShown(ComponentEvent e)
          Notification that the component to wait for is finally shown on the screen.
static void waitTillShown(Component toWaitFor)
          Waits until the given component is shown on the screen, using a timeout of 5 seconds.
static void waitTillShown(Component toWaitFor, long timeout)
          Waits until the given component is shown on the screen.
 
Methods inherited from class java.awt.event.ComponentAdapter
componentHidden, componentMoved, componentResized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

waitTillShown

public static void waitTillShown(Component toWaitFor)
Waits until the given component is shown on the screen, using a timeout of 5 seconds.

Parameters:
toWaitFor - the component to wait for.
Throws:
WaitTimedOutError - if the component is not shown before the default timeout of 5 seconds.

waitTillShown

public static void waitTillShown(Component toWaitFor,
                                 long timeout)
Waits until the given component is shown on the screen.

Parameters:
toWaitFor - the component to wait for.
timeout - the amount to time (in milliseconds) to wait for the component to be shown.
Throws:
WaitTimedOutError - if the component is not shown before the given timeout expires.

componentShown

@RunsInEDT
public void componentShown(ComponentEvent e)
Notification that the component to wait for is finally shown on the screen.

Specified by:
componentShown in interface ComponentListener
Overrides:
componentShown in class ComponentAdapter
Parameters:
e - the event raised when the component has been made visible.


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