Class ComponentTracker

java.lang.Object
com.vaadin.flow.component.internal.ComponentTracker

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

    • ComponentTracker

      public ComponentTracker()
  • Method Details

    • 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
    • refreshLocation

      public static void refreshLocation(ComponentTracker.Location location, int offset)
      Refreshes location of all components that had create or attach location below given reference component by given offset value. Location may change due to dynamic code updates conducted by Vaadin developer tools.
      Parameters:
      location - reference component location
      offset - difference in lines to be applied