Brand New Tutorial: File Template Plug-ins

There are different ways to create file templates in NetBeans IDE. One way is to right-click a file in the Projects window (or Files window) and choose Save as Template:

The Save As Template dialog box then pops up and you can select a category where the file template will be stored. Then, in the New File wizard, you'll find the template in the category where you stored it. However, what if there isn't a category that suits your template? What if you want to choose a different icon for your template? What if you want to add a description to the template (the description is visible at the bottom of the New File wizard)? And, most importantly, what if you want to share the template with your colleagues? It would be much easier if you could quickly create a plug-in that contains your template -- so that you could send it via e-mail (or place it on a shared server) to whoever needs it. The recipient would then be able to install the file templates using the Update Center. The file templates would end up in the New File wizard, just as if they were a standard part of NetBeans IDE:

Well, all of that is possible (as described in Create File Templates for NetBeans Module Development). However, there's now also a (DRAFT!) tutorial available.

Here it is: NetBeans File Template Plug-in Tutorial

Just imagine how cool it would be to learn about, for example, Cactus -- and to then create file templates that contain comments explaining how each of the methods work, which you can then share with your colleagues. Another area where this would be cool is to create Wicket templates, again with comments, which you can then send to others for re-use.

As with the other plug-in tutorials, this tutorial is at a very early draft stage -- neither the software described nor the procedure outlined reflect the final version of NetBeans Plug-in support for the next release. However, things are definitely stable enough to do some relatively simple things -- such as creating a file template plug-in. Plus, going through the tutorial will get your feet wet -- there's a lot more plug-in support on the way, so get on board at an early stage and your feedback will make a difference right from the start.


Post a Comment:
  • HTML Syntax: NOT allowed

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.


« July 2016