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.
Following test fail, because no such option is shown in menu 1.1 Test suite: Favorites New folder in root of favorites folder 1 Select a root of mounted folder in Favorites (e.g. your home folder). 2 Perform popup New | Folder on the selected node. 3 The New folder dialog is shown. Type "MyFolder" and then push the OK button. EXPECTED RESULT: Folder "MyFolder" is created in the selected folder. Test result: fails in step 2 - no "Folder" option is shown Tested on: Product Version: NetBeans IDE Dev (Build 201206080001) Java: 1.7.0; Java HotSpot(TM) Client VM 21.0-b17 System: Windows 7 version 6.1 running on x86; Cp1252; en_US (nb)
the action should be added in org.netbeans.modules.project.ui.NoProjectNew.getTemplates() - for some reason Templates/Other/file is found but Templates/Other/Folder not. Probably related to bug #20891.
I've already found the cause. The problem is, that org.openide.filesystems.Repository.getDefault().getDefaultFileSystem().findResource("Templates/Other/Folder") returns null. This is caused by http://hg.netbeans.org/main/rev/ecd5369886ab in particular: <folder name="Other"> <file name="Folder_hidden"/> </folder> Folder should be generated by NewFileIterator.folderIterator(), but it changes the name. This fixes this issue: diff -r 10c265058592 projectui/src/org/netbeans/modules/project/ui/NoProjectNew.java --- a/projectui/src/org/netbeans/modules/project/ui/NoProjectNew.java Thu Jun 14 17:12:15 2012 +0200 +++ b/projectui/src/org/netbeans/modules/project/ui/NoProjectNew.java Fri Jun 15 17:07:27 2012 +0200 @@ -209,7 +209,7 @@ tList.add( template ); } - template = findTemplate( "Templates/Other/Folder" ); + template = findTemplate( "Templates/Other/org-netbeans-modules-project-ui-NewFileIterator-folderIterator" ); if ( template != null ) { tList.add( template ); } But IMHO the correct fix would be: diff -r 10c265058592 projectui/src/org/netbeans/modules/project/ui/NewFileIterator.java --- a/projectui/src/org/netbeans/modules/project/ui/NewFileIterator.java Thu Jun 14 17:12:15 2012 +0200 +++ b/projectui/src/org/netbeans/modules/project/ui/NewFileIterator.java Fri Jun 15 17:08:16 2012 +0200 @@ -96,7 +96,8 @@ displayName="#folderIterator", iconBase="org/openide/loaders/defaultFolder.gif", description="templatesFolder.html", - category="simple-files" + category="simple-files", + id="Folder" ) @Messages("folderIterator=Folder") public static NewFileIterator folderIterator () { But I do not know, how to reliably replace the original Other/Folder with this one. We hit issue #208919 here.
IMHO it would be worth to at least use Templates/Other/org-netbeans-modules-project-ui-NewFileIterator-folderIterator in NB 7.2 so that the Folder action is threre and prepare a better fix into 7.3.
(In reply to comment #2) > This fixes this issue: Good enough I think; bug #208919 might not be fixed.
the first suggested patch of changing the template didn't work for me. even a clean build of the entire netbeans codebase only resulted in "Empty file" on the home folder's popup
I cannot see other solution then getting rid of the annotation and do the manual registration in projectui again..
http://hg.netbeans.org/core-main/rev/06e75927b26b i've fixed the problem by reverting the annotation based registration for Folder
Probably a fix of bug #51978 would work as well.
Integrated into 'main-golden', will be available in build *201210070002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/06e75927b26b User: Milos Kleint <mkleint@netbeans.org> Log: #214254 revert the template registration annotation for folder which is sort of a special case.