gwt-ext 프로젝트 돌입!!!
항상 보면서 부러워만 했던 ext-js가 gwt로 라이브러리화 되어 나왔습니다.
이제 슬슬 만지작 만지작 해봐야 할 것 같네요 캬캭~
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
항상 보면서 부러워만 했던 ext-js가 gwt로 라이브러리화 되어 나왔습니다.
이제 슬슬 만지작 만지작 해봐야 할 것 같네요 캬캭~
private String realizePermutation(TreeLogger logger, Property[] currentProps, String[] currentValues, int permNumber) throws UnableToCompleteException { String msg = "Analyzing permutation #" + permNumber; logger = logger.branch(TreeLogger.TRACE, msg, null); logProperties(logger, currentProps, currentValues); // Create a rebind oracle that will record decisions so that we can // cache // them and avoid future computations. // CompilationRebindOracle rebindOracle = new CompilationRebindOracle(); // Tell the property provider above about the current property values. // Note that the rebindOracle is actually sensitive to these values // because // in its ctor is uses propOracle as its property oracle. // propOracle.setPropertyValues(currentProps, currentValues); // Check to see if we already have this compilation. // This will have the effect of filling the rebind oracle's cache. // String[] entryPts = module.getEntryPointTypeNames(); Compilation cached = compilations.find(logger, rebindOracle, entryPts); if (cached != null) { msg = "Matches existing compilation " + cached.getStrongName(); logger.log(TreeLogger.TRACE, msg, null); return cached.getStrongName(); } // Now attach a compilation into which we can record the particular // inputs // and outputs used by this compile process. // Compilation compilation = new Compilation(); rebindOracle.recordInto(compilation); // Create JavaScript. // String js = jjs.compile(logger, rebindOracle); // Create a wrapper and an unambiguous name for the file. // String strongName = writeHtmlAndJsWithStrongName(logger, js); // Write out a cache control file that correlates to this script. // compilation.setStrongName(strongName); writeCacheFile(logger, compilation); // Add this compilation to the list of known compilations. // compilations.add(compilation); return compilation.getStrongName(); }
private String realizePermutation(TreeLogger logger, Property[] currentProps, String[] currentValues, int permNumber) throws UnableToCompleteException { String msg = "Analyzing permutation #" + permNumber; logger = logger.branch(TreeLogger.TRACE, msg, null); logProperties(logger, currentProps, currentValues); // Create a rebind oracle that will record decisions so that we can // cache // them and avoid future computations. // CompilationRebindOracle rebindOracle = new CompilationRebindOracle(); // Tell the property provider above about the current property values. // Note that the rebindOracle is actually sensitive to these values // because // in its ctor is uses propOracle as its property oracle. // propOracle.setPropertyValues(currentProps, currentValues); // Check to see if we already have this compilation. // This will have the effect of filling the rebind oracle's cache. // String[] entryPts = module.getEntryPointTypeNames(); Compilation cached = compilations.find(logger, rebindOracle, entryPts); if (cached != null) { msg = "Matches existing compilation " + cached.getStrongName(); logger.log(TreeLogger.TRACE, msg, null); return cached.getStrongName(); } // Now attach a compilation into which we can record the particular // inputs // and outputs used by this compile process. // Compilation compilation = new Compilation(); rebindOracle.recordInto(compilation); // Create JavaScript. // String js = jjs.compile(logger, rebindOracle); String entryPointName = entryPts[0].substring(entryPts[0] .lastIndexOf(".") + 1); String name = entryPointName + "_" + currentValues[2] + "_" + currentValues[3]; String strongName = writeHtmlAndJsWithStrongName(logger, js, name); compilation.setStrongName(strongName); writeCacheFile(logger, compilation); // Add this compilation to the list of known compilations. // compilations.add(compilation); return compilation.getStrongName(); } private String writeHtmlAndJsWithStrongName(TreeLogger logger, String js, String strongName) throws UnableToCompleteException { try { byte[] scriptBytes = js.getBytes("UTF-8"); { byte[] prefix = getHtmlPrefix().getBytes("UTF-8"); byte[] suffix = getHtmlSuffix().getBytes("UTF-8"); File outFile = new File(outDir, strongName + ".cache.html"); Util.writeBytesToFile(logger, outFile, new byte[][] { prefix, scriptBytes, suffix }); String msg = "Compilation written to " + outFile.getAbsolutePath(); logger.log(TreeLogger.TRACE, msg, null); } { byte[] prefix = getJsPrefix().getBytes("UTF-8"); byte[] suffix = getJsSuffix().getBytes("UTF-8"); File outFile = new File(outDir, strongName + ".cache.js"); Util.writeBytesToFile(logger, outFile, new byte[][] { prefix, scriptBytes, suffix }); String msg = "Compilation written to " + outFile.getAbsolutePath(); logger.log(TreeLogger.TRACE, msg, null); } return strongName; } catch (UnsupportedEncodingException e) { logger.log(TreeLogger.ERROR, "Unable to encode compiled script as UTF-8", e); throw new UnableToCompleteException(); } }