Class GenerateMainImports

java.lang.Object
io.jmix.flowui.devserver.frontend.GenerateMainImports
All Implemented Interfaces:
Runnable

public class GenerateMainImports extends Object
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 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

      public List<String> getLines()
    • writeOutput

      protected void writeOutput(Map<File,List<String>> outputFiles)
    • 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 to
      cssData - CssImport data
      i - 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:
      true if devBundle in memory collecting
    • getImportsNotFoundMessage

      protected String getImportsNotFoundMessage()
    • importedFileExists

      protected boolean importedFileExists(String importName)
      Validate that the file importName can be found.
      Parameters:
      importName - name of the file
      Returns:
      true if file is found
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • getCssLines

      protected List<String> getCssLines(List<com.vaadin.flow.server.frontend.scanner.CssData> css)
      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

      protected String resolveResource(String importPath)
    • addLines

      protected void addLines(Collection<String> lines, String content)
    • getThemeIdPrefix

      protected String getThemeIdPrefix()
    • merge

      protected <T> List<String> merge(Map<T,List<String>> css)