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.
Product Version: NetBeans IDE Dev (Build 201111150600) Java: 1.7.0_01; Java HotSpot(TM) 64-Bit Server VM 21.1-b02 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb) User directory: C:\Users\deuggercz\.netbeans\dev Cache directory: C:\Users\deuggercz\.netbeans\dev\var\cache Steps: 1. Use File | New Project... to create new Web Application project. 2. Select root node of your project. 3. Invoke File | New File... from main menu. 4. Select XML category and XML Document as file type. Push Next. 5. Type diary into File Name, leave Folder field to default value and press Next. 6. Let Well-formed Document option selected and press Finish. The new file should be in <default package> but doesn't. It seems that focus on the node determines path where the new file will be placed because when we select the Source Packages node or <default package> and after that create the new file then is everything fine.
Could you please take a screenshot of how the New XML Document Step 2 screen looks like after you type in the filename ? On my screen, the "Folder" input box is empty, indicating root of the project, that means OUTSIDE of all java packages (rooted at src/java). You may verify the full name of the file in the r/o text box below the Folder line. The default location indeed depends on the place selected at the time File|New File action is invoked; that location will become the default folder for creation.
No further input and/or confirmation, closing as incomplete until further input arrives.
That's right. The input box I have also empty. This is all right. The problem is that I close the window with new created file then I lose possibility manipulate with this file in the future because it isn't under project (Web Application). If we try these steps on the Java Application then the new file will be under <default package> not outside of all java packages. This is very strange and confusing behaviour. Controlling should be a uniform.
(In reply to comment #3) > The problem is that I close the window with new created file then I lose > possibility manipulate with this file in the future because it isn't under > project (Web Application). It can be still found in Files view, right ? If so ... I would say this is WONTFIX, we can't cover situation when user explicitly creates file out of 'structure visible in projects view'. Or did I miss anything ?
You are right. I just wanted to say that different behavior (wizard of Java Application vs. Web Application) may confuse users. If someone is used to a certain behavior for example from Java Application and then will pass to Web Application then he will be presumed the same behavior of the same things (for instance - manipulation with files). But this is probably ENHANCEMENT not DEFECT.
Actually, I've just created a plain Java project - if you select the root of the project and create an XML file (or more generally non-java resource), the folder will also default to the root of the project - outside all packages. See the attached screenshot. Only .java files or files directly related to java classes (e.g. hibernate mapping files etc) default to java package structure.
Created attachment 113335 [details] new XML file created in plain java project
You are right that all non-java classes shouldn't be in <default package> by default (only if user wanted it). Therefore this is the right behaviour. Sorry for reported the false bug.