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.

Bug 255815 - Code Templates: add enclosing variables
Summary: Code Templates: add enclosing variables
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Templates (show other bugs)
Version: 8.2
Hardware: All All
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-08 19:54 UTC by gualtiero65
Modified: 2015-10-09 16:26 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gualtiero65 2015-10-08 19:54:48 UTC
It would be very useful to have enclosing info as template variables.

By enclosing I mean the name of the package/class/method where the code template is created.

Like what is available in Eclipse: 
http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2FgettingStarted%2Fqs-EditorTemplates.htm

See ${enclosing_type} which gives the name of the class so you can create a template like this:

private static final Logger LOGGER = LoggerFactory.get(${enclosing_type}.class);

which will be expanded with the class name.
Comment 1 Jiri Kovalsky 2015-10-09 15:49:18 UTC
Reassigned for further evaluation.
Comment 2 Martin Entlicher 2015-10-09 16:26:48 UTC
Looks like a reasonable enhancement.