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 270116 - C++ Template class dialog
Summary: C++ Template class dialog
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Templates (show other bugs)
Version: 8.2
Hardware: PC Windows 10 x64
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-18 12:58 UTC by youpko
Modified: 2017-03-22 15:51 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description youpko 2017-03-18 12:58:56 UTC
I am trying to add my own templates via "Options > Tools > Templates". For non c++ class files this works fine.
But when i try to build a c++ class template from copying the class.cc and class.h file it works until i restard Netbeans (somethimes not at all).

When i create a new c++ class the IDE shows me the "New C++ Class" dialoge.
But when I try to create my custom c++ class i get the dialoge for only a new cpp file and not for both the c and h files, and the ${CLASSNAME} variable in the template doesn't work either.
Comment 1 Alexander Simon 2017-03-22 15:48:18 UTC
Work around.
- open in editor duplicated class and "Copy file path" (pop-up menu on editor tab header). Remember path.
- exit from IDE
- open in editor (not in NetBeans) file ".nbattr" in the folder where template is located.
- find strings like:
<attr name="templateWizardIterator" serialvalue=""/>
<!-- org.netbeans.modules.cnd.editor.filecreation.CndClassWizardIterator@6f436134 -->
replace it on:
<attr name="templateWizardIterator" newvalue="org.netbeans.modules.cnd.editor.filecreation.CndClassWizardIterator"/>
- Start IDE.
Comment 2 Alexander Simon 2017-03-22 15:51:24 UTC
Duplicate template does not set right "templateWizardIterator" attribute.
Reassign to evaluation.