abbot.finder
Class TestHierarchy

java.lang.Object
  extended byabbot.finder.AWTHierarchy
      extended byabbot.finder.TestHierarchy
All Implemented Interfaces:
Hierarchy

public class TestHierarchy
extends AWTHierarchy

Provide filtering of components in the current hierarchy to facilitate testing. Components may be filtered after disposal so they don't factor into future test results.

In general, only Windows are filtered, and isFiltered checks for both self and Window being filtered. So getComponents() returns a filtered set only when the parent is a Window.

Auto-filter disposable dialogs generated by Swing.


Field Summary
 
Fields inherited from class abbot.finder.AWTHierarchy
EMPTY, tracker
 
Constructor Summary
TestHierarchy()
           
 
Method Summary
 boolean contains(Component c)
          Returns whether the given component is reachable from any of the root windows.
 void dispose(Window w)
           
 Collection getComponents(Component c)
          Return all descendents of interest of the given Component.
 Collection getRoots()
          Return all root components in the current AWT hierarchy.
 void ignoreExisting()
           
 boolean isFiltered(Component c)
           
 void setFiltered(Component c, boolean filter)
          Indicates whether the given component is to be included in the Hierarchy.
 
Methods inherited from class abbot.finder.AWTHierarchy
getDefault, getParent, setDefault
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestHierarchy

public TestHierarchy()
Method Detail

contains

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

Specified by:
contains in interface Hierarchy
Overrides:
contains in class AWTHierarchy

dispose

public void dispose(Window w)
Specified by:
dispose in interface Hierarchy
Overrides:
dispose in class AWTHierarchy

ignoreExisting

public void ignoreExisting()

getRoots

public Collection getRoots()
Description copied from class: AWTHierarchy
Return all root components in the current AWT hierarchy.

Specified by:
getRoots in interface Hierarchy
Overrides:
getRoots in class AWTHierarchy

getComponents

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

Specified by:
getComponents in interface Hierarchy
Overrides:
getComponents in class AWTHierarchy

isFiltered

public boolean isFiltered(Component c)

setFiltered

public void setFiltered(Component c,
                        boolean filter)
Indicates whether the given component is to be included in the Hierarchy. If the component is a Window, recursively applies the action to all owned Windows.



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

SourceForge