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.
If you create a NetBeans RCP application with files registered as @TemplateRegistration(..., requireProject = false), the "New File..." offers the file but on the "Name and location" part of the wizard, the Browse... button to choose the directory doesn't work. When you click on it nothing happens. I think the problem is that it normally displays a popup to choose a directory based on the root directory of your project. Since in this case the application doesn't have a project, it fails (with no error). I think the solution would be to show the JFileChooser (like in Open File... menu item) and filter to only show/select directories. I have the problem in my project Joeffice (https://bitbucket.org/agoubard/joeffice/). I haven't pushed my changes yet. I've noticed the same project in ANTLRWorks2 (https://github.com/tunnelvisionlabs/antlrworks2)
I've moved the bug to projects as it seems to be a bug in Project UI. Here are more details. The bug is (I think) in SimpleTargetChooserPanelGUI.java#505 In case of the project == null of the action listener for the button, it gets the value of the combobox and stop if the value is null. Note that there is no combobox visible so the value is always null, so it never goes to the FileChooserBuilder. (See screenshot) Old code: if (group == null) { // #161478 return; } FileObject oldFo = previousTargetFolder != null ? group.getRootFolder().getFileObject(previousTargetFolder) : group.getRootFolder(); if (oldFo == null && previousTargetFolder != null) { oldFo = FileUtil.toFileObject(FileUtil.normalizeFile(new File(previousTargetFolder))); } New code should be FileObject oldFo = null; if (group != null) { // #249179 oldFo = previousTargetFolder != null ? group.getRootFolder().getFileObject(previousTargetFolder) : group.getRootFolder(); } if (oldFo == null && previousTargetFolder != null) { oldFo = FileUtil.toFileObject(FileUtil.normalizeFile(new File(previousTargetFolder))); }
Created attachment 151056 [details] Example showing the absence of the dropdown