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 217930

Summary: Duplicit file types in New File for HTML/JavaScript and Other Category
Product: web Reporter: Vladimir Riha <vriha>
Component: HTML ProjectAssignee: Tomas Mysik <tmysik>
Status: NEW ---    
Severity: normal CC: ads, marfous, pjiricka, tmysik, vriha
Priority: P3    
Version: 7.3   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: screenshot

Description Vladimir Riha 2012-09-06 08:19:45 UTC
Created attachment 123974 [details]
screenshot

To reproduce:
- create a new HTML/JavaScript project
- invoke New File dialog

=> in HTML/JavaScript category, there is (among others): HTML, CSS, JS, JSON but the same types are also in Other category. This causes duplicity (as seen on context menu on attached screenshot) and problem with file creation (issue 216789)


 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)
Comment 1 David Konecny 2012-09-06 22:30:18 UTC
This is the same issue in Web Project only Web Project's version of HTML template is named "HTML". It is not good but there is a precedence and therefore I would not worry too much about this. :-)

The fix would be to drop templates enhanced by Web Project and HTML Project and improve the one in HTML module to be Project sensitive and provide better target chooser. And the same for JavaScirpt, CSS, etc.

Or any better idea how to resolve this? TomasM?
Comment 2 David Konecny 2012-09-06 22:42:07 UTC
Or alternative could be to "hide" those enhanced templates - giving them some type which would not be present in RecommendedTemplates (or whatever it is called)
Comment 3 Vladimir Riha 2012-09-07 07:17:29 UTC
Personally, I don't have a problem with the duplicities. The "problem" is that you can still create HTML and such in "incorrect" location (as described in issue 216789). And once I create HTML from Other by accident, the New in project's context menu will offer it to you so you can end up with creating HTML files in project dir instead of site root
Comment 4 Tomas Mysik 2012-09-07 07:22:53 UTC
BTW is it really so important to forbid user to create a file in some directory? I doubt... Moreover, we _really cannot_ know how our users will be using our IDE - maybe it could be a valid use case for someone to be able to create an HTML file in Test folder.
Comment 5 Vladimir Riha 2012-09-07 07:38:17 UTC
I don't know, David wrote that this came up from offline discussion. The core of 216789 was that invoking New on project node in Projects window puts file to project dir and thus make it hidden in Projects window...
Comment 6 David Konecny 2012-09-10 08:03:58 UTC
(In reply to comment #4)
> BTW is it really so important to forbid user to create a file in some
> directory?

Forbidding was never a problem. The problem was that creating a new file on project did not offer Site Root and other source roots.

I'm turning this issue into enhancement for future. The Web Project has the same problem with two HTML templates so it is a precedent. :-)
Comment 7 Tomas Mysik 2013-12-12 06:15:56 UTC
Taking over.
Comment 8 Vladimir Riha 2014-07-03 12:46:02 UTC
*** Bug 244883 has been marked as a duplicate of this bug. ***