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_CLOSED
ComponentHierarchy.dispose(java.awt.Window)
</code< will be ignored permanently.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final WindowFilter
private final TransientWindowListener
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
NewHierarchy
(boolean ignoreExisting) private
NewHierarchy
(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.boolean
Returnstrue
if the given component is not filtered.void
Dispose of the given window, but only if it currently exists within the hierarchy.void
Make all currently existing components invisible to this hierarchy, without affecting their current state.static NewHierarchy
Creates a new
which does not contain any existing GUI components.NewHierarchy
static NewHierarchy
Creates a new
which contains existing GUI components.NewHierarchy
void
Make the given component visible to this hierarchy.Collection<? extends Container>
roots()
Returns all available root containers, excluding those which have been filtered.private void
Methods 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 new
which does not contain any existing GUI components.NewHierarchy
- Returns:
- the created hierarchy.
-
includeExistingComponents
Creates a new
which 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:
childrenOf
in interfaceComponentHierarchy
- Overrides:
childrenOf
in classExistingHierarchy
- Parameters:
c
- the given component.- Returns:
- all sub-components of the given component, omitting those which are currently filtered.
-
contains
Returnstrue
if the given component is not filtered.- Specified by:
contains
in interfaceComponentHierarchy
- Overrides:
contains
in classExistingHierarchy
- Parameters:
c
- the given component.- Returns:
true
if the given component is not filtered,false
otherwise.
-
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:
dispose
in interfaceComponentHierarchy
- Overrides:
dispose
in classExistingHierarchy
- Parameters:
w
- the window to dispose.
-
roots
Returns all available root containers, excluding those which have been filtered.- Specified by:
roots
in interfaceComponentHierarchy
- Overrides:
roots
in classExistingHierarchy
- Returns:
- all available root containers, excluding those which have been filtered.
-