abbot.finder
Class AWTHierarchy

java.lang.Object
  extended by abbot.finder.AWTHierarchy
All Implemented Interfaces:
Hierarchy
Direct Known Subclasses:
TestHierarchy

public class AWTHierarchy
extends Object
implements Hierarchy

Provides access to the current AWT hierarchy.


Field Summary
protected static Collection EMPTY
           
protected static WindowTracker tracker
           
 
Constructor Summary
AWTHierarchy()
           
 
Method Summary
 boolean contains(Component c)
          Returns whether the given component is reachable from any of the root windows.
 void dispose(Window w)
          Properly dispose of the given Window, making it and its native resources available for garbage collection.
 Collection getComponents(Component c)
          Return all descendents of interest of the given Component.
static Hierarchy getDefault()
          Obtain a default Hierarchy.
 Container getParent(Component c)
          Return the parent component for the given Component.
 Collection getRoots()
          Return all root components in the current AWT hierarchy.
static void setDefault(Hierarchy h)
          Set the default Hierarchy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tracker

protected static final WindowTracker tracker

EMPTY

protected static final Collection EMPTY
Constructor Detail

AWTHierarchy

public AWTHierarchy()
Method Detail

getDefault

public static Hierarchy getDefault()
Obtain a default Hierarchy. This method is provided only to support the deprecated ComponentTester.assertFrameShowing() method.


setDefault

public static void setDefault(Hierarchy h)
Set the default Hierarchy. This method is provided only to support the deprecated ComponentTester.assertFrameShowing() method.


contains

public boolean contains(Component c)
Returns whether the given component is reachable from any of the root windows. The default is to consider all components to be contained in the hierarchy, whether they are reachable or not (NOTE: isReachable is a distinctly different operation).

Specified by:
contains in interface Hierarchy

dispose

public void dispose(Window w)
Properly dispose of the given Window, making it and its native resources available for garbage collection.

Specified by:
dispose in interface Hierarchy

getRoots

public Collection getRoots()
Return all root components in the current AWT hierarchy.

Specified by:
getRoots in interface Hierarchy

getComponents

public Collection getComponents(Component c)
Return all descendents of interest of the given Component. This includes owned windows for Windows, children for Containers.

Specified by:
getComponents in interface Hierarchy

getParent

public Container getParent(Component c)
Description copied from interface: Hierarchy
Return the parent component for the given Component.

Specified by:
getParent in interface Hierarchy


Copyright © 2002-2008 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge