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)

          隨筆分類

          隨筆檔案

          相冊

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 辰溪县| 拉萨市| 桃园县| 句容市| 肇州县| 九龙县| 益阳市| 于田县| 开原市| 景德镇市| 定日县| 吴旗县| 温宿县| 应用必备| 禄劝| 南涧| 乌恰县| 堆龙德庆县| 汾西县| 辽宁省| 开原市| 中卫市| 民权县| 柳河县| 布尔津县| 荥阳市| 营口市| 宾阳县| 通榆县| 喜德县| 大城县| 遂宁市| 永济市| 高密市| 城固县| 柞水县| 环江| 元氏县| 界首市| 恩施市| 阳信县|