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 163428

Summary: User create Java Code Template broken - Contexts not set
Product: editor Reporter: trvs2cool <trvs2cool>
Component: Completion & TemplatesAssignee: Dusan Balek <dbalek>
Status: RESOLVED DUPLICATE    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description trvs2cool 2009-04-22 20:04:21 UTC
When I create a new Java Code Template (via options->Editor->Code Template->New), the new template never appears in the
code completion popup.

However, if I edit an existing one, the existing one works as expected (including the changes I made).  

Looking at
$userdir/6.5/config/Editors/text/x-java/CodeTemplates/org-netbeans-modules-editor-settings-CustomCodeTemplates.xml, it
appears that the user created one does not have a context set, while the existing edited one does.

If I hand edit the xml and include a context on the user created one, everything works as expected.

So, either a context has to be set automatically on user created code templates or code templates without a context need
to be shown every where.

Additionally, it would be nice to know what contexts are available in the Java editor since they are just arbitrary
strings. 

I believe this is probably the same issue as mentioned in 160771, but that was incorrectly marked as an enhancement so I
created a new bug.
Comment 1 Vitezslav Stejskal 2009-04-24 12:45:43 UTC
Ideally the context should be selectable in Tools-Options -> Editor -> Code Templates. As you said it's the same problem
as issue #160771.

*** This issue has been marked as a duplicate of 160771 ***