Class TemplatesHelper
java.lang.Object
org.libreoffice.ide.eclipse.core.utils.TemplatesHelper
Provides convenient methods to load, and save templates of Java source
files into a target projet.
In order to generate the template foo/bar.java.tpl, the following call call be used, where LoadingClass is a class from which it is possible to run a getResource( "foo/bar.java.tpl" ) to get the file.
TemplatesHelper.copyTemplate( myProject, "foo/bar", LoadingClass.class );
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcopyTemplate(org.eclipse.core.resources.IProject project, String templateName, Class<?> clazz, String destPath, Object... args) Copies the template to the project.static voidcopyTemplate(IUnoidlProject project, String templateName, Class<?> clazz, String destSuffix, Object... args) Copies the template to the UNO project.
-
Field Details
-
JAVA_EXT
- See Also:
-
-
Constructor Details
-
TemplatesHelper
public TemplatesHelper()
-
-
Method Details
-
copyTemplate
public static void copyTemplate(IUnoidlProject project, String templateName, Class<?> clazz, String destSuffix, Object... args) Copies the template to the UNO project.- Parameters:
project- the project where to copy the filetemplateName- the template name (without the extension)clazz- the class from which to load the resource filedestSuffix- the subpath in which the file should be copied, relatively to the implementation package.args- additional arguments to pass to the formatter
-
copyTemplate
public static void copyTemplate(org.eclipse.core.resources.IProject project, String templateName, Class<?> clazz, String destPath, Object... args) Copies the template to the project.- Parameters:
project- the project where to copy the filetemplateName- the template name (without the extension)clazz- the class from which to load the resource filedestPath- the path in which the file should be copied, relatively to the project root.args- additional arguments to pass to the formatter
-