Package com.vaadin.copilot
Class RouteCreator
java.lang.Object
com.vaadin.copilot.RouteCreator
Handles creation of views for new routes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateFlowView(String title, String route, AccessRequirement accessRequirement, Class<?> layoutClass, String templateFileName) Creates a Flow view for the given route using the given access requirement.voidcreateHillaView(String title, String route, AccessRequirement accessRequirement, String templateFileName) Creates a Hilla view for the given route using the given access requirement.
-
Constructor Details
-
RouteCreator
public RouteCreator(com.vaadin.flow.server.VaadinSession vaadinSession)
-
-
Method Details
-
createFlowView
public void createFlowView(String title, String route, AccessRequirement accessRequirement, Class<?> layoutClass, String templateFileName) throws IOException, RouteDuplicatedException Creates a Flow view for the given route using the given access requirement.- Parameters:
title- the title of the viewroute- the path to create a view foraccessRequirement- the access requirement for the viewlayoutClass- the layout class to use, ornullto not use a layouttemplateFileName- the file name to select the template of view- Throws:
IOException- if the view file could not be createdRouteDuplicatedException
-
createHillaView
public void createHillaView(String title, String route, AccessRequirement accessRequirement, String templateFileName) throws IOException, RouteDuplicatedException Creates a Hilla view for the given route using the given access requirement.- Parameters:
title- the title of the viewroute- the path to create a view foraccessRequirement- the access requirement for the viewtemplateFileName- the selected template for the view- Throws:
IOExceptionRouteDuplicatedException
-