Class ComponentTracker


  • public class ComponentTracker
    extends Object
    Tracks the location in source code where components were instantiated.
    • Constructor Detail

      • ComponentTracker

        public ComponentTracker()
    • Method Detail

      • findCreate

        public static ComponentTracker.Location findCreate​(Component component)
        Finds the location where the given component instance was created.
        Parameters:
        component - the component to find
        Returns:
        the location where the component was created
      • trackCreate

        public static void trackCreate​(Component component)
        Tracks the location where the component was created. This should be called from the Component constructor so that the creation location can be found from the current stacktrace.
        Parameters:
        component - the component to track
      • findAttach

        public static ComponentTracker.Location findAttach​(Component component)
        Finds the location where the given component instance was attached to a parent.
        Parameters:
        component - the component to find
        Returns:
        the location where the component was attached
      • trackAttach

        public static void trackAttach​(Component component)
        Tracks the location where the component was attached. This should be called from the Component attach logic so that the creation location can be found from the current stacktrace.
        Parameters:
        component - the component to track