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 TypeMethodDescriptionfindTypeAndSourceLocation
(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
(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
-