UPDATED: Code Template Tools Module - Added import functionality and Expand Template action
I have updated the Code Template Tools Module on my NetBeans update center described (here). This version of the module has been tested with NB5.5 and 6.0dev.
What is new?
I have added two new actions.
- Edit:Expand Template (Ctrl+J SPACE)- this action lets you expand a code template on demand. If a word preceding the caret matches a code template name, invoking this action expands the code template. For example, with the Java editor caret after the word re like below:
re|
invoking the Expand Template action results in:
return|
This is different than NetBeans editor's built in functionality in that, the code template expansion can be invoked on demand. In case of Netbeans editor you have to type r e SPACE in exact sequence to expand the template (abbreviation).
- The Show Templates dialog now has an Import... button. When invoked the user is prompted to select the template file. The template file uses the same XML format as the
.../.netbeans/<nbversion>/config/Editors/text/<mime-type>/abbreviations.xml
file. There is no Export action required as you can simply define new templates and send the abbreviations.xml file from your .../.netbeans/<nbversion>/ via email (say!). This has an added advantage in that it only captures the templates added/customized by you. Now you can send your favorite code templates to your friends. I will be publishing some of my favorite code templates soon.
Sources
DISCLAIMER: This module is experimental. So no guarantees. Use the module at your own risk.
Posted by sandipchitale
( Dec 04 2006, 03:58:08 PM PST ) Permalink