@Target({TYPE,METHOD,PACKAGE})
@Retention(SOURCE)
public @interface TemplateRegistration
InstantiatingIterator for a custom template;
or on a package to register a plain-file template with no custom behavior
or define an HTML wizard using the page attribute.TemplateRegistrations,
org.netbeans.spi.project.ui.templates.support| Modifier and Type | Required Element | Description |
|---|---|---|
java.lang.String |
folder |
Subfolder in which to place the template, such as
Other or Project/Standard. |
| Modifier and Type | Optional Element | Description |
|---|---|---|
java.lang.String[] |
category |
Optional list of categories interpreted by the project system.
|
java.lang.String[] |
content |
File contents, as resources relative to the package of this declaration.
|
java.lang.String |
description |
Optional but recommended relative resource path to an HTML description of the template.
|
java.lang.String |
displayName |
Localized label for the template.
|
java.lang.String |
iconBase |
Icon to use for the template.
|
java.lang.String |
id |
Special file basename to use rather than inferring one from the declaring element,
when
content() is empty. |
java.lang.String |
page |
Location of the HTML page that should be used as a user interface
for the wizard while instantiating this template.
|
int |
position |
Optional position within
folder(). |
boolean |
requireProject |
Set to false if the template can be instantiated without a project.
|
java.lang.String |
scriptEngine |
Optional name of a script engine to use when processing file content, such as
freemarker. |
java.lang.String |
targetName |
Default (pre-filled) target name for the template, without extension.
|
java.lang.String[] |
techIds |
Selects some of provided technologies.
|
java.lang.String folder
Other or Project/Standard.int position
folder().java.lang.String id
content() is empty.
Useful for pure templates referenced from PrivilegedTemplates.java.lang.String[] content
Normally only a single file is specified, but for a multifile data object, list the primary entry first.
The file basenames (incl. extension) of the actual template files (as in TemplateWizard.getTemplate())
will be taken from the basename of the content resources, though a .template suffix
may be appended to prevent template resources in a source project from being misinterpreted.
For a "pure" custom iterator with no specified content, the template basename
defaults to the FQN of the class or method defining it but with - for . characters,
e.g. pkg-Class-method, but may be overridden with id().
Example usage for a simple, single-file template (with or without custom iterator):
content="resources/empty.php"
For a form template:
content={"Login.java.template", "Login.form.template"}java.lang.String displayName
content() is specified, in which case it would be defaulted by the data node.
May use the usual #key syntax.java.lang.String iconBase
content() is specified, in which case it would be defaulted by the data node.java.lang.String description
java.lang.String scriptEngine
freemarker.ScriptEngineFactory.getNames()java.lang.String[] category
boolean requireProject
java.lang.String targetName
#key syntax for localization or branding.java.lang.String page
OpenIDE-Module-Needs: org.netbeans.api.templates.wizardThere is a tutorial describing usage of HTML UI in wizards in NetBeans wiki.
java.lang.String[] techIds
Built on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.