Using API Templates

A number of useful templates for API objects are added to your templates area. In most cases, groups are used so you can create a whole set of related classes (including an icon) at once. All are under API_Support in your templates directory.

Each group of templates, and each major template, has an accompanying description to give you an idea of what that template is for and what you can customize in it. Please browse through these descriptions if you are not familiar with the types of objects involved.

When using groups, remember that you can instantiate either the whole group or just one element. When instantiating a group, e.g. Cookie_action, give a simple name unique to your task like Rot13 in the dialog--then you will get e.g. Rot13Action and Rot13ActionIcon. When instantiating an individual member such as __Sample_cookie__Action, you may wish to manually append everything after the last __, e.g. specify Rot13Action in the dialog.

Warning: these templates are primarily designed for use with NetBeans 3.1 and later, although with some care most are also suitable for NetBeans 3.0 builds or with Forte for Java 2.0 (you will have to be careful to avoid using newer API features). Some things to watch out for: sometimes when creating files from template in 3.0, certain tokens such as __NAME__ may be left unsubstituted (whereas later builds will produce proper code from them); you may have to manually update these. Some APIs used by the templates may be newer than 3.0, such as NbBundle.getMessage(...); replace them with older equivalents (here NbBundle.getBundle(...).getString(...)). Users of both FFJ 2.0 and NB 3.0 will need to avoid any use of XML layers which are not supported in these versions of the IDE.


Back to Contents