简体   繁体   English

为什么eclipse将所有包放在同一级别

[英]Why does eclipse put all packages at the same level

I've realized eclipse IDE puts all packages in a project (at least in a Java one) at the same level, eg: 我已经意识到eclipse IDE将所有包放在同一级别的项目中(至少在Java中),例如:

同一级别的包裹

However, browsing the file system, you can find that packages are treated in the expected multi-levelled way. 但是,浏览文件系统,您可以发现以预期的多级方式处理包。 Does this have any logical explanation? 这有什么合理的解释吗?

This is just a presentation feature. 这只是一个演示功能。 You can click on the little down arrow you see on the left of your screen shot and select Package Presentation -> Hierarchical to have it like your filesystem. 您可以单击屏幕截图左侧看到的小向下箭头,然后选择Package Presentation - > Hierarchical以使其像文件系统一样。

You can see this answer for more information. 您可以查看此答案以获取更多信息。

I asked the same question a couple of times and found the link in above answer helpful in order to change the presentation because it's an option hard to find. 我问了几次同样的问题,发现上面的答案中的链接对于更改演示文稿很有帮助,因为这是一个很难找到的选项。

About the Why part, I think it's because of Eclipse being DE-facto standard IDE for Android development and having the packages organized this way is more useful and it forces you to think about a way your classes are organized according to Android project guidelines. 关于Why部分,我认为这是因为Eclipse是Android开发的事实上的标准IDE,并且以这种方式组织的包更有用,它迫使您根据Android项目指南考虑类的组织方式。 It also looks quite like help files on http://developer.android.com/guide to me personally. 对我个人来说,它看起来也像http://developer.android.com/guide上的帮助文件。 Also another argument for this might be that in old versions of Eclipse (pre Android time) default view was different. 另外一个论点可能是在Eclipse的旧版本(Android时间之前)默认视图不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM