stamp

          2006年與我同在

           

          nature和builder的添加

              項(xiàng)目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主要在項(xiàng)目構(gòu)建時使用,nature主要用來區(qū)分項(xiàng)目,項(xiàng)目的圖標(biāo)主要由第一個natures來決定,在plugin.xml文件對org.eclipse.core.resources.natures和org.eclipse.core.resources.builders擴(kuò)展點(diǎn)進(jìn)行擴(kuò)展后,可以通過如下方法將nature添加到項(xiàng)目中:(builder類似實(shí)現(xiàn),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";  //根據(jù)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 閱讀(845) 評論(2)  編輯  收藏 所屬分類: Eclipse開發(fā)diary

          評論

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

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

          # 關(guān)于資料 2005-10-11 17:08 bluegrass

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


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           

          導(dǎo)航

          統(tǒng)計(jì)

          常用鏈接

          留言簿(1)

          隨筆分類

          隨筆檔案

          相冊

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 郑州市| 高淳县| 广州市| 中宁县| 惠水县| 石城县| 宁南县| 抚宁县| 鄂州市| 屯门区| 额济纳旗| 博白县| 溧阳市| 横峰县| 崇信县| 宁强县| 福贡县| 化州市| 平山县| 安顺市| 九江县| 故城县| 宁河县| 普宁市| 嵊泗县| 车险| 怀化市| 桐乡市| 甘谷县| 庆元县| 青海省| 南岸区| 河间市| 江永县| 财经| 九台市| 新宁县| 久治县| 体育| 广宗县| 乐亭县|