如何在Eclipse里为Navigator加Filter

在Eclipse里,navigator里有个 filter,可以选择一些过滤器,显示需要查看的文件

但是没有可以配置的选项

在网上google了一下 在这里做个记录

 

我使用的的 Eclipse Galileo (3.5.2)。

我想干的事情是增加对 .svn 和 makefile.* 的过滤

 

打开安装目录下的 plugins 文件夹,找到这个jar包:

    org.eclipse.ui.navigator.resources_3.4.1.M20090826-0800.jar

用winzip打开以后,编辑里面的两个文件

1。 plugin.properties

    增加这么几行:

    filters.svn.name=.svn resources
    filters.svn.description=Hides resources that name ".svn"
    filters.makefile.name=makefile.* resources
    filters.makefile.description=Hides resources that begin with "makefile"

    这些是后面要用的

 

2。plugin.xml

    找到 commonFilter 标签 里面有系统已经自带的几个filter,照此办理,注意使用上面定义的字符串

    我添加的内容为

      <commonFilter
            id="org.eclipse.ui.navigator.resources.filters.svn"
            name="%filters.svn.name"
            description="%filters.svn.description"
            activeByDefault="true"
            >
         <filterExpression>
             <and>
                <adapt type="org.eclipse.core.resources.IResource">
                    <test property="org.eclipse.core.resources.name" value=".svn"/>
                </adapt>               
            </and>
         </filterExpression>
      </commonFilter>
      <commonFilter
            id="org.eclipse.ui.navigator.resources.filters.makefile"
            name="%filters.makefile.name"
            description="%filters.makefile.description"
            activeByDefault="true"
            >
         <filterExpression>
             <and>
                <adapt type="org.eclipse.core.resources.IResource">
                    <test property="org.eclipse.core.resources.name" value="makefile.*"/>
                </adapt>               
            </and>
         </filterExpression>
      </commonFilter>

 

然后重启。。。。没生效。。。。再重启,还没生效。。。。再重启了以后做 “check for update” (在help菜单下) 。。。。好慢,等了一会,终止了。。。再重启,生效了!

奇怪,但是能用了。

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 14
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 14
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值