问题
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.
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?
回答1:
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.
For other CVS Label Decorations, check http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.platform.doc.user/reference/ref-cvs-decorations.htm
回答2:
With some version-control plug-ins, it means that the local file has not yet been shared with the version-control repository. (In my install, this includes plug-ins for CVS and git, but not 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.
For example, for CVS, the list looks like this:
These adornments are added to the object icons provided by Eclipse. For example, here's a table of icons for the Java development environment.
回答3:
It sounds like you're using Subclipse; is that correct? If so, there's a great list of decorators and their descriptions at this answer by Tim Stone.
Here's the relevant snippet for your case:
- A file not under version control. These are typically new files that you have not committed to the repository yet.
- A file with no local changes.
回答4:
In a svn enabled project the small question mark (?) indicates that your file is not yet added to the SVN repository.
The small orange rectangle is an indication that your file is committed in the repository.
An asterisk (*) indicates a local change.
回答5:
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:
- 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).
回答6:
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.
来源:https://stackoverflow.com/questions/4307086/why-does-eclipse-java-package-explorer-show-question-mark-on-some-classes