org.fest.swing.core
Class WindowAncestorFinder

java.lang.Object
  extended by org.fest.swing.core.WindowAncestorFinder

public final class WindowAncestorFinder
extends Object

Understands lookup of a component's ancestor.

Author:
Yvonne Wang

Method Summary
static Window windowAncestorOf(Component c)
          Similar to SwingUtilities.getWindowAncestor(Component), but returns the Component itself if it is a Window, or the invoker's Window if on a pop-up.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

windowAncestorOf

@RunsInCurrentThread
public static Window windowAncestorOf(Component c)
Similar to SwingUtilities.getWindowAncestor(Component), but returns the Component itself if it is a Window, or the invoker's Window if on a pop-up.

Note: This method is not guaranteed to be executed in the event dispatch thread (EDT.) Clients are responsible for calling this method from the EDT.

Parameters:
c - the Component to get the Window ancestor of.
Returns:
the Window ancestor of the given Component, the Component itself if it is a Window, or the invoker's Window if on a pop-up.


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