日期:2014-05-16  浏览次数:20408 次

extjs跟myeclipse10整合
         Myeclipse8.6+spket1.6.18+extjs4.0的安装方法

一. 配置环境:
MyEclipse 8.6 + Spket 1.6.18 + ExtJS 4.0。
二. 安装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.18.jar, 点"Next"
2. 选择eclipse plugin, 点"Next"
3. 选择MyEclipse8.5的安装目录的common文件夹, 点"Next"!
4. 选择Spket 的安装目录(6.0选择MyEclipse的目录一样, 7.0以上不要和MyEclipse的目录在一起),点"Next", 然后开始安装.
以上步骤4和zip文件解压出来文件的一样.如果是MyEclipse6.0,则到止步骤已经安装成功,重启MyEclipse,接着后面步骤(三)的“配置Spket”就可以。果是7.0以上的MyEclipse版本,就还需要以下步骤(5~7)的配置.

5. 执行如下代码

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) {

		new CreatePluginsConfig(

		"E:\\spket\\eclipse\\plugins")

		.print();

	}

}




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

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


8、配置Spket:
1. 将ext.jsb2文件复制到extjs4.0的src目录下(网上很多复制到和ext-all.js同级目录下,在本环境下我试过是不行的)
2. Window → Preferences → Spket → JavaScript Profiles → New.
3. 输入ExtJS(自定义的), 点"OK".
4. 选择ExtJS, 点"Add Library", 在弹出窗口中选择"ExtJS".
5. 选择ExtJS, 点"Add File", 找到src下面的ext.jsb2.
(重复5步骤:依次添加ext-all.js和ext-all-debug.js)
6. 选择ExtJS, 点"Default".(必须要有啊。)

7.安装配置完毕,新建一个JS文件, 用Open With → Spket Javascript Editor 打开,开始你的extjs之旅吧