Eclipse Open Resource Dialog

In Eclipse, everything is a plugin, including the IDE itself. So, if there's something which bothers you, all you need to do is replace the plugin with something which works in a way more consistent with your personal preferences, or if the plugin is open source, tweak the existing plugin to suit your needs.

In my case, what bothered me was this: I don't have any reason to look at .svn-base files or .class files, so I'd prefer they not show up. Playing with working sets doesn't solve the problem, because (as far as I know) there's no way to exclude .svn folders from the working set without adding all the files individually. I tried to add extension points, but I could never get the filters to show up. So, all other options exhausted, I went looking for a way to modify the source code.

In order to modify the "Open Resource" dialog, I needed to find the FilteredResourceSelectionDialog class found in the org.eclipse.ui.dialogs package in the org.eclipse.ui.ide Java archive. A bandwidth-intensive way to get the source code for that one source file was to download Eclipse Classic, and find it in the src.zip found under org.eclipse.ui.ide in the org.eclipse.platform.source folder.

I then overrode the matches method in FilteredResourceSelectionDialog.ResourceFilter to exclude all file names ending in .svn-base and .class, created a quick build file to include all the Eclipse plugins jars in my classpath, compiled, copied the resulting class files into the appropriate Java archive, and got this: a clean view showing only the files I might want to open.

Blogs
This is very nice Minhchau. I always wanted to get rid of these *.svn-base files.

Can you upload this modified class to somewhere?
Now updated with document library link!
Hey Minhchau, this is very cool.. Can you fix the permissions on the link so that we can dl it? I'd like to use this as well but get a permission error when trying to dl it. Thanks.

PS: If I were you, I'd submit this as a BUG/IMPROVEMENT to the Eclipse team. And also suggest that they implement filters in the prefs for that UI component.
File permissions should be fixed.
Minhchau, this is very nice. I've started to use Eclipse recently, and ran into the same issue. I started searching on this issue and to my surprise, the guy working next to me posted a solution months ago. Go figure.

Can you submit this to Eclipse so they can make it a setting? Good stuff.