为什么 Eclipse Java Package Explorer 在某些类上显示问号?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4307086/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 15:41:31  来源:igfitidea点击:

Why does Eclipse Java Package Explorer show question mark on some classes?

javaeclipsehelios

提问by dfdumaresq

In the Eclipse Helios Java Package Explorer, I see the Java class icons display a small question mark to the right of the 'J', something like [J?]. This icon is shown on each class within one package in my project, but I cannot find an explanation for this in the documentation.

在 Eclipse Helios Java Package Explorer 中,我看到 Java 类图标在“J”的右侧显示一个小问号,类似于 [J?]。这个图标显示在我项目中一个包内的每个类上,但我在文档中找不到对此的解释。

enter image description here

在此处输入图片说明

At some point I expect them to disappear and be replaced with small orange rectangles. (Of which I'm also not certain of their meaning, but less worried of their connotation.) I suppose this question points to a larger one, are any of these icons defined together somewhere?

在某些时候,我希望它们消失并被小的橙色矩形取代。(其中我也不确定它们的含义,但不太担心它们的含义。)我想这个问题指向一个更大的问题,这些图标中的任何一个是否在某处一起定义?

采纳答案by Aleks Felipe

It means the class is not yet added to the repository.

这意味着该类尚未添加到存储库中。

If your project was checked-out (most probably a CVS project) and you added a new class file, it will have the ?icon.

如果您的项目已被检出(很可能是 CVS 项目)并且您添加了一个新的类文件,它将有?图标。

For other CVS Label Decorations, check http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.platform.doc.user/reference/ref-cvs-decorations.htm

对于其他 CVS 标签装饰,请查看http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.platform.doc.user/reference/ref-cvs-decorations.htm

回答by Lachezar Balev

In a svnenabled project the small question mark (?) indicates that your file is not yet added to the SVN repository.

在启用svn 的项目中,小问号 (?) 表示您的文件尚未添加到 SVN 存储库中。

The small orange rectangle is an indication that your file is committed in the repository.

橙色小矩形表示您的文件已在存储库中提交。

An asterisk (*) indicates a local change.

星号 (*) 表示本地更改。

回答by Andy Thomas

With some version-control plug-ins, it means that the local file has not yet been sharedwith the version-control repository. (In my install, this includes plug-ins for CVS and git, but not Perforce.)

对于某些版本控制插件,这意味着本地文件尚未与版本控制存储库共享。(在我的安装中,这包括 CVS 和 git 的插件,但不包括 Perforce。)

You can sometimes see a list of these decorations in the plug-in's preferences under Team/X/Label Decorations, where X describes the version-control system.

您有时可以在Team/X/Label Decorations下的插件首选项中看到这些装饰的列表,其中 X 描述版本控制系统。

For example, for CVS, the list looks like this:

例如,对于 CVS,列表如下所示:

enter image description here

在此处输入图片说明

These adornments are added to the object icons provided by Eclipse. For example, here's a table of icons for the Java development environment.

这些装饰被添加到 Eclipse 提供的对象图标中。例如,这里有一个Java 开发环境的图标表

回答by Pops

It sounds like you're using Subclipse; is that correct? If so, there's a great list of decorators and their descriptions at this answerby Tim Stone.

听起来您正在使用 Subclipse;那是对的吗?如果是这样,那么在Tim Stone 的这个答案中有很多装饰者及其描述。

Here's the relevant snippet for your case:

以下是您案例的相关片段:

Unversioned File- A file not under version control. These are typically new files that you have not committed to the repository yet.
Synchronized File- A file with no local changes.

未版本化文件- 不受版本控制的文件。这些通常是您尚未提交到存储库的新文件。
同步文件- 没有本地更改的文件。

回答by CommonSenseCode

those icons are a way of Egit to show you status of the current file/folder in git. You might want to check this out:

这些图标是 Egit 的一种方式,用于显示 git 中当前文件/文件夹的状态。你可能想看看这个:

image describing Eclipse icons for Egit

描述 Egit 的 Eclipse 图标的图像

  • dirty(folder) - At least one file below the folder is dirty; that means that it has changes in the working tree that are neither in the index nor in the repository.
  • tracked- The resource is known to the Git repository. untracked - The resource is not known to the Git repository.
  • ignored- The resource is ignored by the Git team provider. Here only the preference settings under Team -> Ignored Resources and the "derived" flag are relevant. The .gitignore file is not taken into account.
  • dirty- The resource has changes in the working tree that are neither in the index nor in the repository.
  • staged- The resource has changes which are added to the index. Not that adding to the index is possible at the moment only on the commit dialog on the context menu of a resource.
  • partially-staged- The resource has changes which are added to the index and additionally changes in the working tree that are neither in the index nor in the repository.
  • added- The resource is not yet tracked by but added to the Git repository.
  • removed- The resource is staged for removal from the Git repository.
  • conflict- A merge conflict exists for the file.
  • assume-valid- The resource has the "assume unchanged" flag. This means that Git stops checking the working tree files for possible modifications, so you need to manually unset the bit to tell Git when you change the working tree file. This setting can be switched on with the menu action Team->Assume unchanged (or on the command line with git update-index--assume-unchanged).
  • (文件夹)——文件夹下至少有一个文件是脏的;这意味着它在工作树中发生了既不在索引中也不在存储库中的更改。
  • 已跟踪- Git 存储库已知资源。未跟踪 - Git 存储库不知道该资源。
  • 忽略- 资源被 Git 团队提供者忽略。这里只有 Team -> Ignored Resources 下的首选项设置和“派生”标志是相关的。不考虑 .gitignore 文件。
  • - 资源在工作树中发生了变化,既不在索引中也不在存储库中。
  • 已暂存- 资源已添加到索引中的更改。目前仅在资源上下文菜单上的提交对话框中添加到索引是不可能的。
  • 部分暂存- 资源具有添加到索引中的更改以及工作树中既不在索引中也不在存储库中的其他更改。
  • 添加- 资源尚未被 跟踪,但已添加到 Git 存储库。
  • 已删除- 资源已暂存以从 Git 存储库中删除。
  • 冲突- 文件存在合并冲突。
  • 假设有效- 资源具有“假设未更改”标志。这意味着 Git 停止检查工作树文件是否有可能的修改,因此您需要手动取消设置该位以在您更改工作树文件时通知 Git。此设置可以通过菜单操作 Team->Assume 保持不变(或在命令行上使用 git update-index--assume-unchanged 开启)。

回答by Muhammad Aamir Khan

this is because your project has been linked to a git-hub repository, and the file having question mark on it, is not been added yet. if you want to remove this sign you will have to add this file to git-hub repository.

这是因为您的项目已链接到 git-hub 存储库,并且尚未添加带有问号的文件。如果要删除此标志,则必须将此文件添加到 git-hub 存储库。