---
title: "MyEclipse7.0~8.5 Spket插件提示ExtJs代码"
author: "youanyyou"
date: "2010-11-17T10:41:30Z"
tags: ["EXT", "Eclipse", "IDE", "JavaScript", "Myeclipse"]
categories: ["Web前端"]
slug: "myeclipse7-0-8-5-spket-extjs"
draft: false
lastmod: "2010-11-17T10:41:30Z"
id: 813639
url: "https://itlol.iteye.com/blog/813639"
---

1.配置环境:

MyEclipse 8.5 + Spket 1.6.18 + ExtJS 3.2.1。非link方式 

2.安装Spket 1.6.18

 

下载Spket, 地址:http://spket.com/download.html , 选择Spket IDE 或Plugin下载 (CSDN中有Spket 1.6.18的破解版,请自己搜索一下!)

1. 在CMD 中执行 java -jar spket-1.6.17.jar, 点"Next" ，jre支持的话双击运行。

2. 选择eclipse plugin, 点"Next"

3. 选择MyEclipse8.5的安装目录的common文件夹, 点"Next"!

4. 选择Spket 的安装目录(6.0选择MyEclipse的目录一样, 7.0以上不要和MyEclipse的目录在一起),点"Next", 然后开始安装.

5. 以上步骤4和zip文件解压出来文件的一样.如果是MyEclipse6.0,则到止步骤已经安装成功,重启MyEclipse,接着后面步骤(三)的“配置Spket”就可以。果是7.0以上的MyEclipse版本,就还需要以下步骤（5~7）的配置.

 

下面为MyEclipse7.0~8.5或更高版本的安装方法

建一个java文件取名CreatePluginsConfig.java

 

将最后那里的路径改成刚刚安装spket的路径。编译运行复制结果。

6. 把输出的东西追加到X:\\Genuitec\\MyEclipse 8.5\\configuration\\org.eclipse.equinox.simpleconfigurator\\bundles.info 后面.

 

7. 重启MyEclipse 8.5完成Spket-1.6.18的安装。在MyEclipse 8.5中的菜单Window -&gt; Preferences 中将出现 Spket项目。

 

8\. 完成Spket配置

 

Spket的配置过程与以往的Spket的配置过程类似.要注意的是,只有高于Spket-1.6.17的版本才识别配置文件。

1. 先下载ext-jsb2.zip, 解压到ExtJS 3.0的根目录, 就是和ext-all.js在同一级目录. 好像高版本Extjs开发包里面有ext.jsb2

2\. Window → Preferences → Spket → JavaScript Profiles → New.

3. 输入ExtJS, 点"OK".

4. 选择ExtJS, 点"Add Library", 在弹出窗口中选择"ExtJS".

5. 选择ExtJS, 点"Add File", 找到ext.jsb2.

6. 选择ExtJS, 点"Default".

 

 OK, Spket的安装以及Ext3.2.1的配置 都就绪了.

 

新建一个JS文件, 用Open With → Spket Javascript Editor 打开, 测试一下效果吧.

[view plain](http://blog.csdn.net/ls2188029/archive/2010/11/02/5981702.aspx)[copy to clipboard](http://blog.csdn.net/ls2188029/archive/2010/11/02/5981702.aspx)[print](http://blog.csdn.net/ls2188029/archive/2010/11/02/5981702.aspx)[?](http://blog.csdn.net/ls2188029/archive/2010/11/02/5981702.aspx)

01. import java.io.File;
02. import java.util.ArrayList;
03. import java.util.List;
04. public class CreatePluginsConfig {
05. private String path;
06. public CreatePluginsConfig(String path) {
07. this.path = path;
08. }
09. public void print() {
10. List list = getFileList(path);
11. if (list == null) {
12. return;
13. }
14. int length = list.size();
15. for (int i = 0; i &lt; length; i++) {
16. String result = "";
17. String thePath = getFormatPath(getString(list.get(i)));
18. File file = new File(thePath);
19. if (file.isDirectory()) {
20. String fileName = file.getName();
21. if (fileName.indexOf("\_") &lt; 0) {
22. continue;
23. }
24. String\[] filenames = fileName.split("\_");
25. String filename1 = filenames\[0];
26. String filename2 = filenames\[1];
27. result = filename1 + "," + filename2 + ",file:/" + path + "\\\\"
28. + fileName + "\\\\,4,false";
29. System.out.println(result);
30. } else if (file.isFile()) {
31. String fileName = file.getName();
32. if (fileName.indexOf("\_") &lt; 0) {
33. continue;
34. }
35. int last = fileName.lastIndexOf("\_");// 最后一个下划线的位置
36. String filename1 = fileName.substring(0, last);
37. String filename2 = fileName.substring(last + 1, fileName
38. .length() - 4);
39. result = filename1 + "," + filename2 + ",file:/" + path + "\\\\"
40. + fileName + ",4,false";
41. System.out.println(result);
42. }
43. }
44. }
45. public List getFileList(String path) {
46. path = getFormatPath(path);
47. path = path + "/";
48. File filePath = new File(path);
49. if (!filePath.isDirectory()) {
50. return null;
51. }
52. String\[] filelist = filePath.list();
53. List filelistFilter = new ArrayList();
54. for (int i = 0; i &lt; filelist.length; i++) {
55. String tempfilename = getFormatPath(path + filelist\[i]);
56. filelistFilter.add(tempfilename);
57. }
58. return filelistFilter;
59. }
60. public String getString(Object object) {
61. if (object == null) {
62. return "";
63. }
64. return String.valueOf(object);
65. }
66. public String getFormatPath(String path) {
67. path = path.replaceAll("\\\\\\\\", "/");
68. path = path.replaceAll("//", "/");
69. return path;
70. }
71. public static void main(String\[] args) {
72. new CreatePluginsConfig(