myeclipse装svn插件不显示

无法显示时建议按如下步骤安装:
1.下载svn插件:直接下载
2.选择一个空闲磁盘创建插件放应文件,我的是D:\ProgramData\MyEclipse\svn;
3.从svn插件中解压出features与 plugins文件夹,复制到D:\ProgramData\MyEclipse\svn里面,其它的*.xml文件和其他文件不要。 
4.写如下代码,找到Myeclipse的安装目录,在安装目录下的configuration\org.eclipse.equinox.simpleconfigurator这个目录中有个
bundles.info文件,需要在这个文件中增加插件的相关信息(下方代码输出的结果)Myeclipse才会去加载。
 

import java.io.File;
import java.util.*;
public class PluginConfigCreato {
 public PluginConfigCreato(){
  
 }
 public void print(String path){
 List<String> 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){
      print(thePath);
      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("_");
     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<String> getFileList(String path){
  path = getFormatPath(path);
  path = path+"/";
  File filePath = new File(path);
  if(!filePath.isDirectory()){
   return null;
  }
  String[] fileList = filePath.list();
  List<String> filelistFilter =  new ArrayList<String>();
  for (int i = 0; i < fileList.length; i++) {
   String tempFilename = getFormatPath(path+fileList[i]);
   filelistFilter.add(tempFilename);
  }
  return filelistFilter;
  
 }
 
 public String getFormatPath(String path){
  path = path.replaceAll("\\\\", "/");
  path = path.replaceAll("//", "/");
  return path;
 }
 
 public String getString(Object object){
  if(object ==null){
   return "";
  }
  return String.valueOf(object);
 }
 
 public static void main(String[] args){
  String path ="D:\\ProgramData\\MyEclipse\\svn";
  new PluginConfigCreato().print(path);
 }

}

猜你喜欢

转载自blog.csdn.net/Entermomem/article/details/85096369
今日推荐