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

          隨筆分類

          隨筆檔案

          相冊

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 叶城县| 买车| 宜兰县| 阜南县| 阿荣旗| 罗江县| 江源县| 临颍县| 会宁县| 家居| 华安县| 双柏县| 巴青县| 洛浦县| 宜兰县| 绥德县| 华坪县| 当阳市| 施甸县| 涡阳县| 邢台县| 盐亭县| 湖州市| 正蓝旗| 贵南县| 陇南市| 台东县| 浦县| 五大连池市| 扶绥县| 闸北区| 罗甸县| 静海县| 文成县| 岳池县| 岐山县| 宜君县| 岢岚县| 乌兰浩特市| 武义县| 苍南县|