如何在Eclipse裡為Navigator加Filter

來源:互聯網
上載者:User

在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菜單下) 。。。。好慢,等了一會,終止了。。。再重啟,生效了!

奇怪,但是能用了。

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.