首先我声明,这篇文章是我在网上搜集的,然后里面有些具体的问题呢我进行了修改,所以不完全是原创的,原版的文章我也不知道在哪里,我手上的是word文档
MyEclipse 8.5 + Spket 1.6.18 + ExtJS 3.2.1。
安装Spket-1.6.18
1. 双击执行java -jar spket-1.6.18.jar, 点"Next"
2. 选择eclipse plugin, 点"Next"
3. 选择MyEclipse8.5的安装目录的common文件夹, 点"Next"!
4. 选择Spket 的安装目录(6.0选择MyEclipse的目录一样,7.0以上不要和MyEclipse的目录在一起),点"Next", 然后开始安装.
5.拷贝文件夹下面的CreatePluginsConfig.java到一个项目中, 把Java文件最后面Spket的安装路径改成自己的安装路径(代码如下)
package test;
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("_");// 最后一个下划线的位置
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){
//"d:\\Program Files\\spket\\eclipse\\plugins" 这里一定要是Spket的安装路径。
new CreatePluginsConfig("c:\\spket\\eclipse\\plugins").print();
}
}
6. 把输出的东西追加到G:\Genuitec\MyEclipse 8.5\configuration\org.eclipse.equinox.simpleconfigurator\bundles.info 后面
7. 重启MyEclipse 8.5完成Spket-1.6.18的安装。在MyEclipse 8.5中的菜单Window ->Preferences 中将出现 Spket项目。
8.在MyEclipse 8.5菜单中选择window-->Preferences-->Spket-->JavaScript Profiles
9.然后在右边选择"New...",在弹出的窗口中写EXT,选择“ok"
10.在列表中选中”EXT“,单击右边的”Add Library“按钮,在弹出的窗口中选择EXTJS,选中ExtJS单击右边的”Add File“,选择你的jsb或者jsb2文件(该文件位于你下载的ext-3.2.1文件夹里)
最后点击OK,重启MyEclipse8.5即可!!
最后我把完整的文件贴上来,需要的朋友可以去下载:点击下载本教程中所提到的工具及完整教程