隨筆-26  評論-111  文章-19  trackbacks-0
              Myeclipse 7 的插件安裝方式與原先的方式完全不一樣了,下面以JBossTools-2.1.2.GA插件安裝為例進(jìn)行說明。

              假設(shè)
                      Myeclipse 7的安裝路徑為:C:\Genuitec
                      JBossTools-2.1.2.GA插件的路徑為:  C:\eclipse-plugins\plugins\JBossTools-2.1.2.GA-ALL-win32

              將下面這段代碼編譯后執(zhí)行:

              
           1package test;
           2
           3import java.io.File;
           4import java.util.ArrayList;
           5import java.util.List;
           6
           7
           8/**
           9 * Descript: 
          10 *
          11 *
          12 */

          13
          14public class CreatePluginsConfig {
          15    private String path;
          16    
          17    public CreatePluginsConfig(String path){
          18        this.path=path;
          19    }

          20    
          21    public void print(){
          22        List list=getFileList(path);
          23        if(list==null){
          24            return;
          25        }

          26        
          27        int length=list.size();
          28        for(int i=0;i<length;i++){
          29            String result="";
          30            String thePath=getFormatPath(getString(list.get(i)));
          31            File file=new File(thePath);
          32            if(file.isDirectory()){
          33                String fileName=file.getName();
          34                if(fileName.indexOf("_")<0){
          35                    continue;
          36                }

          37                String[] filenames=fileName.split("_");
          38                String filename1=filenames[0];
          39                String filename2=filenames[1];
          40                result=filename1+","+filename2+",file:/"+path+"\\"+fileName+"\\,4,false";
          41                System.out.println(result);
          42            }
          else if(file.isFile()){
          43                String fileName=file.getName();
          44                if(fileName.indexOf("_")<0){
          45                    continue;
          46                }

          47                String[] filenames=fileName.split("_");
          48                String filename1=filenames[0];
          49                String filename2=filenames[1].substring(0, filenames[1].lastIndexOf("."));
          50                result=filename1+","+filename2+",file:/"+path+"\\"+fileName+",4,false";
          51                System.out.println(result);
          52            }

          53            
          54        }

          55    }

          56    
          57    public List getFileList(String path){
          58        path=getFormatPath(path);
          59        path=path+"/";
          60        File filePath=new File(path);
          61        if(!filePath.isDirectory()){
          62            return null;
          63        }

          64        String[] filelist=filePath.list();
          65        List filelistFilter=new ArrayList();
          66
          67        for(int i=0;i<filelist.length;i++){
          68            String tempfilename=getFormatPath(path+filelist[i]);
          69            filelistFilter.add(tempfilename);
          70        }

          71        return filelistFilter;
          72    }

          73    
          74    public String getString(Object object){
          75        if(object==null){
          76            return "";
          77        }

          78        return String.valueOf(object);
          79    }

          80    
          81    public String getFormatPath(String path) {
          82        path = path.replaceAll("\\\\""/");
          83        path = path.replaceAll("//""/");
          84        return path;
          85    }

          86    
          87    public static void main(String[] args){
          88        new CreatePluginsConfig("C:\\eclipse-plugins\\plugins\\JBossTools-2.1.2.GA-ALL-win32\\eclipse\\plugins").print();
          89    }

          90}
              
              執(zhí)行完之后,將控制臺中打印出的執(zhí)行結(jié)果,直接復(fù)制到下面這個(gè)文件中:

              C:\Genuitec\MyEclipse 7.0\configuration\org.eclipse.equinox.simpleconfigurator\bundles.info

              然后用 -clean 命令重新啟動(dòng)Myeclipse即了完成插件的安裝。
              
          posted on 2008-12-15 13:41 snoics 閱讀(8475) 評論(13)  編輯  收藏

          評論:
          # re: Myeclipse 7 插件安裝[未登錄] 2008-12-16 16:51 | dragon
          其他的插件怎么安裝??  回復(fù)  更多評論
            
          # re: Myeclipse 7 插件安裝 2008-12-16 17:22 | a_faint_hope
          非常感謝你的幫助.
          但程序出現(xiàn)兩個(gè)問題:
          1.C:\\eclipse-plugins\\plugins\JBossTools-2.1.2.GA-ALL-win32
          這里(\JBossTools-2.1.2.GA-ALL-win32)應(yīng)該是 \\ ;
          2.文件名有兩個(gè)下劃線時(shí),會(huì)報(bào)下標(biāo)越界問題.
          修改后的程序如下:
          import java.io.File;
          import java.util.ArrayList;
          import java.util.List;

          public class CreatePluginsConfig {
          private String path;

          public CreatePluginsConfig(String path) {
          this.path = path;
          }

          public void print() {
          List list = getFileList(path);
          if (list == null) {
          return;
          }

          int length = list.size();
          for (int i = 0; i < length; i++) {
          String result = "";
          String thePath = getFormatPath(getString(list.get(i)));
          File file = new File(thePath);
          if (file.isDirectory()) {
          String fileName = file.getName();
          if (fileName.indexOf("_") < 0) {
          continue;
          }
          String[] filenames = fileName.split("_");
          String filename1 = filenames[0];
          String filename2 = filenames[1];
          result = filename1 + "," + filename2 + ",file:/" + path + "\\"
          + fileName + "\\,4,false";
          System.out.println(result);
          } else if (file.isFile()) {
          String fileName = file.getName();
          if (fileName.indexOf("_") < 0) {
          continue;
          }
          int last = fileName.lastIndexOf("_");// 最后一個(gè)下劃線的位置
          String filename1 = fileName.substring(0, last);
          String filename2 = fileName.substring(last + 1, fileName
          .length() - 4);
          result = filename1 + "," + filename2 + ",file:/" + path + "\\"
          + fileName + ",4,false";
          System.out.println(result);
          }
          }
          }

          public List getFileList(String path) {
          path = getFormatPath(path);
          path = path + "/";
          File filePath = new File(path);
          if (!filePath.isDirectory()) {
          return null;
          }
          String[] filelist = filePath.list();
          List filelistFilter = new ArrayList();

          for (int i = 0; i < filelist.length; i++) {
          String tempfilename = getFormatPath(path + filelist[i]);
          filelistFilter.add(tempfilename);
          }
          return filelistFilter;
          }

          public String getString(Object object) {
          if (object == null) {
          return "";
          }
          return String.valueOf(object);
          }

          public String getFormatPath(String path) {
          path = path.replaceAll("\\\\", "/");
          path = path.replaceAll("//", "/");
          return path;
          }

          public static void main(String[] args) {
          new CreatePluginsConfig(
          "C:\\eclipse-plugins\\plugins\\JBossTools-2.1.2.GA-ALL-win32")
          .print();
          }
          }


            回復(fù)  更多評論
            
          # re: Myeclipse 7 插件安裝 2008-12-16 22:09 | Ivan阿文
          7.0出是出來了,只是不怎么好用。
          至少已經(jīng)發(fā)現(xiàn)幾個(gè)問題了,
          1、插件跟原地的安裝方式不一樣,好多插件目前我還不會(huì)裝,希望有高人指點(diǎn)
          2、用默認(rèn)的hibernate編輯器去編輯hibernate 綁定的那xml文件的時(shí)候,ctrl+d ctrl+alt+下這兩個(gè)(目前為止發(fā)現(xiàn)的)快捷鍵都無法使用。設(shè)置那里,設(shè)置為in dialog and window就有效果,不過回到普通代碼編輯就無效果。如果設(shè)置為editing text,效果就剛好相反,反正就沒一種設(shè)法可以兩邊都能用上這兩個(gè)快捷鍵。
          3、同樣的一段JSP普通位碼,在6.6下可以用ctrl+shift+f格式化,在7下就有問題了 - -
          給我感覺是7的html標(biāo)簽配對做得很好,有vs和netbeans等ide的風(fēng)格。后臺的設(shè)置也強(qiáng)了很多,但,以上我說的3個(gè)小問題。其實(shí)對于開發(fā)來說,很重要啦,竟然,,,,,,7在這些方面都退步了 - -  回復(fù)  更多評論
            
          # re: Myeclipse 7 插件安裝[未登錄] 2008-12-17 01:23 | kevin
          我試了一下阿,弄了半天都沒用,什么都不顯示  回復(fù)  更多評論
            
          # re: Myeclipse 7 插件安裝 2008-12-17 08:58 | a_faint_hope
          插件按樓主說的那樣做可以啊!
          我昨天都安裝了svn插件.

          路徑修改為:
          C:\\eclipse-plugins\\plugins\\JBossTools-2.1.2.GA-ALL-win32\\eclipse\\plugins
            回復(fù)  更多評論
            
          # re: Myeclipse 7 插件安裝 2008-12-17 10:33 | snoics
          ^_^ 謝謝,Bug 已修復(fù),最后一行的路徑寫錯(cuò)了,應(yīng)該是

          C:\\eclipse-plugins\\plugins\\JBossTools-2.1.2.GA-ALL-win32\\eclipse\\plugins

          已改正,其他插件的安裝也都是可以按照這種方式來處理,只要將路徑指向插件目錄即可一般都是插件包內(nèi)的 plugins 這個(gè)目錄  回復(fù)  更多評論
            
          # re: Myeclipse 7 插件安裝 2008-12-17 16:27 | Q
          我碰到這么個(gè)問題,適用check for update的執(zhí)行update的時(shí)候會(huì)自動(dòng)關(guān)閉,并且會(huì)死機(jī)  回復(fù)  更多評論
            
          # re: Myeclipse 7 插件安裝[未登錄] 2008-12-17 22:49 | kevin
          @snoics
          請問features目錄為什么不要呢?  回復(fù)  更多評論
            
          # re: Myeclipse 7 插件安裝[未登錄] 2008-12-25 21:28 | z
          我把你的代碼考下來執(zhí)行完了后生成了兩行記錄,考進(jìn)去沒法用。然后我就根據(jù)那個(gè)文檔里的東西手工寫了一個(gè)就可以了  回復(fù)  更多評論
            
          # re: Myeclipse 7 插件安裝 2009-01-02 15:09 | 小東東
          怎么用你這種方式我裝了不成功呢,
          我的插件位置在E:\java\plugin\PropEditor
          用你的這個(gè)方法改變main方法中 對應(yīng)的path為
          E:\java\plugin\PropEditor\eclipse\plugins
          能夠生成兩行代碼
          jp.gr.java,conf.ussiy.app.propedit,file:/E:\java\plugin\PropEditor\eclipse\plugins\jp.gr.java_conf.ussiy.app.propedit_4.8.2\,4,false
          viPluginPropertiesEditorVersion,0.2.11,file:/E:\java\plugin\PropEditor\eclipse\plugins\viPluginPropertiesEditorVersion_0.2.11\,4,false

          但是復(fù)制到我Myeclipse中對應(yīng)的文件中,重新啟動(dòng)卻不能看到插件。。

          請幫看一下 我控制臺打印出來的 東西有錯(cuò)嗎?

          怎么修改? 十分感謝!!!  回復(fù)  更多評論
            
          # re: Myeclipse 7 插件安裝 2009-05-19 08:35 | shyhao
          我就奇怪了 按個(gè)插件 搞這么復(fù)雜干什么




            回復(fù)  更多評論
            
          # re: Myeclipse 7 插件安裝 2009-05-19 08:38 | shyhao
          我就用以前的方式安裝,改怎么用,就怎么用  回復(fù)  更多評論
            
          # re: Myeclipse 7 插件安裝 2009-06-12 12:54 | xiaobenniao
          @shyhao
          你把你做法發(fā)上來 大家分享   回復(fù)  更多評論
            

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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 津市市| 海晏县| 尚志市| 南丰县| 周口市| 江都市| 酉阳| 兴国县| 贺州市| 三亚市| 本溪| 二连浩特市| 铜山县| 揭西县| 隆安县| 宁化县| 逊克县| 修文县| 分宜县| 天台县| 平顺县| 耒阳市| 黔东| 方正县| 南雄市| 大洼县| 遵义县| 五家渠市| 临漳县| 通化市| 黎城县| 嘉兴市| 陆河县| 渭源县| 布尔津县| 桂林市| 德格县| 涡阳县| 建瓯市| 安溪县| 巴东县|