Package org.fest.swing.hierarchy
Class ParentFinder
java.lang.Object
org.fest.swing.hierarchy.ParentFinder
Understands how to find the parent of a
Component
. This method returns the most likely parent
based on the type of a given Component
.
Note: Methods in this class are not executed in the event dispatch thread (EDT.) Clients are responsible for invoking them in the EDT.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) Component
Returns the invoker, if any, of the given component.(package private) Container
Return the parent for the given component.private Container
parentOf
(JInternalFrame internalFrame) (package private) Window
Similar to
), but returns the component itself if it is aSwingUtilities.windowForComponent
, or the invoker's window if on a pop-up.Window
-
Constructor Details
-
ParentFinder
ParentFinder()
-
-
Method Details
-
parentOf
Return the parent for the given component.- Parameters:
c
- the given component.- Returns:
- the parent for the given component.
-
parentOf
-
windowFor
Similar to
), but returns the component itself if it is aSwingUtilities.windowForComponent
, or the invoker's window if on a pop-up.Window
- Parameters:
c
- the component whose window ancestor we are looking for.- Returns:
- the window ancestor of the given component, or given component itself it is a window.
-
invokerFor
Returns the invoker, if any, of the given component. Returnsnull
if the component is not on a pop-up of any sort.- Parameters:
c
- the given component.- Returns:
- the invoker of the given component if found. Otherwise,
null
.
-