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, Path qualifiedClassNamePath, AccessRequirement accessRequirement, Class<?> layoutClass, String templateFileName, String templateData, Boolean addToMenu) Creates a Flow view for the given route using the given access requirement.voidcreateHillaView(String title, String route, Path filePath, AccessRequirement accessRequirement, String templateFileName, String templateData, boolean addToMenu) Creates a Hilla view for the given route using the given access requirement.static StringgetNewClassPackageNameRelative(String framework, com.vaadin.flow.server.VaadinSession session) static PathgetNewFilePath(String framework, String qualifiedClassNameOrViewFile)
-
Constructor Details
-
RouteCreator
public RouteCreator(com.vaadin.flow.server.VaadinSession vaadinSession)
-
-
Method Details
-
createFlowView
public void createFlowView(String title, String route, Path qualifiedClassNamePath, AccessRequirement accessRequirement, Class<?> layoutClass, String templateFileName, String templateData, Boolean addToMenu) 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 forqualifiedClassNamePath- qualified class name path that is used to create the file e.g. com.vaadin.org.MainView.javaaccessRequirement- the access requirement for the viewlayoutClass- the layout class to use, ornullto not use a layouttemplateFileName- the file name to select the template of viewtemplateData- data for the selected template, ornull- Throws:
IOException- if the view file could not be createdRouteDuplicatedException
-
createHillaView
public void createHillaView(String title, String route, Path filePath, AccessRequirement accessRequirement, String templateFileName, String templateData, boolean addToMenu) throws RouteDuplicatedException, IOException 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 forfilePath- the folder to add viewaccessRequirement- the access requirement for the viewtemplateFileName- the selected template for the viewtemplateData- data for the selected template, ornulladdToMenu-- Throws:
RouteDuplicatedExceptionIOException
-
getNewClassPackageNameRelative
-
getNewFilePath
-