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 ChildrenFinderprivate final ParentFinderprivate static WindowMonitor -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newExistingHierarchy.ExistingHierarchy(ParentFinder parentFinder, ChildrenFinder childrenFinder) -
Method Summary
Modifier and TypeMethodDescription(package private) ChildrenFinderReturns all descendants of interest of the given component.booleanReturns whether the given component is reachable from any of the root windows.voidProperly dispose of the given window, making it and its native resources available for garbage collection.(package private) ParentFinderReturn 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:
rootsin interfaceComponentHierarchy- Returns:
- all root containers in the hierarchy.
-
parentOf
Return the parent for the given component.- Specified by:
parentOfin 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:
containsin interfaceComponentHierarchy- Parameters:
c- the given component.- Returns:
true.
-
childrenOf
Returns all descendants of interest of the given component.- Specified by:
childrenOfin 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:
disposein interfaceComponentHierarchy- Parameters:
w- the window to dispose.
-
parentFinder
ParentFinder parentFinder() -
childrenFinder
ChildrenFinder childrenFinder()
-