Introduction

This document lists changes made to the Templates API. Please ask on the dev@openide.netbeans.org mailing list if you have any questions about the details of a change, or are wondering how to convert existing code to be compatible.


Index of APIs

Incompatible changes by date

Fuller descriptions of all changes can be found below (follow links).

Not all deprecations are listed here, assuming that the deprecated APIs continue to essentially work. For a full deprecation list, please consult the Javadoc.

All changes by date

Changes by version

These API specification versions may be used to indicate that a module requires a certain API feature in order to function. For example, if you see here a feature you need which is labelled 1.20, your manifest should contain in its main attributes the line:

OpenIDE-Module-Module-Dependencies: org.netbeans.api.templates > 1.20

Changes by affected class

org.netbeans.api.templates.CreateFromTemplateDecorator

org.netbeans.api.templates.FileBuilder

org.netbeans.api.templates.TemplateRegistration


Details of all changes by API and date


Templates API

Support for decorating the creation process

Mar 22 '17; API spec. version: 1.9; affected top-level classes: CreateFromTemplateDecorator

In addition to provide CreateFromTemplateHandler which overtakes the template processing, CreateFromTemplateDecorator can participate in file creation doing pre- and post-creation tasks and edits either in the created file or other files.

Maven Archetypes

Nov 1 '16; API spec. version: 1.8; affected top-level classes: TemplateRegistration; made by: jtulach; issues: #268677
One can now create project wizards that create new projects from Maven archetypes. See the how-to for more details.

Support for composition

Apr 23 '15; API spec. version: 1.5; affected top-level classes: FileBuilder; made by: sdedic; issues: #
TemplateHandler may need to create additional files, using the same parameters for creation as a base. Attribute providers may need to be processed in a custom way, which requires to create and manage CreateDescriptor by the client. This change allows to clone information from CreateDescriptor into an independent FileBuilder, and to create a Descriptor out of a Builder.

Support for Technology Ids

Mar 27 '15; API spec. version: 1.4; affected top-level classes: TemplateRegistration; made by: jtulach; issues: #246133

The HTML UI API for Java revision 1.1 supports technolgy identifiers. Now they can be used via TemplateRegistration annotation as well.

Package like Target Chooser for HTML Wizards

Feb 5 '15; API spec. version: 1.3; made by: jtulach; issues: #249891
One can use targetChooser:java to request Java-like target chooser showing java packages.

HTML UI for Templates

Dec 19 '14; API spec. version: 1.2; made by: jtulach
One new attribute page() to allow usage of HTML based UI driven by Java or JavaScript.

Separate template handling

Oct 14 '14; API spec. version: 1.0; made by: sdedic
Template handling need not depend on Data System APIs, should be available for clients that only know FileSystems. Relevant interfaces moved to openide.filesystems.templates module; see javadoc for FileBuilder for details.
Binary-compatible

Introduce targetName for templates.

Jan 29 '14; API spec. version: 0.99; affected top-level classes: org.netbeans.api.templates.TemplateRegistration; made by: jhavlin; issues: #239028

By default, files created from templates have name preinitialized to "new" + template name. TemplateRegistration.targetName can be used to customize how the file name will be preinitialized.


Built on October 23 2017.  |  Portions Copyright 1997-2017 Oracle. All rights reserved.