stamp

          2006年與我同在

           

          nature和builder的添加

              項目nature和builder都會在.project文件中看到,如下:
          <buildSpec>
            <buildCommand>
             <name>org.eclipse.jdt.core.javabuilder</name>
             <arguments>
             </arguments>
            </buildCommand>
             <buildCommand>
             <name>org.eclipse.pde.SchemaBuilder</name>
             <arguments>
             </arguments>
            </buildCommand>
           </buildSpec>
           <natures>
            <nature>org.eclipse.pde.PluginNature</nature>
            <nature>org.eclipse.jdt.core.javanature</nature>
           </natures>
           
              builder主要在項目構建時使用,nature主要用來區分項目,項目的圖標主要由第一個natures來決定,在plugin.xml文件對org.eclipse.core.resources.natures和org.eclipse.core.resources.builders擴展點進行擴展后,可以通過如下方法將nature添加到項目中:(builder類似實現,api查看IProjectDescription)
           private static boolean addNature(IProject prj) throws Exception {
            IProjectDescription description = prj.getDescription();
            String onatures[] = description.getNatureIds();
            String[] natures = new String[onatures.length + 1];
            natures[0] = "cn.aaa.bbb.natures";  //根據plugin.xml文件配置決定
            System.arraycopy(onatures, 0, natures, 1, onatures.length);
            description.setNatureIds(natures);
            prj.setDescription(description, null);
            return true;
           }

          posted on 2005-09-06 19:48 stamp 閱讀(847) 評論(2)  編輯  收藏 所屬分類: Eclipse開發diary

          評論

          # re: nature和builder的添加 2005-09-08 17:31 augustapple

          http://www.spaces.msn.com/members/hanlu2005/  回復  更多評論   

          # 關于資料 2005-10-11 17:08 bluegrass

          我在我的論文中遇到了有關nature和builder的使用的問題,請問您這里有沒有有關Eclipse下使用Natures和Builders管理資源的資料,能否發給我,謝謝!我的信箱是dxfno1_417@hotmail.com  回復  更多評論   

          導航

          統計

          常用鏈接

          留言簿(1)

          隨筆分類

          隨筆檔案

          相冊

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 山西省| 延安市| 昭苏县| 大名县| 宁远县| 丰镇市| 奉新县| 息烽县| 聂荣县| 扎兰屯市| 安西县| 云和县| 苍梧县| 合水县| 仙居县| 汽车| 西乌| 洛南县| 翁源县| 依安县| 沁源县| 四平市| 司法| 稻城县| 咸宁市| 五峰| 利辛县| 乳源| 滕州市| 罗江县| 秀山| 汉川市| 贡觉县| 东宁县| 钟祥市| 宜君县| 武定县| 嘉黎县| 和政县| 五原县| 吉木乃县|