How to make Netbeans' templates that creates more than 1 file?

后端 未结 1 1759
悲&欢浪女
悲&欢浪女 2021-01-12 23:57

One of the most awesome features of Netbeans is to generate code using some FreeMarker templates. I have some questions about it, I hope someone here can help me.

Ho

相关标签:
1条回答
  • 2021-01-13 00:53

    You could create your own project template. Here's some instructions for doing that:

    http://netbeans.dzone.com/tips/hack-your-own-custom-project-t

    So, you could create a new project and use the "JSF Pages From Entity Beans" wizard and then add your own files. Then you would follow from step 2 of the above link and create the template.

    Edit After giving this some more thought I think that what you're really looking for is creating a File Template Module:

    http://platform.netbeans.org/tutorials/60/nbm-filetemplates.html

    Edit 2: Based on your comment I'm posting a url to Geertjan's blog for a short description on how to create multiple files from a single wizard*. However, after more reflection I understand that this is also not what you want. What you really want is the ability to add another file to an existing wizard (JSF from Entity). This is of course possible but not as simple as creating your own wizard as the only way to do such a thing is to modify the source code for that particular module (JSF Support).

    *Understand that the above tutorial is showing only a snippet of how to create your own New File wizard. There are a few aspects that are assumed to be understood already and not discussed.

    0 讨论(0)
提交回复
热议问题