com.vaadin.copilot.
Class 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
(Component component) Gets the source location for the given component.
findInheritanceChain
(Component component) Finds inheritance chain of a component by going up for each superclass
findTypeAndSourceLocation
(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
(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 objectReturns:
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 objectReturns:
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 componentReturns:
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 searchReturns:
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 findincludeChildren
- whether to include children in the searchReturns:
the source location of the component
-
_getSourceLocation
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 componentReturns:
list of classes
-