i want to make a code template in netbeans with the abbreviation of cn that will expand into the name of the current class being worked on, is there a way to do this? i cannot find anything about it. google won't turn up any good info

Recommended Answers

All 2 Replies

I didn't find much detailed documentation on the available parameters for code templates besides ${cursor} and ${selection} - even in the netbeans api docs themselves for the editor.codetemplates package.

File templates use ${name} for that, but it didn't work in the editor code templates.

oh well, i was just writing a class for a 3D vector and most of the math methods for it either returned or took as an argument an instance of the class, so it was bothersome to keep rewriting Vector3D every time it was needed and thought that writing cn would be much easier. well if anyone finds anything please post it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.