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

Summary: C++ Template class dialog
Product: platform Reporter: youpko
Component: TemplatesAssignee: Martin Entlicher <mentlicher>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Windows 10 x64   
Issue Type: DEFECT Exception Reporter:

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.