Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
603 views
in Technique[技术] by (71.8m points)

java - How do I hide .class files from the Open Resource dialog in Eclipse?

I won't want to have edit any working sets. I just want a way to, across all workspaces and projects, prevent .class files from ever showing in the Open Resource Dialog. Is there a way to do this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

One option is to filter derived resources. In the upper right corner of the 'Open Resource' dialog there is an arrow you can click to bring up a dropdown menu for filtering. Uncheck the 'Show Derived Resources' option, if it is checked.

If you still see '.class' files, they probably aren't being marked as derived. If they're by themselves in their own folder hierarchy you can fix this by right-clicking the root folder to edit folder properties, and check the 'Derived' checkbox. If they're mixed with your '.java' files...tough luck, you'll need to set the derived property on each '.class' file by hand.

As far as I can tell there's no way to mark class files as derived resources globally for the workspace, but I believe when you create a new Java project the 'bin' folder is marked as derived by default (if you use the default wizard settings)


Here are some screenshots from Eclipse Kepler. The first shows how to filter derived resources by unchecking 'Show Derived Resources' in the Open Resource dialog. The second shows how to set the 'Derived' property on a resource.

enter image description here

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...