Class GenerateMainImports
java.lang.Object
io.jmix.flowui.devserver.frontend.GenerateMainImports
- All Implemented Interfaces:
Runnable
Collect generated-flow-imports content for project to use to determine if
dev-bundle contains all required imports.
Only used when checking if dev bundle need to be rebuild in dev mode without a dev server.
-
Constructor Summary
ConstructorsConstructorDescriptionGenerateMainImports(com.vaadin.flow.server.frontend.scanner.ClassFinder classFinder, com.vaadin.flow.server.frontend.scanner.FrontendDependenciesScanner frontendDepScanner, Options options, com.vaadin.flow.theme.AbstractTheme theme, elemental.json.JsonObject statsJson) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanaddCssLines(Collection<String> lines, com.vaadin.flow.server.frontend.scanner.CssData cssData, int i) Adds CSS imports to the generated flow imports file based on the given CssImport data.protected voidaddLines(Collection<String> lines, String content) getCssLines(List<com.vaadin.flow.server.frontend.scanner.CssData> css) Returns the JS code lines representing the CSS data provided as a parameter.protected StringgetLines()protected org.slf4j.LoggerGet logger for this instance.protected Stringprotected booleanimportedFileExists(String importName) Validate that the fileimportNamecan be found.protected booleanIf in memory collection we are collecting for devBundle check.protected StringresolveResource(String importPath) voidrun()protected voidwriteOutput(Map<File, List<String>> outputFiles)
-
Constructor Details
-
GenerateMainImports
public GenerateMainImports(com.vaadin.flow.server.frontend.scanner.ClassFinder classFinder, com.vaadin.flow.server.frontend.scanner.FrontendDependenciesScanner frontendDepScanner, Options options, com.vaadin.flow.theme.AbstractTheme theme, elemental.json.JsonObject statsJson)
-
-
Method Details
-
getLines
-
writeOutput
-
addCssLines
protected boolean addCssLines(Collection<String> lines, com.vaadin.flow.server.frontend.scanner.CssData cssData, int i) Adds CSS imports to the generated flow imports file based on the given CssImport data.- Parameters:
lines- collection of generated file lines to add imports tocssData- CssImport datai- imported CSS counter- Returns:
- true if the imported CSS files does exist, false otherwise
-
getLogger
protected org.slf4j.Logger getLogger()Get logger for this instance.- Returns:
- a logger
-
inMemoryCollection
protected boolean inMemoryCollection()If in memory collection we are collecting for devBundle check.- Returns:
trueif devBundle in memory collecting
-
getImportsNotFoundMessage
-
importedFileExists
Validate that the fileimportNamecan be found.- Parameters:
importName- name of the file- Returns:
trueif file is found
-
run
public void run() -
getCssLines
Returns the JS code lines representing the CSS data provided as a parameter.Deduplicates the data so that each CSSData instance is loaded / injected only once.
- Parameters:
css- the CSS import data- Returns:
- the JS statements needed to import and apply the CSS data
-
resolveResource
-
addLines
-
getThemeIdPrefix
-
merge
-