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 188578 - some C/C++/Fortran templates are not editable
Summary: some C/C++/Fortran templates are not editable
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on: 167205
Blocks:
  Show dependency tree
 
Reported: 2010-07-12 10:27 UTC by Alexey Vladykin
Modified: 2010-11-03 17:15 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 Alexey Vladykin 2010-07-12 10:27:56 UTC
Open Tools -> Templates. For some templates the "Open in Editor" button is disabled. Examples: C -> C Source File, C++ -> C++ Source File, Fortran -> Empty Fortran File, several entries under C/C++ Tests.
Comment 1 Alexander Simon 2010-10-28 11:54:54 UTC
org.netbeans.modules.favorites.templates.TemplatesAction uses wrnog assumption about "editable" template. It check in the method propertyChange():
-----------
  FileObject fo = dobj.getPrimaryFile ();
  File f = FileUtil.toFile (fo);
  res = f != null || fo.getSize () > 0;
-----------
As result empty template cannot be edit (see also Bug #152388).
I do not know why TemplatesAction use such logic.
I prefer to fix CND templates by adding new line symbol.
By the way a good practice to have a new line symbol at the end of file in the C/C++ files.

Fixed, change sets:
http://hg.netbeans.org/cnd-main/rev/58f9a0dd0fbc
http://hg.netbeans.org/cnd-main/rev/946bc3752714
Comment 2 Quality Engineering 2010-10-29 02:59:39 UTC
Integrated into 'main-golden', will be available in build *201010290000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/58f9a0dd0fbc
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug #188578 some C/C++/Fortran templates are not editable