Package com.vaadin.copilot
Class ComponentSourceFinder
java.lang.Object
com.vaadin.copilot.ComponentSourceFinder
Finds the source location of a component in the project.
-
Constructor Summary
ConstructorsConstructorDescriptionComponentSourceFinder(ProjectManager projectManager) Creates a new instance of the finder. -
Method Summary
Modifier and TypeMethodDescription_getSourceLocation(com.vaadin.flow.component.Component component) Gets the source location for the given component.findInheritanceChain(com.vaadin.flow.component.Component component) Finds inheritance chain of a component by going up for each superclassfindTypeAndSourceLocation(int uiId, int nodeId) Finds the source location of a component.findTypeAndSourceLocation(int uiId, int nodeId, boolean includeChildren) Finds the source location of a component.findTypeAndSourceLocation(com.vaadin.flow.component.Component component, boolean includeChildren) Finds the source location of a component.findTypeAndSourceLocation(elemental.json.JsonObject component) Finds the source location of a component.findTypeAndSourceLocation(elemental.json.JsonObject component, boolean includeChildren) Finds the source location of a component.
-
Constructor Details
-
ComponentSourceFinder
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
Finds the source location of a component.- Parameters:
uiId- the uiId of the componentnodeId- 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 componentnodeId- the nodeId of the componentincludeChildren- whether to include children in the search- Returns:
- the source location of the component
-
findTypeAndSourceLocation
public ComponentTypeAndSourceLocation findTypeAndSourceLocation(com.vaadin.flow.component.Component component, boolean includeChildren) Finds the source location of a component.- Parameters:
component- the component to findincludeChildren- whether to include children in the search- Returns:
- the source location of the component
-
_getSourceLocation
public ComponentTypeAndSourceLocation _getSourceLocation(com.vaadin.flow.component.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
Finds inheritance chain of a component by going up for each superclass- Parameters:
component- Flow component- Returns:
- list of classes
-