You're viewing an older version of Vaadin JavaDoc. Please see version 24.7.0 for the latest.
com.vaadin.copilot.

Class ComponentSourceFinder

java.lang.Object
com.vaadin.copilot.ComponentSourceFinder
public class ComponentSourceFinder extends Object

Finds the source location of a component in the project.

  • Constructor Details

    • ComponentSourceFinder

      public ComponentSourceFinder(ProjectManager projectManager)

      Creates a new instance of the finder.

      Parameters:

      projectManager - the project manager to use

  • Method Details

    • findTypeAndSourceLocation

      public ComponentTypeAndSourceLocation findTypeAndSourceLocation(elemental.json.JsonObject component)

      Finds the source location of a component.

      Parameters:

      component - the component to find, defined by uiId and nodeId in the given JSON object

      Returns:

      the source location of the component

    • findTypeAndSourceLocation

      public ComponentTypeAndSourceLocation findTypeAndSourceLocation(elemental.json.JsonObject component, boolean includeChildren)

      Finds the source location of a component.

      Parameters:

      component - the component to find, defined by uiId and nodeId in the given JSON object

      Returns:

      the source location of the component

    • findTypeAndSourceLocation

      public ComponentTypeAndSourceLocation findTypeAndSourceLocation(int uiId, int nodeId)

      Finds the source location of a component.

      Parameters:

      uiId - the uiId of the component

      nodeId - the nodeId of the component

      Returns:

      the source location of the component

    • findTypeAndSourceLocation

      public ComponentTypeAndSourceLocation findTypeAndSourceLocation(int uiId, int nodeId, boolean includeChildren)

      Finds the source location of a component.

      Parameters:

      uiId - the uiId of the component

      nodeId - the nodeId of the component

      includeChildren - whether to include children in the search

      Returns:

      the source location of the component

    • findTypeAndSourceLocation

      public ComponentTypeAndSourceLocation findTypeAndSourceLocation(Component component, boolean includeChildren)

      Finds the source location of a component.

      Parameters:

      component - the component to find

      includeChildren - whether to include children in the search

      Returns:

      the source location of the component

    • _getSourceLocation

      public ComponentTypeAndSourceLocation _getSourceLocation(Component component)

      Gets the source location for the given component.

      NOTE that the session must be locked when calling this method.

      Returns:

      the source location of the component

    • findInheritanceChain

      public static List<Class<?>> findInheritanceChain(Component component)

      Finds inheritance chain of a component by going up for each superclass

      Parameters:

      component - Flow component

      Returns:

      list of classes