史上最强在Myeclipse上安装插件的方法(以 aptana为例)
2012-07-20 22:20
465 查看
1、解压aptana插件,将features和plugins放置到D:\Program Files\myeclipse10\MyEclipse 10\myPlugin\aptana_update_024747
2、在myeclipse中编辑一下代码,并运行main方法,//注意路径对应插件路径
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class PluginConfigCreator
{
public PluginConfigCreator()
{
}
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 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)
{
/*你的SVN的features 和 plugins复制后放的目录*/
String plugin = "D:/Program Files/myeclipse10/MyEclipse 10/myPlugin/aptana_update_024747//注意路径对应插件路径
new PluginConfigCreator().print(plugin);
}
}
3、将执行后的代码放置到
D:\Program Files\myeclipse10\MyEclipse 10\configuration\org.eclipse.equinox.simpleconfigurator的bundles.info文件中
4、重新启动myeclipse
2、在myeclipse中编辑一下代码,并运行main方法,//注意路径对应插件路径
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class PluginConfigCreator
{
public PluginConfigCreator()
{
}
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 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)
{
/*你的SVN的features 和 plugins复制后放的目录*/
String plugin = "D:/Program Files/myeclipse10/MyEclipse 10/myPlugin/aptana_update_024747//注意路径对应插件路径
new PluginConfigCreator().print(plugin);
}
}
3、将执行后的代码放置到
D:\Program Files\myeclipse10\MyEclipse 10\configuration\org.eclipse.equinox.simpleconfigurator的bundles.info文件中
4、重新启动myeclipse
相关文章推荐
- MyEclipse8.6 安装 svn aptana 等插件方法
- 在myEclipse安装Aptana,Aptana插件版Zip包下载方法
- Myeclipse用link安装方法安装svn插件
- MyEclipse6.5安装SVN插件的三种方法
- MyEclipse安装插件的三种方法和使用心得
- MyEclipse10.6 安装SVN插件方法及插件下载地址
- MyEclipse10 安装SVN插件及SVN插件在MyEclipse10下使用方法
- myeclipse或者eclipse下安装插件方法
- myeclipse8.5 安装插件方法
- 艰辛的aptana插件安装之路(续)--成功解决myeclipse不能启动和报java.lang.NullPointerException的问题
- Myeclipse添加mybatis generator插件的手动安装插件的方法
- 解决安装Aptana插件后启动MyEclipse6.5后报错java.lang.NullPointerException的问题
- Myeclipse 安装activiti 插件失败的解决方法
- eclipse的myeclipse插件下载安装方法
- MyEclipse6.5安装SVN插件的三种方法z
- MyEclipse 8.5 开发环境配置,汉化,Aptana2.0插件,SVN 插件,Flex Builder 3/4 插件安装
- MyEclipse安装aptana插件的问题
- MyEclipse或Eclipse安装aptana插件
- MyEclipse6.5安装SVN插件的三种方法
- Myeclipse 安装Aptana插件