简体   繁体   English

在Eclipse中的Java EE透视图中的包呈现

[英]Package presentation in Java EE perspective in eclipse

I have a problem when switching to my Java EE perspective in eclipse indigo. 在eclipse indigo中切换到我的Java EE透视图时遇到问题。

In my Java perspective I have this layout: 在我的Java透视图中,我有这样的布局:

非折叠包布局

But when I switch to Java EE perspective I get this: 但是,当我切换到Java EE透视图时,我得到了这个:

折叠包布局

I have tried this and this unsuccessfully. 我已经试过失败。 I want to have the first layout in the Java EE perspective. 我希望在Java EE透视图中拥有第一个布局。 Is there a way to do it? 有办法吗?

Package presentation can be found here : 包装演示可在此处找到:

在此输入图像描述

These are my settings in eclipse 4.2 which result in the layout you want: 这些是我在eclipse 4.2中的设置,它会产生你想要的布局:

- folder presentation: grouped
- package presentation: flat

You can switch this using the "Package Presentation -> Flat" from the drop down menu in the project explorer. 您可以使用项目资源管理器中下拉菜单中的“Package Presentation - > Flat”来切换它。

包装演示快照

The above answers do not really solve the real problem that most noobs experience in Eclipse. 以上答案并没有真正解决大多数新手在Eclipse中遇到的真正问题。 So I thought I would add an answer to this question since the questioner resolved to reinstalling eclipse which is not necessary nor a viable solution. 所以我想我会为这个问题添加一个答案,因为提问者决定重新安装不必要的eclipse,也不是一个可行的解决方案。 The real issue is that when you created or rather imported this project, you picked the option to create a Project in eclipse, not a Java Project . 真正的问题是,当您创建或者更确切地导入此项目时,您选择了在eclipse中创建Project的选项,而不是Java Project If you pick Project , it creates it as a filesystem looking directory structure similar to what you see in windows explorer. 如果选择Project ,它会将其创建为一个文件系统,看起来类似于您在Windows资源管理器中看到的目录结构。 To fix this, just re-import your project from the workspace as a "Java Project" and you can change the package structure as flat or hierarchical as per your viewing pleasure.. Hope this helps. 要解决这个问题,只需将项目从工作区重新导入为“Java项目”,然后根据您的观看乐趣将包结构更改为平面或分层。希望这会有所帮助。

You can also import your project by using "import existing maven projects" . 您还可以使用“导入现有的maven项目”导入项目。 It will then configure the folders to be flat. 然后,它会将文件夹配置为平面。

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

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