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 閱讀(844) 評論(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)

          隨筆分類

          隨筆檔案

          相冊

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 阳江市| 芦溪县| 连南| 成武县| 朝阳市| 深泽县| 封丘县| 乌拉特后旗| 亳州市| 伊吾县| 黔东| 诏安县| 临沭县| 丰都县| 河曲县| 葫芦岛市| 通山县| 东方市| 巴楚县| 平凉市| 遵义县| 东港市| 都安| 嵩明县| 桓台县| 定襄县| 贡嘎县| 鄢陵县| 法库县| 岑溪市| 望江县| 治多县| 商水县| 康平县| 永城市| 泾川县| 临城县| 铜山县| 上栗县| 双桥区| 曲靖市|