MyEclipse 9本地安装插件(MyEclipse 9 M1)

来源:互联网 发布:软件测试数据库学什么 编辑:程序博客网 时间:2024/05/21 21:45
安装方法如下: 
1.首先下载SVN包:site -1.6.17 
2.解压SVN包,然后找到其中的两个文件夹:features 和 plugins 
3.随意建一个文件夹(位置和名称自己定就好了,我的是E:\myEclipsePlugin\svn),然后把第二步的解压好的features 和 plugins放到这个文件夹下 
4.找到myeclipse的安装目录,下面有一个configuration\org.eclipse.equinox.simpleconfigurator\bundles.info 文件。现在需要做的就是在该文件内添加的东西 
5.添加的内容用下面的类生成: 
Java代码  收藏代码
  1. package net.androidla.test;  
  2.   
  3. import java.io.File;     
  4. import java.util.ArrayList;     
  5. import java.util.List;     
  6. /**   
  7.  * MyEclipse9 插件配置代码生成器   
  8.  *   
  9.  *   
  10.  */    
  11. public class PluginsInstall     
  12. {     
  13.     public PluginsInstall()     
  14.     {     
  15.     }     
  16.     public void print(String path)     
  17.     {     
  18.         List<String> list = getFileList(path);     
  19.         if (list == null)     
  20.         {     
  21.             return;     
  22.         }     
  23.         int length = list.size();     
  24.         for (int i = 0; i < length; i++)     
  25.         {     
  26.             String result = "";     
  27.             String thePath = getFormatPath(getString(list.get(i)));     
  28.             File file = new File(thePath);     
  29.             if (file.isDirectory())     
  30.             {     
  31.                 String fileName = file.getName();     
  32.                 if (fileName.indexOf("_") < 0)     
  33.                 {     
  34.                     print(thePath);     
  35.                     continue;     
  36.                 }     
  37.                 String[] filenames = fileName.split("_");     
  38.                 String filename1 = filenames[0];     
  39.                 String filename2 = filenames[1];     
  40.                 result = filename1 + "," + filename2 + ",file:/" + path + "/"    
  41.                         + fileName + "\\,4,false";     
  42.                 System.out.println(result);     
  43.             } else if (file.isFile())     
  44.             {     
  45.                 String fileName = file.getName();     
  46.                 if (fileName.indexOf("_") < 0)     
  47.                 {     
  48.                     continue;     
  49.                 }     
  50.                 int last = fileName.lastIndexOf("_");// 最后一个下划线的位置     
  51.                 String filename1 = fileName.substring(0, last);     
  52.                 String filename2 = fileName.substring(last + 1, fileName     
  53.                         .length() - 4);     
  54.                 result = filename1 + "," + filename2 + ",file:/" + path + "/"    
  55.                         + fileName + ",4,false";     
  56.                 System.out.println(result);     
  57.             }     
  58.         }     
  59.     }     
  60.     public List<String> getFileList(String path)     
  61.     {     
  62.         path = getFormatPath(path);     
  63.         path = path + "/";     
  64.         File filePath = new File(path);     
  65.         if (!filePath.isDirectory())     
  66.         {     
  67.             return null;     
  68.         }     
  69.         String[] filelist = filePath.list();     
  70.         List<String> filelistFilter = new ArrayList<String>();     
  71.         for (int i = 0; i < filelist.length; i++)     
  72.         {     
  73.             String tempfilename = getFormatPath(path + filelist[i]);     
  74.             filelistFilter.add(tempfilename);     
  75.         }     
  76.         return filelistFilter;     
  77.     }     
  78.     public String getString(Object object)     
  79.     {     
  80.         if (object == null)     
  81.         {     
  82.             return "";     
  83.         }     
  84.         return String.valueOf(object);     
  85.     }     
  86.     public String getFormatPath(String path)     
  87.     {     
  88.         path = path.replaceAll("\\\\", "/");     
  89.         path = path.replaceAll("//""/");     
  90.         return path;     
  91.     }     
  92.     public static void main(String[] args)     
  93.     {     
  94.         /*你的SVN的features 和 plugins复制后放的目录*/    
  95.         String plugin = "C:\\Program Files\\Genuitec\\plugins\\jdeclipse_update_site";     
  96.         new PluginsInstall().print(plugin);     
  97.     }     
  98. }    

6.把以上生成的字符串(一大堆)添加到第四步bundles.info文件的后面,然后重启myeclipse即可。(估计其他插件的安装方法雷同吧)
原创粉丝点击