Eclipse Package Explorer 和 Eclipse Project Explorer 有什么区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1265070/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the difference between the Eclipse Package Explorer and the Eclipse Project Explorer?
提问by Epaga
It seems to me these two views are virtually identical, especially since Galileo. Is this true, or am I missing out on some features of one or the other?
在我看来,这两种观点几乎完全相同,尤其是在伽利略之后。这是真的,还是我错过了其中一个的某些功能?
采纳答案by Csaba_H
According to the Eclipse help, the Project Explorer
根据 Eclipse 帮助,Project Explorer
provides a hierarchical view of the artifacts in the Workbench, which is customized by the specific configuration of your Workbench.
提供 Workbench 中工件的分层视图,该视图由 Workbench 的特定配置定制。
With only the java developer tools (JDT) installed the Project Explorer nearly looks and behaves for java projects as the Package Explorer (including refactoring and other source code operations in the context menu). But Project Explorer is usable for other languages and project types as well.
仅安装了 Java 开发人员工具 (JDT) 后,项目资源管理器的外观和行为几乎与包资源管理器一样(包括上下文菜单中的重构和其他源代码操作)。但 Project Explorer 也可用于其他语言和项目类型。
Additional plugins contributes "extra information" to the Project Explorer view making it much more "sophisticated". For example if you have the web tools installed and you have a Dynamic Web Project, the Project Explorer shows you additional tree nodes like Deployment Descriptor and JavaScript Resources. You can see (and configure) all available contributions in Project Explorer / Customize View... / Content.
附加插件为 Project Explorer 视图提供“额外信息”,使其更加“复杂”。例如,如果您安装了 Web 工具并且您有一个动态 Web 项目,则项目资源管理器会向您显示其他树节点,如部署描述符和 JavaScript 资源。您可以在Project Explorer / Customize View... / Content 中查看(和配置)所有可用的贡献。
For example using SpringSource Tool Suite 2.1.0 I have additional nodes for web projects, spring beans and web services. Because of this I favor using the Project Explorer.
例如使用 SpringSource Tool Suite 2.1.0 我有额外的节点用于 web 项目、spring bean 和 web 服务。因此,我更喜欢使用 Project Explorer。
回答by sleske
I believe the Project Explorer is meant as the successor for the Navigator, and is (for the most part) language-agnostic.
我相信 Project Explorer 是 Navigator 的继任者,并且(在大多数情况下)与语言无关。
The Package Explorer is specifically for Java projects, that's why it has stuff like refactoring in its context menus. The Package Explorer also shows Java classes and packages (as the name implies), while the Project Explorer shows folders and .java files.
包资源管理器专门用于 Java 项目,这就是为什么它在其上下文菜单中包含重构之类的内容。包资源管理器还显示 Java 类和包(顾名思义),而项目资源管理器显示文件夹和 .java 文件。
回答by PhiLho
Some differences I see (in Juno) on a Java project:
我在 Java 项目中看到的一些差异(在 Juno 中):
- In Project Explorer, context menu > New gives common Java artifacts, like Class, Interface, Enum, package... In Package Explorer, I see various kind of Projects, Web service, Folder, File, etc.
- In Package Explorer, I can drag'n'drop a class file between two packages, it will automatically do the refactoring (move and change package, and imports in other classes). Project Explorer just won't allow me to do a drag'n'drop.
- And as said, Project Explorer shows more information, eg. a Deployment Description, JavaScript resources, Deployed Resources, etc. whereas the Package Explorer is Java-centric.
- 在项目资源管理器中,上下文菜单 > 新建提供了常见的 Java 工件,如类、接口、枚举、包...在包资源管理器中,我看到了各种项目、Web 服务、文件夹、文件等。
- 在包资源管理器中,我可以在两个包之间拖放一个类文件,它会自动进行重构(移动和更改包,以及在其他类中导入)。Project Explorer 不允许我进行拖放操作。
- 如前所述,Project Explorer 显示了更多信息,例如。部署描述、JavaScript 资源、已部署资源等,而包资源管理器以 Java 为中心。
That's why I keep the two tabs side-by-side. :-)
这就是我将两个标签并排放置的原因。:-)
回答by Steve Chambers
One reason for preferring the Package Explorer is it is the only explorer that appears in the list when you select "Show In" on a file that is being edited or has been found in the Search view.
首选包资源管理器的一个原因是,当您在正在编辑或已在“搜索”视图中找到的文件上选择“显示在”时,它是唯一出现在列表中的资源管理器。
回答by mmseng
One thing I just noticed is that, at least when developing Java Android apps, Projects will not show up in the Package Explorer if their project.properties file is borked or non-existent.
我刚刚注意到的一件事是,至少在开发 Java Android 应用程序时,如果项目的 project.properties 文件被破坏或不存在,项目将不会显示在包资源管理器中。
I had only been using the Package Explorer and had the Project Explorer hidden, and I was pulling my hair out trying to figure out why my imported project wouldn't show up. My console was saying the project had no .properties file but it was not visible for me to right click -> fix properties
. Then I opened the Project explorer and it was there as it should be.
我只使用了包资源管理器并隐藏了项目资源管理器,我正在努力弄清楚为什么我导入的项目不会出现。我的控制台说该项目没有 .properties 文件,但我看不到 .properties 文件right click -> fix properties
。然后我打开了项目资源管理器,它应该在那里。
回答by Bombe
My Project Explorer hides folders that belong to a source code management system while the Package Explorer shows e.g. the .git
folder. Also, the Package Explorer offers more options that work with the source code, e.g. the refactoring stuff.
我的项目资源管理器隐藏属于源代码管理系统的文件夹,而包资源管理器显示例如.git
文件夹。此外,Package Explorer 提供了更多与源代码一起使用的选项,例如重构的东西。
回答by Premraj
- Project Explorer- This is an instance of the
CommonNavigator
that is provided by theorg.eclipse.ui.navigator.resources
plugin. It provides a view of the workspace and has a large number of NCEs(Navigator Content Extensions ) contributed for resources, Java, C, Web Tools, Data Tools, PHP, etc. Source - Project Exploreradditional nodes for web projects, enterprise projects, spring beans and web services.
- Package Explorer- Provided by the Java Development Tools(JDT) UI project, this provides a view of Java classes for the workspace.
- 项目资源管理器- 这是插件
CommonNavigator
提供的一个实例org.eclipse.ui.navigator.resources
。它提供了工作区的视图,并为资源、Java、C、Web 工具、数据工具、PHP 等提供了大量 NCE(导航器内容扩展)。来源 - Project Explorer用于 Web 项目、企业项目、spring bean 和 Web 服务的附加节点。
- 包资源管理器- 由Java 开发工具(JDT) UI 项目提供,它为工作区提供 Java 类的视图。