Class ParentFinder

java.lang.Object
org.fest.swing.hierarchy.ParentFinder

class ParentFinder extends Object
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 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

      @RunsInCurrentThread private Container parentOf(JInternalFrame internalFrame)
    • windowFor

      Window windowFor(Component c)
      Similar to SwingUtilities.windowForComponent), but returns the component itself if it is a Window, or the invoker's window if on a pop-up.
      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. Returns null 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.