How to use custom templates

  • monkeybanjo

    monkeybanjo - 2013-02-19


    I've just started using FastCode, and it seems like a great plugin. However, I'm having some trouble creating my own templates.

    After installation I've done the following -
    1 exported template, which created a "Fast Code Eclipse Plugin" project in my workspace.
    2 Edited the templates-config.xml, deleted all original templates and added my own( see below)
    3 Imported all templates. (and got a dialog saying import successful)

    I now see my template in the "Fast Code > Templates > Templates" Preferences page, but I don't see how i can use the template. The "Fast code > Templates" menu still contains the original list of templates, and I don't see my own. Additionally, the Ctrl-Shift-Alt-T shortcut doesn't seem to be working for me.

    I'd be really grateful if someone could help, as I'm not sure if there is something broken, or am i just doing things the wrong way?

    Thanks a lot,

    setup info:
    FastCode Version: 1.6.0
    eclipse Version: 3.7.2
    OS: MAC OS X 10.6.8

    eclipse.buildId M20120208-0800
    java.version= 1.6.0_37
    java.vendor= Apple Inc.
    BootLoader constants: OS=macosx, ARCH=x86, WS=cocoa, NL=en_US


    <?xml version="1.0" encoding="UTF-8"?>
        <template name="BEAN_SETTER_GETTER">
            <description>Create normal getters, and setters which fire propety changes</description>
            <allowed-file-names>*.java </allowed-file-names>
                    enum BoundProperty {
                    #foreach ($field in ${fields})
                        ${field.toUpperCase()} #if( $foreach.hasNext ), #end
                    #foreach ($field in ${fields})
                        public void set${,1).toUpperCase()}${}(${field.type} newValue) {
                            Type oldValue = ${};
                            ${} = newValue;
                            firePropertyChange(BoundProperty.${}, oldValue, newValue);       
                    #foreach ($field in ${fields})
                        public ${field.type} get${,1).toUpperCase()}${}() {
                            return ${};       
    • Support

      Support - 2013-02-21


      For now i would suggest you a work around.
      In the template-config.xml, retain the existing templates, and add your template along with them and try. You may added it in the beginning so that it is easy for you to see it in the preference page.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks