01: package abbot.finder;
02:
03: import java.awt.Component;
04: import java.awt.Container;
05: import java.awt.Window;
06: import java.util.Collection;
07:
08: /** Provides access to all components in a hierarchy. */
09: public interface Hierarchy {
10: /** Provides all root components in the hierarchy. Similar to
11: * Frame.getFrames().
12: */
13: Collection getRoots();
14:
15: /** Returns all sub-components of the given component. What constitutes a
16: * sub-component may vary depending on the Hierarchy implementation.
17: */
18: Collection getComponents(Component c);
19:
20: /** Return the parent component for the given Component. */
21: Container getParent(Component c);
22:
23: /** Returns whether the hierarchy contains the given Component. */
24: boolean contains(Component c);
25:
26: /** Provide proper disposal of the given Window, appropriate to this
27: * Hierarchy. After disposal, the Window and its descendents will no
28: * longer be reachable from this Hierarchy.
29: */
30: void dispose(Window w);
31: }
|