Package org.fest.swing.hierarchy
Class SingleComponentHierarchy
java.lang.Object
org.fest.swing.hierarchy.SingleComponentHierarchy
- All Implemented Interfaces:
ComponentHierarchy
Understands a component hierarchy created with a specified
Component
as root.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSingleComponentHierarchy
(Container root, ComponentHierarchy hierarchy) Creates a newSingleComponentHierarchy
. -
Method Summary
Modifier and TypeMethodDescriptionReturns all sub-components of the given
.Component
boolean
Returns whether the hierarchy contains the given
.Component
void
Provides proper disposal of the given
, appropriate to this hierarchy.Window
Returns the parent component for the given
.Component
root()
Returns the root component in this hierarchy.Collection<? extends Container>
roots()
Returns a collection containing only the root
in this hierarchy.Component
-
Field Details
-
root
-
list
-
hierarchy
-
-
Constructor Details
-
SingleComponentHierarchy
Creates a newSingleComponentHierarchy
.- Parameters:
root
- the root component for this hierarchyhierarchy
- the base component hierarchy.
-
-
Method Details
-
root
Returns the root component in this hierarchy.- Returns:
- the root component in this hierarchy.
-
parentOf
Returns the parent component for the given
.Component
- Specified by:
parentOf
in interfaceComponentHierarchy
- Parameters:
c
- the givenComponent
.- Returns:
- the parent component for the given
.Component
-
roots
Returns a collection containing only the root
in this hierarchy.Component
- Specified by:
roots
in interfaceComponentHierarchy
- Returns:
- a collection containing only the root
in this hierarchy.Component
-
childrenOf
Returns all sub-components of the given
.Component
- Specified by:
childrenOf
in interfaceComponentHierarchy
- Parameters:
c
- the given component.- Returns:
- all sub-components of the given
.Component
-
contains
Returns whether the hierarchy contains the given
.Component
- Specified by:
contains
in interfaceComponentHierarchy
- Parameters:
c
- the given component.- Returns:
- whether the hierarchy contains the given
.Component
-
dispose
Provides proper disposal of the given
, appropriate to this hierarchy. After disposal, theWindow
and its descendants will no longer be reachable from this hierarchy.Window
- Specified by:
dispose
in interfaceComponentHierarchy
- Parameters:
w
- the window to dispose.
-