This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
It would be useful if ${class} could be used in code templates to have the name of the current class inserted. For example I'd like to define a code template protected ${class}() { throw new UnsupportedOperationException(); } to generate constructors for extendable utility (= only static members) classes.
Note this is more urgent now that I have added Logger and NbBundle templates to apisupport.project - both must use getClass(), which is more likely to be incorrect - preferable is always to use X.class.getName() but there is no way to reference the containing class from a template. Need a code template hint for this.
Fixed in main/ 9ab6fe4a3c92 You can now do ${var currClassName editable="false"} to use the name of the containing class to the caret position.
Integrated into 'main-golden', will be available in build *201001240200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/9ab6fe4a3c92 User: Tim Boudreau <tboudreau@netbeans.org> Log: #164597 and #179805 - ability to reference containing class in code templates, fix apisupport.project code templates (NbBundle, Logger) not to use getClass().
Verified in 6.9 RC1, thanks!