com.vaadin.copilot.
Class ProjectManager
Handles reading and writing files in the project
-
Constructor Summary
ConstructorsConstructorDescriptionProjectManager
(ApplicationConfiguration applicationConfiguration) Creates a new project manager
-
Method Summary
Modifier and TypeMethodDescriptiongetFileForClass
(Class<?> cls) Returns the Java file for the given class.
getFileForClass
(String cls) Returns the Java file for the given class.
Returns the frontend folder.
Returns the Java source folder.
Returns the project root folder.
getRelativeName
(File projectFile) Returns the name of the file, relative to the project root.
getSourceFile
(ComponentTracker.Location location) Returns the Java file for the given component location.
Gets current theme folder
Gets current theme name
makeAbsolute
(String projectRelativeFilename) makeRelative
(String filename) void
void
-
Constructor Details
-
ProjectManager
Creates a new project manager
Parameters:
applicationConfiguration
- the application configurationThrows:
IOException
- if the project folder cannot be resolved
-
-
Method Details
-
readFile
Throws:
-
readFile
Throws:
-
readLines
Throws:
-
writeFile
Throws:
-
writeFile
Throws:
-
makeAbsolute
Throws:
-
makeRelative
Throws:
-
getRelativeName
Returns the name of the file, relative to the project root.
Parameters:
projectFile
- the fileReturns:
the relative name of the file
-
getFileForClass
Returns the Java file for the given class.
Parameters:
cls
- the classReturns:
the file for the class
-
getFileForClass
Returns the Java file for the given class.
Parameters:
cls
- the classReturns:
the file for the class
-
getSourceFile
Returns the Java file for the given component location.
Parameters:
location
- the component locationReturns:
the file for the class where the component is used
-
getJavaSourceFolder
Returns the Java source folder.
Returns:
the Java source folder
-
getProjectRoot
Returns the project root folder.
Returns:
the project root folder
-
getFrontendFolder
Returns the frontend folder.
Returns:
the frontend folder
-
getThemeName
Gets current theme name
Returns:
optional theme name
-
getThemeFolder
Gets current theme folder
Returns:
optional theme folder
-