public class NewHierarchy extends ExistingHierarchy
Implicitly auto-filters windows which are disposed (i.e. generate a
event), but also implicitly un-filters
them if they should be shown again. Any window explicitly disposed by the calling
WINDOW_CLOSED
ComponentHierarchy.dispose(java.awt.Window)
Modifier and Type | Method and Description |
---|---|
Collection<Component> |
childrenOf(Component c)
Returns all sub-components of the given component, omitting those which are currently filtered.
|
boolean |
contains(Component c)
Returns
true if the given component is not filtered. |
void |
dispose(Window w)
Dispose of the given window, but only if it currently exists within the hierarchy.
|
void |
ignoreExisting()
Make all currently existing components invisible to this hierarchy, without affecting their current state.
|
static NewHierarchy |
ignoreExistingComponents()
Creates a new
which does not contain any existing GUI components. |
static NewHierarchy |
includeExistingComponents()
Creates a new
which contains existing GUI components. |
void |
recognize(Component c)
Make the given component visible to this hierarchy.
|
Collection<? extends Container> |
roots()
Returns all available root containers, excluding those which have been filtered.
|
parentOf
public static NewHierarchy ignoreExistingComponents()
NewHierarchy
which does not contain any existing GUI components.public static NewHierarchy includeExistingComponents()
NewHierarchy
which contains existing GUI components.@RunsInCurrentThread public void ignoreExisting()
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.
@RunsInCurrentThread public void recognize(Component c)
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.
c
- the given component.@RunsInCurrentThread public Collection<Component> childrenOf(Component c)
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.
childrenOf
in interface ComponentHierarchy
childrenOf
in class ExistingHierarchy
c
- the given component.@RunsInCurrentThread public boolean contains(Component c)
true
if the given component is not filtered.
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.
contains
in interface ComponentHierarchy
contains
in class ExistingHierarchy
c
- the given component.true
if the given component is not filtered, false
otherwise.@RunsInCurrentThread public void dispose(Window w)
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.
this hierarchy or be reachable in a hierarchy walk.dispose
in interface ComponentHierarchy
dispose
in class ExistingHierarchy
w
- the window to dispose.public Collection<? extends Container> roots()
roots
in interface ComponentHierarchy
roots
in class ExistingHierarchy
Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.