Class NewRouteTemplateHandler

java.lang.Object
com.vaadin.copilot.NewRouteTemplateHandler

public class NewRouteTemplateHandler extends Object
Handles listing, supplying templates of new views that will be created by New Route Panel.
  • Constructor Details

    • NewRouteTemplateHandler

      public NewRouteTemplateHandler()
  • Method Details

    • getFlowTemplate

      public CompletableFuture<String> getFlowTemplate(NewRouteTemplateHandler.FlowTemplateRequest flowTemplateRequest)
      Creates a view template string that will have view configuration based on given parameters and invoke the template handler with it. It returns the empty template when template name is blank or equals to EMPTY or null.
      Parameters:
      flowTemplateRequest - Required parameters to create flow template
      Returns:
      a CompletableFuture with the template string
    • getHillaTemplate

      public CompletableFuture<String> getHillaTemplate(NewRouteTemplateHandler.HillaTemplateRequest hillaTemplateRequest)
      Creates a view template string that will have view configuration based on given parameters and invoke the template handler with it. It returns the empty template when template name is blank or equals to EMPTY or null.
      Parameters:
      hillaTemplateRequest - Required parameters to create hilla template
    • getTemplateNames

      public List<String> getTemplateNames(String framework)
      It returns the template list for the given framework. Label is the base file name, value is the file name.
      Parameters:
      framework - Either "hilla" or "flow"
      Returns:
      list of summary templates, which model has label and value properties