Package com.vaadin.copilot
Class NewRouteTemplateHandler
java.lang.Object
com.vaadin.copilot.NewRouteTemplateHandler
Handles listing, supplying templates of new views that will be created by New
Route Panel.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordContains information to generate new Flow viewstatic final recordContains information to generate new Flow view -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFlowTemplate(NewRouteTemplateHandler.FlowTemplateRequest flowTemplateRequest) Creates a view template string that will have view configuration based on given parameters and invoke the template handler with it.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.getTemplateNames(String framework) It returns the template list for the given framework.
-
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 toEMPTYor 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 toEMPTYor null.- Parameters:
hillaTemplateRequest- Required parameters to create hilla template
-
getTemplateNames
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
-