Package org.fest.swing.hierarchy
Class ExistingHierarchy
java.lang.Object
org.fest.swing.hierarchy.ExistingHierarchy
- All Implemented Interfaces:
ComponentHierarchy
- Direct Known Subclasses:
NewHierarchy
Understands access to the current AWT hierarchy.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ChildrenFinder
private final ParentFinder
private static WindowMonitor
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newExistingHierarchy
.ExistingHierarchy
(ParentFinder parentFinder, ChildrenFinder childrenFinder) -
Method Summary
Modifier and TypeMethodDescription(package private) ChildrenFinder
Returns all descendants of interest of the given component.boolean
Returns whether the given component is reachable from any of the root windows.void
Properly dispose of the given window, making it and its native resources available for garbage collection.(package private) ParentFinder
Return the parent for the given component.Collection<? extends Container>
roots()
Provides all root containers in the hierarchy.
-
Field Details
-
windowMonitor
-
parentFinder
-
childrenFinder
-
-
Constructor Details
-
ExistingHierarchy
public ExistingHierarchy()Creates a newExistingHierarchy
. -
ExistingHierarchy
ExistingHierarchy(ParentFinder parentFinder, ChildrenFinder childrenFinder)
-
-
Method Details
-
roots
Provides all root containers in the hierarchy.- Specified by:
roots
in interfaceComponentHierarchy
- Returns:
- all root containers in the hierarchy.
-
parentOf
Return the parent for the given component.- Specified by:
parentOf
in interfaceComponentHierarchy
- Parameters:
c
- the given component.- Returns:
- the parent for the given component.
-
contains
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.- Specified by:
contains
in interfaceComponentHierarchy
- Parameters:
c
- the given component.- Returns:
true
.
-
childrenOf
Returns all descendants of interest of the given component.- Specified by:
childrenOf
in interfaceComponentHierarchy
- Parameters:
c
- the given component.- Returns:
- all descendants of interest of the given component.
-
dispose
Properly dispose of the given window, making it and its native resources available for garbage collection.- Specified by:
dispose
in interfaceComponentHierarchy
- Parameters:
w
- the window to dispose.
-
parentFinder
ParentFinder parentFinder() -
childrenFinder
ChildrenFinder childrenFinder()
-