public final class SingleComponentHierarchy extends Object implements ComponentHierarchy
ComponentHierarchy created with a specified AWT or Swing Component as root.| Constructor and Description |
|---|
SingleComponentHierarchy(Container root,
ComponentHierarchy hierarchy)
Creates a new
SingleComponentHierarchy. |
| Modifier and Type | Method and Description |
|---|---|
Collection<Component> |
childrenOf(Component c)
Returns all the children of the given AWT or Swing
Component. |
boolean |
contains(Component c)
Indicates whether this
ComponentHierarchy contains the given AWT or Swing Component. |
void |
dispose(Window w)
Provides proper disposal of the given AWT or Swing
Window, appropriate to this ComponentHierarchy. |
Container |
parentOf(Component c)
Returns the parent for the given AWT or Swing
Component. |
Container |
root() |
Collection<Container> |
roots() |
public SingleComponentHierarchy(@Nonnull Container root, @Nonnull ComponentHierarchy hierarchy)
SingleComponentHierarchy.root - the root Component for this hierarchy.hierarchy - the base ComponentHierarchy.public Container root()
Component in this hierarchy.@Nullable public Container parentOf(@Nonnull Component c)
Component.parentOf in interface ComponentHierarchyc - the given Component.Component.@Nonnull public Collection<Container> roots()
roots in interface ComponentHierarchyComponent in this hierarchy.@Nonnull public Collection<Component> childrenOf(@Nonnull Component c)
ComponentHierarchyComponent.childrenOf in interface ComponentHierarchyc - the given Component.Component.public boolean contains(@Nonnull Component c)
ComponentHierarchyComponentHierarchy contains the given AWT or Swing Component.contains in interface ComponentHierarchyc - the given Component.true if this ComponentHierarchy contains the given Component, false
otherwise.public void dispose(@Nonnull Window w)
ComponentHierarchyWindow, appropriate to this ComponentHierarchy.
After disposal, the Window and its descendants will no longer be reachable from this
ComponentHierarchy.dispose in interface ComponentHierarchyw - the Window to dispose.Copyright © 2014 AssertJ. All rights reserved.