Monday, March 12, 2012

Eclipse custom filters for CFEclipse




This might be a little out of date, but just in case...

I love the Eclipse IDE, I really do, but sometimes you just want it to do something really simple... and just can't figure out how!

This is for all of you lovely people using Mark Drew's CFEclipse.

There are some file extensions (like, for instance .project and other files) that you really do not want to see in your Navigator.
So, here's how to add custom filters for CFEclipse.


  • Go into your Eclipse installation folder and drill down into /eclipse/plugins/org.cfeclipse.cfml_<version>
  • Edit (using Notepad++ or something else that doesn't munge the text's carriage returns) and go to the set of XML lines that deal with filters. (ctrl-f and search for 'filter pattern=')
  • Copy one of the filters so you don't mess it up and change the pattern attribute to match the files you want to filter. Then, change the number at the end of the %filter.description.<number>. Just add one to the maximum number you can find in that block.
  • Save it.


Next, edit the plugin.properties file in the same folder.

  • Search for "filter.description."
  • Copy one of the lines, change the number to match the filter you added and give it an appropriate description.
  • Save it and restart Eclipse. The filter(s) should now show in the list of filters.

NB Obviously, if you ever update CFEclipse, you'll need to check that it hasn't overwritten your changes (which it probably has, but it shouldn't be too arduous to do it again!)

No comments: