Question

I have a long list of Code Templates in NetBeans and I want to sort them somehow because I don't remember all of them. The abbreviation for my code templates is: user_template, something like this:

 alpha_sop  wich does:
 System.out.println(${cursor});

Also another one:

 alpha_psvm
 public static void main(String[] args) {
 ${cursor}
 }

And many many more... Is there a way that after I write alpha_ and press ctrl+space a list of all available templates that contain alpha_ dropdown in a list? Id kinda like to select from my own list...

Something like:

alpha_ ctrl+space
*Dropdown*
alpha_psvm (with description of code)
alpha_sop (with description of code)
Was it helpful?

Solution 2

This is the sollution for the templates to expand on code assistant (sorry but names are in spanish :P hope you get the idea)

It is impostant to chose CONTEXT where to apply those templates when pressing ctrl+space ... enter image description here

And after adding a context you can properly expand:

Small tutorial

It is important that the templates are structured properly with abbreviation and description...

OTHER TIPS

I'm currently using NetBeans 7.4 and it seems that CTRL+SPACE

Does in fact give me a list of suggestions for Code Templates.

I am not sure if CUSTOM templates get registered in the Code Assistance and seems there's been some bug reports already made.

Code Assistance for Code Templates

Code Assistance in the NetBeans IDE Java Editor: A Reference Guide

This functionality (autocompletion with code templates) does not exist in Netbeans. However, you can customize the IDE to achieve this functionality. See autocompleteNB on GitHub.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top