Package org.fest.swing.hierarchy
Class NewHierarchy
java.lang.Object
org.fest.swing.hierarchy.ExistingHierarchy
org.fest.swing.hierarchy.NewHierarchy
- All Implemented Interfaces:
ComponentHierarchy
Understands isolation of a component hierarchy to limit to only those components created during the lifetime of this
hierarchy. Existing components (and any subsequently generated subwindows) are ignored by default.
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_CLOSEDComponentHierarchy.dispose(java.awt.Window)</code< will be ignored permanently.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final WindowFilterprivate final TransientWindowListener -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNewHierarchy(boolean ignoreExisting) privateNewHierarchy(Toolkit toolkit, boolean ignoreExisting) (package private)NewHierarchy(Toolkit toolkit, WindowFilter filter, boolean ignoreExisting) -
Method Summary
Modifier and TypeMethodDescriptionReturns all sub-components of the given component, omitting those which are currently filtered.booleanReturnstrueif the given component is not filtered.voidDispose of the given window, but only if it currently exists within the hierarchy.voidMake all currently existing components invisible to this hierarchy, without affecting their current state.static NewHierarchyCreates a newwhich does not contain any existing GUI components.NewHierarchystatic NewHierarchyCreates a newwhich contains existing GUI components.NewHierarchyvoidMake the given component visible to this hierarchy.Collection<? extends Container>roots()Returns all available root containers, excluding those which have been filtered.private voidMethods inherited from class org.fest.swing.hierarchy.ExistingHierarchy
childrenFinder, parentFinder, parentOf
-
Field Details
-
filter
-
transientWindowListener
-
-
Constructor Details
-
NewHierarchy
private NewHierarchy(boolean ignoreExisting) -
NewHierarchy
-
NewHierarchy
NewHierarchy(Toolkit toolkit, WindowFilter filter, boolean ignoreExisting)
-
-
Method Details
-
ignoreExistingComponents
Creates a newwhich does not contain any existing GUI components.NewHierarchy- Returns:
- the created hierarchy.
-
includeExistingComponents
Creates a newwhich contains existing GUI components.NewHierarchy- Returns:
- the created hierarchy.
-
setUp
-
ignoreExisting
Make all currently existing components invisible to this hierarchy, without affecting their current state. -
recognize
Make the given component visible to this hierarchy.- Parameters:
c- the given component.
-
childrenOf
Returns all sub-components of the given component, omitting those which are currently filtered.- Specified by:
childrenOfin interfaceComponentHierarchy- Overrides:
childrenOfin classExistingHierarchy- Parameters:
c- the given component.- Returns:
- all sub-components of the given component, omitting those which are currently filtered.
-
contains
Returnstrueif the given component is not filtered.- Specified by:
containsin interfaceComponentHierarchy- Overrides:
containsin classExistingHierarchy- Parameters:
c- the given component.- Returns:
trueif the given component is not filtered,falseotherwise.
-
dispose
Dispose of the given window, but only if it currently exists within the hierarchy. It will no longer appear in this hierarchy or be reachable in a hierarchy walk.- Specified by:
disposein interfaceComponentHierarchy- Overrides:
disposein classExistingHierarchy- Parameters:
w- the window to dispose.
-
roots
Returns all available root containers, excluding those which have been filtered.- Specified by:
rootsin interfaceComponentHierarchy- Overrides:
rootsin classExistingHierarchy- Returns:
- all available root containers, excluding those which have been filtered.
-