简体   繁体   English

Eclipse Mars - 导入的项目未显示在 Project/Enterprise Explorer 中

[英]Eclipse Mars - imported projects don't show up in Project/Enterprise Explorer

I currently have 48 projects in my workspace.我目前的工作区中有 48 个项目。 All are cloned git repos that had existing projects that were then imported into Eclipse.所有克隆的 git 存储库都有现有项目,然后导入到 Eclipse。

The last three repos that I've imported into Eclipse have imported and migrated successfully but don't show up in either the Project or Enterprise Explorer views.我导入到 Eclipse 的最后三个存储库已成功导入和迁移,但未显示在项目或企业资源管理器视图中。 I can see that they exist in the.metadata/.plugins/org.eclipse.core.resources/.projects folder.我可以看到它们存在于 .metadata/.plugins/org.eclipse.core.resources/.projects 文件夹中。

I can search the projects and create a working set, and I can add the EAR files to the server, and I can open the files, but I can't do anything that I would normally do from the Project Explorer, including viewing their properties or deleting them.我可以搜索项目并创建一个工作集,我可以将 EAR 文件添加到服务器,我可以打开这些文件,但是我不能做任何我通常会在 Project Explorer 中做的事情,包括查看它们的属性或删除它们。

I had thought that Eclipse might have an upper limit on how many projects could be viewed, but my co-worker says she has 107 projects currently in her workspace.我原以为 Eclipse 可能对可以查看的项目数量有上限,但我的同事说她目前在她的工作区中有 107 个项目。

也许项目被活动的工作集或“ 专注于活动的任务”隐藏了。

How to change Eclipse's "Project Explorer" "Filters and Customization" view settings to force projects and files and folders to show up and not be hidden, such as nested projects如何更改 Eclipse 的“Project Explorer”“Filters and Customization”视图设置以强制显示而不隐藏项目、文件和文件夹,例如嵌套项目

Tested in Eclipse Version 2021-06 (4.20.0), Build ID: 20210612-2011 on Linux Ubuntu 18.04.在 Eclipse 版本 2021-06 (4.20.0) 中测试,构建 ID:20210612-2011,Linux Ubuntu 18.04。

Quick Summary快速总结

Go to the "Project Explorer" tab, click the 3 vertical dots in the top-right corner of that pane, then go to "Filters and Customization...", as shown here: Go 到“Project Explorer”选项卡,单击该窗格右上角的 3 个垂直点,然后 go 到“Filters and Customization...”,如下所示:

在此处输入图像描述

Uncheck the box for "Nested Projects: hide top-level project if shown as nested" and "Nested Projects: hide folders when project is shown as nested", and click "OK":取消选中“嵌套项目:如果显示为嵌套则隐藏顶级项目”和“嵌套项目:当项目显示为嵌套时隐藏文件夹”复选框,然后单击“确定”:

在此处输入图像描述

Details细节

I'm having this exact problem in Eclipse Version 2021-06 (4.20.0), Build ID: 20210612-2011 on Linux Ubuntu 18.04 .我在Eclipse 版本 2021-06 (4.20.0),内部版本号:20210612-2011 Linux Ubuntu 18.04中遇到了这个确切的问题。

It turns out it's because of the Project Explorer "Filters and Customization..." settings, as I learned from @howlger's answer .事实证明,这是因为项目资源管理器的“过滤器和自定义...”设置,正如我从@howlger 的回答中了解到的那样。

After adding a code repository directory as a project, I can see it showing up in the deprecated "Navigator" tab, shown as "Navigator (Deprecated)" in Eclipse here (I have blurred images for privacy ):在将代码存储库目录添加为项目后,我可以看到它出现在已弃用的“导航器”选项卡中,在此处的 Eclipse 中显示为“导航器(已弃用)”(出于隐私考虑,我对图像进行了模糊处理):

在此处输入图像描述

However, it does not show up in the "Project Explorer" tab, which is shown below!然而,它并没有出现在“Project Explorer”选项卡中,如下所示!

The problem is that the "Project Explorer" tab's "Filters and Customization..." settings are filtering out this project and not showing it.问题是“Project Explorer”选项卡的“Filters and Customization...”设置过滤掉了这个项目而不显示它。 In my particular case, that is because the project I am adding is a subrepo within another git repo, which means it is a project nested within another Eclipse project, and my view settings are mistakenly set to exclude all "nested projects".在我的特殊情况下,这是因为我要添加的项目是另一个 git 存储库中的子存储库,这意味着它是一个嵌套在另一个 Eclipse 项目中的项目,并且我的视图设置被错误地设置为排除所有“嵌套项目”。 Your case or reason may be different, but in either case, if your project is not showing up in your "Project Explorer" tab, then it is likely because your "Filters and Customization" settings are set to exclude it from view.您的情况或原因可能不同,但在任何一种情况下,如果您的项目未显示在“项目资源管理器”选项卡中,则可能是因为您的“过滤器和自定义”设置已将其从视图中排除。

To fix this for my case, go to the "Project Explorer" tab, click the 3 vertical dots in the top-right corner of that pane, then go to "Filters and Customization...", as shown here:要针对我的情况解决此问题,请将 go 转到“项目资源管理器”选项卡,单击该窗格右上角的 3 个垂直点,然后将 go 转到“过滤器和自定义...”,如下所示:

在此处输入图像描述

Next, click the "Pre-set filters" tab, then scroll down and uncheck the box for "Nested Projects: hide top-level project if shown as nested".接下来,单击“预设过滤器”选项卡,然后向下滚动并取消选中“嵌套项目:如果显示为嵌套则隐藏顶级项目”框。 I recommend you also uncheck the box for "Nested Projects: hide folders when project is shown as nested", but I'm not 100% sure what that one does, as unchecking the other box alone caused my project to show up.我建议您还取消选中“嵌套项目:当项目显示为嵌套时隐藏文件夹”复选框,但我不是 100% 确定它的作用,因为单独取消选中另一个框会导致我的项目出现。 Here is a screenshot, with the appropriate areas highlighted in yellow:这是一个屏幕截图,适当的区域以黄色突出显示:

在此处输入图像描述

Any of the items in this list will be hidden from view in the "Project Explorer" tab if their box is checked.如果复选框被选中,此列表中的任何项目都将在“项目资源管理器”选项卡中隐藏 So, go through the list in detail and uncheck anything else you might see fit, if applicable.因此,go 详细浏览列表并取消选中您认为合适的任何其他内容(如果适用)。 I took a look and left all the rest of my view settings there as-is.我看了一下,并按原样保留了我的视图设置的所有 rest。

Click the "OK" button when done, and voila!--my nested and previously-added project now shows up in the "Project Explorer" view!完成后单击“确定”按钮,瞧!我的嵌套和以前添加的项目现在显示在“项目资源管理器”视图中!

NB: due to some sort of bug in Eclipse, you may have to repeat the above process every time you close and reopen Eclipse. :( But, you can probably do it faster now from the "Recent Filters" section of the 3-dots menu.注意:由于 Eclipse 中的某种错误,您可能必须在每次关闭并重新打开 Eclipse 时重复上述过程。:( 但是,您现在可以从 3 点的“最近的过滤器”部分更快地完成菜单。

Update: it looks like changing the "Projects Presentation" setting from "Hierarchical" to "Flat" blocks this bug and prevents you from having to fix the "Filters and Customization" setting every time you re-open Eclipse.更新:似乎将“项目演示”设置从“分层”更改为“平面”可阻止此错误,并防止您每次重新打开 Eclipse 时都必须修复“过滤器和自定义”设置。

Here is how: click the 3 vertical dots menu in the "Project Explorer" window --> "Projects Presentation" --> choose "Flat", as shown below:具体方法如下:点击“Project Explorer”中的3个垂直点菜单window --> “Projects Presentation” --> 选择“Flat”,如下图:

在此处输入图像描述

Other references其他参考资料

  1. Here is the relevant official Eclipse documentation on this: https://help.eclipse.org/: Showing or hiding files in the Project Explorer view :这是相关的官方 Eclipse 文档: https://help.eclipse.org/:在 Project Explorer 视图中显示或隐藏文件

    在此处输入图像描述

    Showing or hiding files in the Project Explorer view在 Project Explorer 视图中显示或隐藏文件

    You can choose to hide system files or generated class files in one of the navigation views.您可以选择在其中一个导航视图中隐藏系统文件或生成的 class 文件。 (System files are those that have only a file extension but no file name, for example.classpath.) (系统文件是那些只有文件扩展名而没有文件名的文件,例如.classpath。)

    1. On the toolbar for the Project Explorer, click the Menu button Menu button [3 vertical dots] to open the drop-down menu of display options.在 Project Explorer 的工具栏上,单击 Menu button Menu button [3 vertical dots] 打开显示选项的下拉菜单。
    2. Select Filters and Customization.., . Select过滤器和定制.., .
    3. In the dialog box that opens, select the Filters tab and then select the checkboxes for the types of files that you want to hide or define your own name-based filters in the User filters tab.在打开的对话框中,选择 select 过滤器选项卡,然后选择 select 您要隐藏的文件类型的复选框,或者在用户过滤器选项卡中定义您自己的基于名称的过滤器。

    In addition, you can restrict the displayed files to a working set.此外,您可以将显示的文件限制为一个工作集。

    1. On the toolbar for the Project Explorer, click the Menu button [3 vertical dots] to open the drop-down menu of display options.在 Project Explorer 的工具栏上,单击菜单按钮[3 个垂直点] 打开显示选项的下拉菜单。
    2. Choose Select Working Set...选择Select 工作集...
    3. Select an existing working set from the list or create a new one by selecting New... Select 列表中的现有工作集或通过选择新建...创建新的工作集
  2. My Q&A on how to blur images in GIMP: Graphic Design: How do I do a privacy blur on a section, selection, or region of an image in GIMP?我关于如何在 GIMP 中模糊图像的问答:平面设计:如何在 GIMP 中对图像的部分、选择或区域进行隐私模糊?

  3. My personal Eclipse setup document: Eclipse setup instructions on a new Linux (or other OS) computer: Troubleshooting我个人的 Eclipse 设置文档: Eclipse 在新的 Linux(或其他操作系统)计算机上的设置说明:故障排除

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

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