Class Ancestor.AncestorSupplier<T>

java.lang.Object
is.codion.swing.common.ui.ancestor.Ancestor.AncestorSupplier<T>
Direct Known Subclasses:
Ancestor.WindowSupplier
Enclosing class:
Ancestor

public static class Ancestor.AncestorSupplier<T> extends Object
Provides ancestor of a given type of component
  • Method Details

    • get

      public final @Nullable T get()
      Finds the first component of the required type in the ancestor hierarchy.
      Returns:
      the ancestor the given type, null if none is found
    • optional

      public final Optional<T> optional()
      Finds the first component of the required type in the ancestor hierarchy.
      Returns:
      the ancestor of the required type, or an empty Optional if none is found