myeclipse集成SVN插件

来源:互联网 发布:万维网域名注册查询 编辑:程序博客网 时间:2024/05/16 14:40
svn的插件版本site-1.0.6.zip
(2)下载网址是:subclipse.tigris.org
(3)从中解压出features与plugins文件夹,复制到E:\MyEclipse\myPlugin\svn里面,其它的*.xml文件不要
(4)复制下列java代码,修改路径并执行。这段代码来自网上的一篇文章
[java] view plaincopy
  1. import java.io.File;  
  2. import java.util.ArrayList;  
  3. import java.util.List;  
  4. /** 
  5.  * MyEclipse9 插件配置代码生成器 
  6.  * 
  7.  * 
  8.  */  
  9. public class PluginConfigCreator  
  10. {  
  11.     public PluginConfigCreator()  
  12.     {  
  13.     }  
  14.     public void print(String path)  
  15.     {  
  16.         List<String> list = getFileList(path);  
  17.         if (list == null)  
  18.         {  
  19.             return;  
  20.         }  
  21.         int length = list.size();  
  22.         for (int i = 0; i < length; i++)  
  23.         {  
  24.             String result = "";  
  25.             String thePath = getFormatPath(getString(list.get(i)));  
  26.             File file = new File(thePath);  
  27.             if (file.isDirectory())  
  28.             {  
  29.                 String fileName = file.getName();  
  30.                 if (fileName.indexOf("_") < 0)  
  31.                 {  
  32.                     print(thePath);  
  33.                     continue;  
  34.                 }  
  35.                 String[] filenames = fileName.split("_");  
  36.                 String filename1 = filenames[0];  
  37.                 String filename2 = filenames[1];  
  38.                 result = filename1 + "," + filename2 + ",file:/" + path + "/"  
  39.                         + fileName + "//,4,false";  
  40.                 System.out.println(result);  
  41.             } else if (file.isFile())  
  42.             {  
  43.                 String fileName = file.getName();  
  44.                 if (fileName.indexOf("_") < 0)  
  45.                 {  
  46.                     continue;  
  47.                 }  
  48.                 int last = fileName.lastIndexOf("_");// 最后一个下划线的位置  
  49.                 String filename1 = fileName.substring(0, last);  
  50.                 String filename2 = fileName.substring(last + 1, fileName  
  51.                         .length() - 4);  
  52.                 result = filename1 + "," + filename2 + ",file:/" + path + "/"  
  53.                         + fileName + ",4,false";  
  54.                 System.out.println(result);  
  55.             }  
  56.         }  
  57.     }  
  58.     public List<String> getFileList(String path)  
  59.     {  
  60.         path = getFormatPath(path);  
  61.         path = path + "/";  
  62.         File filePath = new File(path);  
  63.         if (!filePath.isDirectory())  
  64.         {  
  65.             return null;  
  66.         }  
  67.         String[] filelist = filePath.list();  
  68.         List<String> filelistFilter = new ArrayList<String>();  
  69.         for (int i = 0; i < filelist.length; i++)  
  70.         {  
  71.             String tempfilename = getFormatPath(path + filelist[i]);  
  72.             filelistFilter.add(tempfilename);  
  73.         }  
  74.         return filelistFilter;  
  75.     }  
  76.     public String getString(Object object)  
  77.     {  
  78.         if (object == null)  
  79.         {  
  80.             return "";  
  81.         }  
  82.         return String.valueOf(object);  
  83.     }  
  84.     public String getFormatPath(String path)  
  85.     {  
  86.         path = path.replaceAll("////""/");  
  87.         path = path.replaceAll("//""/");  
  88.         return path;  
  89.     }  
  90.     public static void main(String[] args)  
  91.     {  
  92.         /*你的插件的安装目录*/  
  93.             String plugin = "改成安装目录//Genuitec//svn";  
  94.         new PluginConfigCreator().print(plugin);  
  95.     }  
  96. }  


 

用windows的朋友只需要设置你们的绝对路径就可以了,比如d:/myeclipse/myplugin/svn/,用此路径代替”改成安装目录//Genuitec//svn”;

(5)找到“myeclipse_home/configuration/org.eclipse.equinox.simpleconfigurator/”,打开其中的“bundles.inf”文件,将上面程序运行的代码添加到bundles.inf文件中。

后的代码,保存
(6)重启MyEclipse

0 0
原创粉丝点击