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.
I have Client Side project with site root set to some "folderA" directory: [project]/[folderA] If you invoke New File on Site Root node, then the file is placed into site root "folderA": [project]/[folderA]/[newfile] That's OK. However if you invoke New File on project node in Projects window, the file is placed into project root [project]/[newfile] and therefore "hidden" (speaking about Projects window) from user. I think it would make sense to set default location in 2nd case to site root as well. IMHO default location for "project way" and "site root" way should be the same Product Version: NetBeans IDE Dev (Build EaselCSS-480-on-20120813) Java: 1.7.0_06; Java HotSpot(TM) Client VM 23.2-b09 System: Linux version 3.0.0-23-generic-pae running on i386; UTF-8; en_US (nb)
What needs to be done here is similar to what web.core module does. There are two different HTML file wizards - one in "Other" category and second in "Web" category. The Web category wizard has additional field called Location which lists project's source groups which user can select from. In HTML5 Project case the location will list "Site Root", "Unit Tests", "Configuration Files". That should address this problem I think, right? Unfortunately the way this is implemented in web.core module is too EE cluster dependent and cannot be trivially refactored. I will fix this later once more serious issues are resolved.
A note from offline discussion: Location content should be different for different types, eg. HTML should have only Site Root location, but JavaScript should be allowed in both Site Root and Tests.
I am hitting this quite often and this is a release stopper -> P2.
If you would have time Tomas go ahead and grab this issue from me. :-)
Taking over.
Davide, any reason why CONFIG folder is registered as GENERIC source root and not HTML5-Sources source root? I guess this is a bug - I will fix it.
(In reply to comment #6) > Davide, any reason why CONFIG folder is registered as GENERIC source root and > not HTML5-Sources source root? I guess this is a bug - I will fix it. http://hg.netbeans.org/web-main/rev/e0f20ad29a04
Fixed. Right now, for (X)HTML and CSS files, only Site root is available. For other file types, all the roots (Site root, Unit test, Config) are available. Please verify, thanks. http://hg.netbeans.org/web-main/rev/19e7ea520bae
Integrated into 'main-golden', will be available in build *201209060001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/19e7ea520bae User: Tomas Mysik <tmysik@netbeans.org> Log: #216789 - Default location of a new file in ClientSide project with Site Root
(In reply to comment #8) > Fixed. Right now, for (X)HTML and CSS files, only Site root is available. For > other file types, all the roots (Site root, Unit test, Config) are available. Thanks, if you select HTML & CSS file from HTML/JavaScript category then yes (XHTML is missing here), it works that way. However there is also category Other with HTML, XHTML and CSS files as well and if you create these files from this category, they can be created "anywhere" and it causes some other problems, reported as issue 217930. So I'll wait with verifying/reopening for resolution of 217930. Product Version: NetBeans IDE Dev (Build 201209060001) Java: 1.7.0_07; Java HotSpot(TM) Client VM 23.3-b01 System: Linux version 3.2.0-29-generic-pae running on i386; UTF-8; en_US (nb)
The provided fix is not extendable. It just gives the Wizard Iterator to use it with templates instead of providing WizardDescriptor.Panel instance which could be reused in any wizard iterator. I would suggest to do the something similar to the Templates.buildSimpleTargetChooser().create() pattern (or just one static method): it's return value should be ready to use WizardDescriptor.Panel instance implemented in the same way as private WizardDescriptor.Panel<WizardDescriptor>[] getPanels() method in the provided fix: Project project = Templates.getProject(descriptor); SourceGroup[] groups = filterSourceGroups(project, Templates.getTemplate(descriptor), ClientSideProjectUtilities.getSourceGroups(project)); WizardDescriptor.Panel<WizardDescriptor> simpleTargetChooserPanel = Templates.buildSimpleTargetChooser(project, groups).create(); One additional thing has to be added : setTargetFolder(); This method should be moved from initialize() method. Such implementation allows to reuse the code in any custom wizard iterators. The method should be available in the web.clientproject.api module instead of web.clientproject.
(In reply to comment #10) > However there is also category Other with HTML, XHTML and CSS files as well and > if you create these files from this category, they can be created "anywhere" > and it causes some other problems, reported as issue 217930. Let's deal with that in issue 217930. (In reply to comment #11) > The provided fix is not extendable. Make sense to turn this into some simple API so that Denis can used it from his wizard in REST module.