Package or folder icon? [message #1749196] |
Fri, 02 December 2016 17:07  |
Eclipse User |
|
|
|
We have a number of folders in the src tree of a project that have the "package" icon next to the folder name, but they are not really Java package folders -- just plain folders. I expect they got that way from copy/paste over the years. What is it that tells the Package Explorer to use the package icon rather than the "plain folder" icon? The properties for either says that the resource is of type "Folder".
Thanks,
Chris
|
|
|
|
|
Re: Package or folder icon? [message #1749217 is a reply to message #1749201] |
Sat, 03 December 2016 07:27   |
Eclipse User |
|
|
|
First let me repeat: "Do you have specific reasons why the package icon worries you?"
This distinction should in no way affect the functionality of the IDE.
The filter I spoke of is configured via the Java Build Path configuration in tab Source.
The idea here is to select which resources will be copied to your output folder (typically "bin", or "target/classes").
OK, here's one thing I can reproduce: If inside a source folder you create a folder with a name that is not a legal name for a Java package, then the folder is shown as folder, not package. And this makes perfect sense, because JDT can see that this will never legally be used as a package. For folders with a name that is legal as a package name, the tool cannot guess what you want to use it for, so when inside a source folder we assume : "package".
Finally: there is no secret property where we record that a folder is a package - on disk it's just a folder. All this is only how the physical structure is represented in the IDE.
Ergo: just don't worry about the icon, but if you still want to force a folder to be shown as a plain folder, not a package, give it a name that is illegal in Java (use any special character like "-", "." etc...)
|
|
|
Re: Package or folder icon? [message #1749237 is a reply to message #1749217] |
Sat, 03 December 2016 16:16  |
Eclipse User |
|
|
|
Stephan, it was not the icon that bothered me, it was the sort order. In fact, the folder had a "-" in the name and it sorted below all of the other folders, out of alphabetical order. Thanks for the explanation.
|
|
|
Powered by
FUDForum. Page generated in 0.03921 seconds