标签:
JSPlugin.getDefault().getPreferenceStore().setValue("js.profile", "BingoTouch");
PS:记得引入com.spket.js的包
String comSpketJs = JSPlugin.getDefault().getStateLocation().toString(); //com.spket.js目录地址 File file = new File(comSpketJs); if(!file.exists()) file.mkdir(); FileUtil.createSpketProfilesXml(comSpketJs + File.separator + "profiles.xml"); public static void createSpketProfilesXml(String path) { String jstipFolder = eclipseRootPath + "/resource/config/jstip"; File file = new File(jstipFolder); PrintWriter pw; try { pw = new PrintWriter(new FileWriter(path)); pw.write("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"); pw.print("<profiles>\n"); pw.print("<profile id=\"BingoTouch\" name=\"BingoTouch\">use namespace jQuery;\n"); File[] fs = file.listFiles(); for(File f : fs){ pw.print("include ‘" + f.getAbsolutePath().replaceAll("\\\\", "\\\\\\\\") + "‘;\n"); } pw.print("</profile>\n"); pw.print("</profiles>"); pw.close(); } catch (IOException e) { // TODO 自动生成的 catch 块 e.printStackTrace(); } }
代码还是比较简单的,看看就明白,之后第一次打开Eclipse就有:
标签:
原文地址:http://www.cnblogs.com/lovesong/p/4693423.html