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 210454

Summary: Patch for: Code Templates: add 'currClassName'/'currClassFullName'/'currPackage' variables
Product: editor Reporter: 280Z28
Component: Completion & TemplatesAssignee: Dusan Balek <dbalek>
Status: RESOLVED FIXED    
Severity: normal CC: pfabier
Priority: P3 Keywords: PATCH_AVAILABLE
Version: -S1S-   
Hardware: PC   
OS: Windows 7   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 148947    
Attachments: Implementation

Description 280Z28 2012-03-30 15:39:01 UTC
Created attachment 117562 [details]
Implementation

The currPackage and currClassFullName hints would be similar to the currClassName hint, and could be used like the following:

I'm particularly interested in using this for modifying the default "logr" template by adding a usage comment:

// -D${fullClassVar editable="false" currClassFullName}.level=FINE
private static final ${loggerType type="java.util.logging.Logger" default="Logger" editable="false"} LOGGER = ${loggerType}.getLogger(${classVar editable="false" currClassName default="getClass()"}.class.getName());

The currPackage hint is not used here, but in the process of implementing the currClassFullName hint it was trivial to include as well.
Comment 1 Dusan Balek 2013-06-20 15:56:42 UTC
Unfortunately NB 7.4 is already feature frozen. Marking as an enhancement for
the next release.
Comment 2 markiewb 2014-07-09 21:54:16 UTC
@Dusan: Please review the patch. The original author (Samuel Harwell - NB - 280Z28) signed the OCA.
http://www.oracle.com/technetwork/community/oca-486395.html
Comment 3 Dusan Balek 2014-07-22 11:50:01 UTC
Slightly modified patch applied. Thanks for your contribution.

http://hg.netbeans.org/jet-main/rev/aaa5c188539c
Comment 4 Quality Engineering 2014-07-30 02:33:55 UTC
Integrated into 'main-silver', will be available in build *201407300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/aaa5c188539c
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #210454: Patch for: Code Templates: add 'currClassName'/'currClassFullName'/'currPackage' variables - applied.
Comment 5 markiewb 2015-03-26 22:26:18 UTC
*** Bug 183633 has been marked as a duplicate of this bug. ***