How to add code templates?

1. Create your template file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE codetemplates PUBLIC "-//NetBeans//DTD Editor Code Templates settings 1.0//EN" "">
    <codetemplate abbreviation="hello" xml:space="preserve">
        <code><![CDATA[Hello ${world}]]></code>
        <description><![CDATA[Bla bla bla]]></description>

2. Register it for the mimetype in the layer.xml

    <folder name="Editors">
        <folder name="text">
            <folder name="x-java">
                <folder name="CodeTemplates">
                    <file name="my-templates.xml" url="my-templates.xml"/>
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo