Eclipse: how to hide custom files in Project Explorer

后端 未结 4 1465
感动是毒
感动是毒 2020-12-08 03:45

I have a custom builder in CDT, which adds alot of files into project directory. I want those files to be filtered out from Project Explorer, but cannot figure out how (the

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-08 04:21

    How to add global user defined resource filters to the Eclipse Project Explorer view:

    Modifying and switching filters on a project level needs a lot of clicks and can be tedious if you have many projects in your workspace. If you need to apply or switch the same filter settings on all projects again and again you might prefer a quicker and global solution for all projects and all workspaces.

    • Modify the files plugin.xml and plugin.properties in plugins/org.eclipse.ui.navigator.resources_{version}.jar (extract, modify and re-add the modified files).

    • For example, add a file only filter in plugin.xml to the element /plugin/extension @point="org.eclipse.ui.navigator.navigatorContent":

      
         
            
               
               
            
         
      
      
    • As another example, add a file and directory filter in plugin.xml to the same element:

      
         
            
               
                  
               
            
         
      
      
    • Provide filter names and descriptions for all added filters in plugin.properties. Filter display order in Project Explorer view is by this filter name regardless of filter type:

      filters.{unique-id-a}.name={file-wildcard-pattern-a} files
      filters.{unique-id-a}.description=Hides files that match "{file-wildcard-pattern-a}"
      
      filters.{unique-id-b}.name={file-wildcard-pattern-b} files and folders
      filters.{unique-id-b}.description=Hides files and folders that match "{file-wildcard-pattern-b}"
      
    • Restart Eclipse and reset its caches: eclipse.exe -clean

提交回复
热议问题