[gwt-contrib] [google-web-toolkit] r10038 committed - Some Java AST cleanups....
Revision: 10038 Author: sco...@google.com Date: Wed Apr 20 08:47:17 2011 Log: Some Java AST cleanups. http://gwt-code-reviews.appspot.com/1422805/ Review by: jbrosenb...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=10038 Modified: /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/HasType.java /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JAbsentArrayDimension.java /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JNameOf.java /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JNewArray.java /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JNonNullType.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/CloneExpressionVisitor.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/EnumOrdinalizer.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ImplementClassLiteralsAsFields.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ReplaceRebinds.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/TypeRemapper.java === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/HasType.java Thu Apr 5 13:07:16 2007 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/HasType.java Wed Apr 20 08:47:17 2011 @@ -19,5 +19,8 @@ * Interface implemented by Java entities that have a type associated with them. */ public interface HasType { + /** + * Returns the type of this expression. + */ JType getType(); } === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JAbsentArrayDimension.java Tue Apr 19 10:10:18 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JAbsentArrayDimension.java Wed Apr 20 08:47:17 2011 @@ -26,10 +26,7 @@ public static final JExpression INSTANCE = new JAbsentArrayDimension(SourceOrigin.UNKNOWN); - /** - * These are only supposed to be constructed by JProgram. - */ - JAbsentArrayDimension(SourceInfo sourceInfo) { + private JAbsentArrayDimension(SourceInfo sourceInfo) { super(sourceInfo); } === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JNameOf.java Fri Apr 2 14:35:01 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JNameOf.java Wed Apr 20 08:47:17 2011 @@ -23,12 +23,13 @@ public class JNameOf extends JExpression { private final HasName node; - private final JNonNullType stringType; - - public JNameOf(SourceInfo info, JNonNullType stringType, HasName node) { + private final JClassType stringType; + + public JNameOf(SourceInfo info, JClassType stringType, HasName node) { super(info); this.node = node; this.stringType = stringType; +assert stringType.getName().equals(java.lang.String); } public HasName getNode() { @@ -36,7 +37,7 @@ } public JNonNullType getType() { -return stringType; +return stringType.getNonNull(); } @Override === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JNewArray.java Tue Apr 19 10:10:18 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JNewArray.java Wed Apr 20 08:47:17 2011 @@ -44,14 +44,14 @@ classLiterals.add(classLit); cur = ((JArrayType) cur).getElementType(); } -return new JNewArray(info, arrayType.getNonNull(), dims, null, classLiterals); +return new JNewArray(info, arrayType, dims, null, classLiterals); } public static JNewArray createInitializers(SourceInfo info, JArrayType arrayType, ListJExpression initializers) { ListJClassLiteral classLiterals = new ArrayListJClassLiteral(); classLiterals.add(new JClassLiteral(info.makeChild(), arrayType)); -return new JNewArray(info, arrayType.getNonNull(), null, initializers, classLiterals); +return new JNewArray(info, arrayType, null, initializers, classLiterals); } public final ListJExpression dims; @@ -63,12 +63,12 @@ */ private final ListJClassLiteral classLiterals; - private JNonNullType type; - - public JNewArray(SourceInfo info, JNonNullType type, ListJExpression dims, + private JArrayType type; + + public JNewArray(SourceInfo info, JArrayType type, ListJExpression dims, ListJExpression initializers, ListJClassLiteral classLits) { super(info); -setType(type); +this.type = type; this.dims = dims; this.initializers = initializers; this.classLiterals = classLits; @@ -97,7 +97,7 @@ } public JNonNullType getType() { -return type; +return type.getNonNull(); } @Override @@ -120,8 +120,7 @@ return false; } - public void setType(JNonNullType type) { -assert type.getUnderlyingType() instanceof JArrayType; + public void setType(JArrayType type) { this.type = type; } === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JNonNullType.java Sat Jan 22 17:19:44 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JNonNullType.java Wed Apr 20 08:47:17 2011 @@ -52,6 +52,11 @@ public boolean
[gwt-contrib] [google-web-toolkit] r10039 committed - Implement EntryMethodHolder.init in source....
Revision: 10039 Author: gwt.mirror...@gmail.com Date: Wed Apr 20 11:54:19 2011 Log: Implement EntryMethodHolder.init in source. Stub out EntryMethodHolder.init() so we can use the existing empty method instead of having to create it from whole cloth. http://gwt-code-reviews.appspot.com/1421803/ http://code.google.com/p/google-web-toolkit/source/detail?r=10039 Modified: /trunk/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java /trunk/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/EntryMethodHolder.java === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java Tue Apr 19 10:10:18 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java Wed Apr 20 11:54:19 2011 @@ -872,7 +872,7 @@ return dependencyRecorder; } - private static JMethodCall createReboundModuleLoad(TreeLogger logger, + private static JMethodCall createReboundModuleLoad(TreeLogger logger, SourceInfo info, JDeclaredType reboundEntryType, String originalMainClassName, JDeclaredType enclosingType) throws UnableToCompleteException { if (!(reboundEntryType instanceof JClassType)) { @@ -902,10 +902,9 @@ throw new UnableToCompleteException(); } -SourceInfo sourceInfo = entryClass.getSourceInfo(); JExpression qualifier = null; if (!entryMethod.isStatic()) { - qualifier = JGwtCreate.createInstantiationExpression(sourceInfo, entryClass, enclosingType); + qualifier = JGwtCreate.createInstantiationExpression(info, entryClass, enclosingType); if (qualifier == null) { logger.log(TreeLogger.ERROR, @@ -915,21 +914,17 @@ throw new UnableToCompleteException(); } } -return new JMethodCall(sourceInfo, qualifier, entryMethod); +return new JMethodCall(info, qualifier, entryMethod); } private static void findEntryPoints(TreeLogger logger, RebindPermutationOracle rpo, String[] mainClassNames, JProgram program) throws UnableToCompleteException { Event findEntryPointsEvent = SpeedTracerLogger.start(CompilerEventType.FIND_ENTRY_POINTS); -SourceInfo sourceInfo = program.createSourceInfoSynthetic(JavaToJavaScriptCompiler.class); -JMethod bootStrapMethod = -program.createMethod(sourceInfo, init, program.getIndexedType(EntryMethodHolder), -program.getTypeVoid(), false, true, true, false, false); -bootStrapMethod.freezeParamTypes(); -bootStrapMethod.setSynthetic(); +JMethod bootStrapMethod = program.getIndexedMethod(EntryMethodHolder.init); JMethodBody body = (JMethodBody) bootStrapMethod.getBody(); JBlock block = body.getBlock(); +SourceInfo info = block.getSourceInfo().makeChild(); // Also remember $entry, which we'll handle specially in GenerateJsAst JMethod registerEntry = program.getIndexedMethod(Impl.registerEntry); @@ -947,7 +942,7 @@ JMethod mainMethod = findMainMethod(mainType); if (mainMethod != null mainMethod.isStatic()) { -JMethodCall onModuleLoadCall = new JMethodCall(null, null, mainMethod); +JMethodCall onModuleLoadCall = new JMethodCall(info, null, mainMethod); block.addStmt(onModuleLoadCall.makeStatement()); continue; } @@ -965,7 +960,7 @@ } JMethodCall onModuleLoadCall = -createReboundModuleLoad(logger, resultType, mainClassName, bootStrapMethod +createReboundModuleLoad(logger, info, resultType, mainClassName, bootStrapMethod .getEnclosingType()); resultTypes.add((JClassType) resultType); entryCalls.add(onModuleLoadCall); @@ -974,7 +969,7 @@ block.addStmt(entryCalls.get(0).makeStatement()); } else { JReboundEntryPoint reboundEntryPoint = -new JReboundEntryPoint(mainType.getSourceInfo(), mainType, resultTypes, entryCalls); +new JReboundEntryPoint(info, mainType, resultTypes, entryCalls); block.addStmt(reboundEntryPoint); } } === --- /trunk/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/EntryMethodHolder.java Fri Oct 10 08:56:20 2008 +++ /trunk/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/EntryMethodHolder.java Wed Apr 20 11:54:19 2011 @@ -19,5 +19,7 @@ * This class holds the boot strap entry method that the compiler generates. */ public class EntryMethodHolder { - -} + public static final void init() { +// Filled in by the compiler to call entry methods. + } +} -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10040 committed - Adding missing xalan and cup jars
Revision: 10040 Author: gwt.mirror...@gmail.com Date: Wed Apr 20 12:14:49 2011 Log: Adding missing xalan and cup jars http://code.google.com/p/google-web-toolkit/source/detail?r=10040 Added: /tools/lib/cup /tools/lib/cup/java-cup-11a-src.jar /tools/lib/cup/java-cup-11a.jar /tools/lib/xalan/xalan-2.7.1-nocup.jar === --- /dev/null +++ /tools/lib/cup/java-cup-11a-src.jar Wed Apr 20 12:14:49 2011 Binary file, no diff available. === --- /dev/null +++ /tools/lib/cup/java-cup-11a.jar Wed Apr 20 12:14:49 2011 Binary file, no diff available. === --- /dev/null +++ /tools/lib/xalan/xalan-2.7.1-nocup.jar Wed Apr 20 12:14:49 2011 File is too large to display a diff. -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Comment on RequestFactoryMovingParts in google-web-toolkit
Comment by rj...@google.com: From flow: Entities with updated properties are enqueued to be sent back to the client. I thought you just send back their ids, not the full objects. For more information: http://code.google.com/p/google-web-toolkit/wiki/RequestFactoryMovingParts -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Comment on RequestFactoryMovingParts in google-web-toolkit
Comment by rj...@google.com: An Entity is any object with a well-defined identity and version. Might mention that version is a bit of a misnomer, since it doesn't need to be Comparable. More of a hash tag. For more information: http://code.google.com/p/google-web-toolkit/wiki/RequestFactoryMovingParts -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Comment on RequestFactoryMovingParts in google-web-toolkit
Comment by rj...@google.com: From RequestFactoryinterfaceValidator: proxy type can exempted from validation, missing be For more information: http://code.google.com/p/google-web-toolkit/wiki/RequestFactoryMovingParts -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Comment on RequestFactoryMovingParts in google-web-toolkit
Comment by rj...@google.com: Developers who are advanced enough to take advantage of decorating the ServiceLayer will be able to adapt to changes as they come up. Its javadoc should say so. For more information: http://code.google.com/p/google-web-toolkit/wiki/RequestFactoryMovingParts -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10043 committed - Removed unused template file....
Revision: 10043 Author: rchan...@google.com Date: Wed Apr 20 10:07:50 2011 Log: Removed unused template file. Template files that do not end in src or bin are silently ignored. Review at http://gwt-code-reviews.appspot.com/1425806 Review by: jlaba...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=10043 Deleted: /trunk/user/src/com/google/gwt/user/tools/templates/eclipse/_moduleShortName_.launch === --- /trunk/user/src/com/google/gwt/user/tools/templates/eclipse/_moduleShortName_.launch Mon Mar 7 08:21:08 2011 +++ /dev/null @@ -1,14 +0,0 @@ -?xml version=1.0 encoding=UTF-8? -launchConfiguration type=org.eclipse.jdt.launching.localJavaApplication -booleanAttribute key=org.eclipse.jdt.launching.DEFAULT_CLASSPATH value=false/ -stringAttribute key=org.eclipse.jdt.launching.MAIN_TYPE value=@shellClass/ -listAttribute key=org.eclipse.jdt.launching.CLASSPATH -listEntry value=lt;?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?gt;#10;lt;runtimeClasspathEntry containerPath=quot;org.eclipse.jdt.launching.JRE_CONTAINERquot; javaProject=quot;@moduleShortNamequot; path=quot;1quot; type=quot;4quot;/gt;#10;/ -listEntry value=lt;?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?gt;#10;lt;runtimeClasspathEntry internalArchive=quot;/@moduleShortName/@srcFolderquot; path=quot;3quot; type=quot;2quot;/gt;#10;/ -listEntry value=lt;?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?gt;#10;lt;runtimeClasspathEntry id=quot;org.eclipse.jdt.launching.classpathentry.defaultClasspathquot;gt;#10;lt;memento project=quot;@moduleShortNamequot;/gt;#10;lt;/runtimeClasspathEntrygt;#10;/ -/listAttribute -stringAttribute key=org.eclipse.jdt.launching.VM_ARGUMENTS value=-Xmx256M/ -stringAttribute key=org.eclipse.jdt.launching.PROGRAM_ARGUMENTS value=-war @warFolder -startupUrl @startupUrl @moduleName/ -stringAttribute key=org.eclipse.jdt.launching.PROJECT_ATTR value=@moduleShortName/ -booleanAttribute key=org.eclipse.debug.core.appendEnvironmentVariables value=true/ -/launchConfiguration -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10044 committed - RequestFactoryJarExtractor intermittently throws exceptions when runni...
Revision: 10044 Author: zun...@google.com Date: Wed Apr 20 10:50:16 2011 Log: RequestFactoryJarExtractor intermittently throws exceptions when running on a multi-core build machine. The build infrastructure did not catch the error and kept going, leaving a corrupt request factory jar file. This change updates the Map and Sets used to be concurrent datastructures and caps the number of threads at 4. Review at http://gwt-code-reviews.appspot.com/1425805 Review by: robertvaw...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=10044 Modified: /trunk/requestfactory/build.xml /trunk/user/src/com/google/web/bindery/requestfactory/server/RequestFactoryJarExtractor.java === --- /trunk/requestfactory/build.xml Tue Apr 5 11:50:28 2011 +++ /trunk/requestfactory/build.xml Wed Apr 20 10:50:16 2011 @@ -32,6 +32,7 @@ pathelement path=${gwt.build.out}/dev/bin-test / pathelement path=${gwt.build.out}/user/bin-test / /classpath +jvmarg value=-ea/ arg value=@{target}/ arg file=${gwt.build.lib}/requestfactory-@{target}.jar/ /java === --- /trunk/user/src/com/google/web/bindery/requestfactory/server/RequestFactoryJarExtractor.java Mon Apr 18 16:25:25 2011 +++ /trunk/user/src/com/google/web/bindery/requestfactory/server/RequestFactoryJarExtractor.java Wed Apr 20 10:50:16 2011 @@ -72,8 +72,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; @@ -81,6 +79,8 @@ import java.util.Set; import java.util.concurrent.BlockingQueue; import java.util.concurrent.Callable; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentSkipListSet; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -624,6 +624,11 @@ WriteOperation.class, RequestFactorySource.class, SimpleEventBus.class }; + /** + * Maximum number of threads to use to run the Extractor. + */ + private static final int MAX_THREADS = 4; + static { ListClass? sharedClasses = Arrays.Class? asList(SHARED_CLASSES); @@ -687,7 +692,7 @@ RequestFactoryJarExtractor extractor = new RequestFactoryJarExtractor( errorContext, classLoader, jarEmitter, seeds, mode); extractor.run(); -System.exit(0); +System.exit(extractor.isExecutionFailed() ? 1 : 0); } /** @@ -732,6 +737,7 @@ return false; } + private boolean executionFailed = false; private final Emitter emitter; private final ExecutorService ex; private final BlockingQueueFuture? inProcess = new LinkedBlockingQueueFuture?(); @@ -739,8 +745,8 @@ private final Loader loader; private final Mode mode; private final ListClass? seeds; - private final MapType, Type seen = new HashMapType, Type(); - private final SetString sources = new HashSetString(); + private final MapType, Type seen = new ConcurrentHashMapType, Type(); + private final SetString sources = new ConcurrentSkipListSetString(); private final ExecutorService writerService; public RequestFactoryJarExtractor(Logger logger, Loader loader, @@ -751,7 +757,8 @@ this.seeds = seeds; this.mode = mode; -ex = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); +int numThreads = Math.min(MAX_THREADS, Runtime.getRuntime().availableProcessors()); +ex = Executors.newFixedThreadPool(numThreads); writerService = Executors.newSingleThreadExecutor(); } @@ -770,6 +777,7 @@ } catch (InterruptedException retry) { } catch (ExecutionException e) { e.getCause().printStackTrace(); +executionFailed = true; } } emitter.close(); @@ -781,6 +789,10 @@ private void emit(final State state) { inProcess.add(writerService.submit(new EmitOneType(state))); } + + private boolean isExecutionFailed() { +return executionFailed; + } /** * Look at constant values from the bytecode, processing referenced types. -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10045 committed - Remove the ability to deduce the script base using the marker script i...
Revision: 10045 Author: gwt.mirror...@gmail.com Date: Wed Apr 20 14:47:20 2011 Log: Remove the ability to deduce the script base using the marker script in the xsiframe linker since it doesn't work in FF3.5 and we can't make it work without sacrificing late loading Review at http://gwt-code-reviews.appspot.com/1425801 Review by: zun...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=10045 Added: /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/computeScriptBaseOld.js Modified: /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/SelectionScriptLinker.java /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/computeScriptBase.js === --- /dev/null +++ /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/computeScriptBaseOld.js Wed Apr 20 14:47:20 2011 @@ -0,0 +1,145 @@ +/* + * Copyright 2010 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +/** + * Determine our own script's URL by trying various things + * + * First - use the baseUrl meta tag if it exists + * Second - look for a script tag with the src set to MODULE_NAME.nocache.js and + * if it's found, use it to determine the baseUrl + * Third - if the page is not already loaded, try to use some document.write + * magic to install a temporary tag and use that to determine the baseUrl. + * + * This is included into the selection scripts + * wherever COMPUTE_SCRIPT_BASE appears with underlines + * on each side. + */ + +function computeScriptBase() { + + // Helper methods to process tags == + // Gets the part of a url up to and including the 'path' portion. + function getDirectoryOfFile(path) { +// Truncate starting at the first '?' or '#', whichever comes first. +var hashIndex = path.lastIndexOf('#'); +if (hashIndex == -1) { + hashIndex = path.length; +} +var queryIndex = path.indexOf('?'); +if (queryIndex == -1) { + queryIndex = path.length; +} +var slashIndex = path.lastIndexOf('/', Math.min(queryIndex, hashIndex)); +return (slashIndex = 0) ? path.substring(0, slashIndex + 1) : ''; + } + + function ensureAbsoluteUrl(url) { +if ((url.match(/^\w+:\/\//))) { + // If the URL is obviously absolute, do nothing. +} else { + // Probably a relative URL; use magic to make the browser absolutify it. + // I wish there were a better way to do this, but this seems the only + // sure way! (A side benefit is it preloads clear.cache.gif) + // Note: this trick is harmless if the URL was really already absolute. + var img = $doc.createElement(img); + img.src = url + 'clear.cache.gif'; + url = getDirectoryOfFile(img.src); +} +return url; + } + +// === Various methods to try finding the base = + function tryMetaTag() { +var metaVal = __gwt_getMetaProperty('baseUrl'); +if (metaVal != null) { + return metaVal; +} +return ''; + } + + function tryNocacheJsTag() { +// By default, this script looks like something/moduleName.nocache.js +// so look for a script tag that looks like that +var scriptTags = $doc.getElementsByTagName('script'); +for (var i = 0; i scriptTags.length; ++i) { + if (scriptTags[i].src.indexOf('__MODULE_NAME__.nocache.js') != -1) { +return getDirectoryOfFile(scriptTags[i].src); + } +} +return ''; + } + + function tryMarkerScript() { +// If the user renamed their script tag, we'll use a fancier method to find +// it. Note that this will not work in the Late Loading case due to the +// document.write call. +var thisScript; +if (typeof isBodyLoaded == 'undefined' || !isBodyLoaded()) { + // Put in a marker script element which should be the first script tag after + // the tag we're looking for. To find it, we start at the marker and walk + // backwards until we find a script. + var markerId = __gwt_marker___MODULE_NAME__; + var markerScript; + $doc.write('script id=' + markerId + '/script'); + markerScript = $doc.getElementById(markerId); + thisScript = markerScript markerScript.previousSibling; + while (thisScript thisScript.tagName != 'SCRIPT') { +thisScript = thisScript.previousSibling; + } + if (markerScript) { +
[gwt-contrib] [google-web-toolkit] r10046 committed - Replace HeaderPanel's custom iterator with a new package protected Fin...
Revision: 10046 Author: gwt.mirror...@gmail.com Date: Wed Apr 20 14:52:56 2011 Log: Replace HeaderPanel's custom iterator with a new package protected FiniteWidgetIterator that iterates over children in a WidgetProvider. FiniteWidgetIterator is a generic iterator over a finite set of child widgets (versus WidgetIterator, which iterators over panel of arbitrary size). I intended to use FiniteWidgetIterator in another change then ended up not needing it, but I'm sure it will come in handy for other widgets. Review at http://gwt-code-reviews.appspot.com/1420807 Review by: rj...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=10046 Added: /trunk/user/src/com/google/gwt/user/client/ui/FiniteWidgetIterator.java /trunk/user/test/com/google/gwt/user/client/ui/FiniteWidgetIteratorTest.java Modified: /trunk/user/src/com/google/gwt/user/client/ui/HeaderPanel.java /trunk/user/test/com/google/gwt/user/UISuite.java === --- /dev/null +++ /trunk/user/src/com/google/gwt/user/client/ui/FiniteWidgetIterator.java Wed Apr 20 14:52:56 2011 @@ -0,0 +1,93 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.user.client.ui; + +import java.util.Iterator; +import java.util.NoSuchElementException; + +/** + * Iterator over a finite number of widgets, which are stored in a delegate + * class (usually a widget panel). + * + * p + * In order to use this class, assign each widget in the panel an arbitrary + * index. For example, {@link HeaderPanel} defines the header as index 0, the + * content as index 1, and the footer as index 2. Construct a new + * {@link FiniteWidgetIterator} with a {@link WidgetProvider} that provides the + * child widgets. + */ +class FiniteWidgetIterator implements IteratorWidget { + + /** + * Provides widgets to the iterator. + */ + public static interface WidgetProvider { +IsWidget get(int index); + } + + private int index = -1; + private final WidgetProvider provider; + private final int widgetCount; + + /** + * Construct a new {@link FiniteWidgetIterator}. + * + * p + * The widget count is the number of child widgets that the panel supports, + * regardless of whether or not they are set. + * + * @param provider the widget provider + * @param widgetCount the finite number of widgets that can be provided + */ + public FiniteWidgetIterator(WidgetProvider provider, int widgetCount) { +this.provider = provider; +this.widgetCount = widgetCount; + } + + public boolean hasNext() { +// Iterate over the remaining widgets until we find one. +for (int i = index + 1; i widgetCount; i++) { + IsWidget w = provider.get(i); + if (w != null) { +return true; + } +} +return false; + } + + public Widget next() { +// Iterate over the remaining widgets until we find one. +for (int i = index + 1; i widgetCount; i++) { + index = i; + IsWidget w = provider.get(i); + if (w != null) { +return w.asWidget(); + } +} +throw new NoSuchElementException(); + } + + public void remove() { +if (index 0 || index = widgetCount) { + throw new IllegalStateException(); +} +IsWidget w = provider.get(index); +if (w == null) { + throw new IllegalStateException(Widget was already removed.); +} +w.asWidget().removeFromParent(); + } +} === --- /dev/null +++ /trunk/user/test/com/google/gwt/user/client/ui/FiniteWidgetIteratorTest.java Wed Apr 20 11:47:50 2011 @@ -0,0 +1,199 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.user.client.ui; + +import com.google.gwt.junit.client.GWTTestCase; +import com.google.gwt.user.client.ui.FiniteWidgetIterator.WidgetProvider; + +import java.util.HashMap;
[gwt-contrib] [google-web-toolkit] r10047 committed - Test that references to PredefinedFormat values work with DateLabel...
Revision: 10047 Author: rj...@google.com Date: Wed Apr 20 12:03:38 2011 Log: Test that references to PredefinedFormat values work with DateLabel Review at http://gwt-code-reviews.appspot.com/1427805 Review by: j...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=10047 Modified: /trunk/user/test/com/google/gwt/uibinder/test/client/UiBinderTest.java /trunk/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.java /trunk/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.ui.xml === --- /trunk/user/test/com/google/gwt/uibinder/test/client/UiBinderTest.java Fri Apr 1 10:25:12 2011 +++ /trunk/user/test/com/google/gwt/uibinder/test/client/UiBinderTest.java Wed Apr 20 12:03:38 2011 @@ -49,7 +49,6 @@ public class UiBinderTest extends GWTTestCase { private WidgetBasedUi widgetUi; private DomBasedUi domUi; - @SuppressWarnings(deprecation) private com.google.gwt.user.client.ui.DockPanel root; @Override @@ -168,7 +167,6 @@ widgetUi.bundledDivLegacy.getClassName()); } - @SuppressWarnings(deprecation) public void testCenter() { // TODO(rjrjr) More of a test of HTMLPanelParser @@ -380,7 +378,6 @@ assertTrue(innerHTML.endsWith(/spannbsp;\u261C)); } - @SuppressWarnings(deprecation) public void testNorth() { Widget north = root.getWidget(0); assertEquals(com.google.gwt.user.client.ui.DockPanel.NORTH, @@ -491,6 +488,10 @@ public void testDateLabel() { DateLabel p = widgetUi.myDateLabel; assertNotNull(DateLabel exists, p); +p = widgetUi.myDateLabel2; +assertNotNull(DateLabel exists, p); +p = widgetUi.myDateLabel3; +assertNotNull(DateLabel exists, p); } public void testNumberLabel() { @@ -515,7 +516,6 @@ assertEquals(100%, root.getElement().getStyle().getProperty(width)); } - @SuppressWarnings(deprecation) public void testWest() { Widget west = root.getWidget(1); assertEquals(com.google.gwt.user.client.ui.DockPanel.WEST, === --- /trunk/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.java Fri Apr 1 10:25:12 2011 +++ /trunk/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.java Wed Apr 20 12:03:38 2011 @@ -191,9 +191,10 @@ @UiField NamedFrame myNamedFrame; @UiField DateLabel myDateLabel; @UiField DateLabel myDateLabel2; + @UiField DateLabel myDateLabel3; @UiField NumberLabelFloat myNumberLabel; @UiField NumberLabelFloat myNumberLabel2; - @UiField(provided = true) @SuppressWarnings(unchecked) + @UiField(provided = true) @SuppressWarnings(rawtypes) Renderer doubleRenderer = DoubleRenderer.instance(); @UiField ValueLabelDouble myValueLabel; @UiField ImageElement myImage; === --- /trunk/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.ui.xml Sun Apr 3 21:22:18 2011 +++ /trunk/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.ui.xml Wed Apr 20 12:03:38 2011 @@ -94,6 +94,10 @@ Tests a DateTimeFormat using for the DateTimeLabel. /ui:import +ui:import field='com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat.ISO_8601' + Tests a reference to a PredefinedFormat for the DateTimeLabel. +/ui:import + ui:import field='com.google.gwt.uibinder.test.client.WidgetBasedUi.MY_NUMBER_FORMAT' Tests a NumberFormat using for the NumberLabel. /ui:import @@ -665,6 +669,7 @@ gwt:DateLabel ui:field='myDateLabel' predefinedFormat='DATE_FULL' / gwt:DateLabel ui:field='myDateLabel2' format='{MY_DATE_FORMAT}' / + gwt:DateLabel ui:field='myDateLabel3' predefinedFormat='{ISO_8601}' / gwt:NumberLabel ui:field='myNumberLabel' predefinedFormat='SCIENTIFIC' / gwt2:ui.NumberLabel ui:field='myNumberLabel2' format='{MY_NUMBER_FORMAT}' / -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10048 committed - Tighten sanity checks on BigDecimal(String value) so that it doesn't a...
Revision: 10048 Author: hhc...@google.com Date: Wed Apr 20 12:13:58 2011 Log: Tighten sanity checks on BigDecimal(String value) so that it doesn't accept strings with 2 signs. Review at http://gwt-code-reviews.appspot.com/1424806 Review by: j...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=10048 Modified: /trunk/user/super/com/google/gwt/emul/java/math/BigDecimal.java /trunk/user/test/com/google/gwt/emultest/java/math/BigDecimalConstructorsTest.java === --- /trunk/user/super/com/google/gwt/emul/java/math/BigDecimal.java Fri Dec 10 11:30:52 2010 +++ /trunk/user/super/com/google/gwt/emul/java/math/BigDecimal.java Wed Apr 20 12:13:58 2011 @@ -2608,6 +2608,12 @@ if ((offset last) (val.charAt(offset) == '+')) { offset++; begin++; + + // Fail if the next character is another sign. + if ((offset last) + (val.charAt(offset) == '+' || val.charAt(offset) == '-')) { +throw new NumberFormatException(For input string: \ + val + \); + } } int counter = 0; boolean wasNonZero = false; === --- /trunk/user/test/com/google/gwt/emultest/java/math/BigDecimalConstructorsTest.java Fri Dec 10 11:30:52 2010 +++ /trunk/user/test/com/google/gwt/emultest/java/math/BigDecimalConstructorsTest.java Wed Apr 20 12:13:58 2011 @@ -512,6 +512,30 @@ e.getMessage()); } } + + /** + * new BigDecimal(String value) when value has multiple signs. + */ + public void testConstrStringMultipleSignsStartWithPlus() { +String a = +-3; +try { + new BigDecimal(a); + fail(NumberFormatException expected); +} catch (NumberFormatException expected) { +} + } + + /** + * new BigDecimal(String value) when value has multiple signs. + */ + public void testConstrStringMultipleSignsStartWithMinus() { +String a = -+3; +try { + new BigDecimal(a); + fail(NumberFormatException expected); +} catch (NumberFormatException expected) { +} + } /** * new BigDecimal(String value, MathContext). -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10019 committed - Add daniel.r.b...@gmail.com to CLA-SIGNERS file.
Revision: 10019 Author: b...@google.com Date: Tue Apr 19 07:26:05 2011 Log: Add daniel.r.b...@gmail.com to CLA-SIGNERS file. http://code.google.com/p/google-web-toolkit/source/detail?r=10019 Modified: /CLA-SIGNERS === --- /CLA-SIGNERSThu Mar 31 15:17:46 2011 +++ /CLA-SIGNERSTue Apr 19 07:26:05 2011 @@ -5,6 +5,7 @@ alex.tkachman (Alexander Tkachman) bgu...@gmail.com (Bart Guijt) btay...@rackspace.com (Bryan Taylor) +daniel.r.b...@gmail.com (Daniel Ronald Bell) dannydaemo...@gmail.com (Daniel Valenzuela) david.no...@gmail.com (David Nouls) fredsa (Fred Sauer) -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10020 committed - Suppresses multiple warnings related to validation .jar file and...
Revision: 10020 Author: zun...@google.com Date: Tue Apr 19 04:01:17 2011 Log: Suppresses multiple warnings related to validation .jar file and replaces them with a single warning to add the .jar file to the classpath. Review at http://gwt-code-reviews.appspot.com/1424804 http://code.google.com/p/google-web-toolkit/source/detail?r=10020 Modified: /trunk/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenTypeAssignableTo.java === --- /trunk/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenTypeAssignableTo.java Tue Apr 5 03:08:39 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenTypeAssignableTo.java Tue Apr 19 04:01:17 2011 @@ -27,6 +27,8 @@ */ public class ConditionWhenTypeAssignableTo extends Condition { + private static boolean warnedMissingValidationJar = false; + private final String assignableToTypeName; public ConditionWhenTypeAssignableTo(String assignableToTypeName) { @@ -60,7 +62,12 @@ // This isn't a strict failure case because stale rules can reference // types that have been deleted. // - logger.log(TreeLogger.WARN, Unknown type ' + assignableToTypeName + TreeLogger.Type level = TreeLogger.WARN; + if (shouldSuppressWarning(logger, assignableToTypeName)) { +// Suppress validation related errors +level = TreeLogger.DEBUG; + } + logger.log(level, Unknown type ' + assignableToTypeName + ' specified in deferred binding rule, null); return false; } @@ -86,4 +93,27 @@ return toString(); } -} + /** + * Suppress multiple validation related messages and replace with a hint. + * + * @param typeName fully qualified type name to check for filtering + */ + // TODO(zundel): Can be removed when javax.validation is included in the JRE + private boolean shouldSuppressWarning(TreeLogger logger, String typeName) { +if (typeName.startsWith(javax.validation.) +|| typeName.startsWith(com.google.gwt.validation.) +|| typeName.startsWith(com.google.gwt.editor.client)) { + if (!warnedMissingValidationJar) { +warnedMissingValidationJar = true; +logger.log(TreeLogger.WARN, Detected warnings related to ' + typeName + '. ++ Is validation-api-version-sources.jar on the classpath?); +logger.log(TreeLogger.INFO, Specify -logLevel DEBUG to see all errors.); +// Show the first error that matches +return false; + } + // Suppress subsequent errors that match + return true; +} +return false; + } +} -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10021 committed - Allow ServiceLocator instantiation to be controlled via RequestFactory...
Revision: 10021 Author: gwt.mirror...@gmail.com Date: Tue Apr 19 07:59:33 2011 Log: Allow ServiceLocator instantiation to be controlled via RequestFactory ServiceLocator. http://gwt-code-reviews.appspot.com/1427801/ http://code.google.com/p/google-web-toolkit/issues/detail?id=6264 Patch by: daniel.r.bell Review by: bobv, t.broyer http://code.google.com/p/google-web-toolkit/source/detail?r=10021 Added: /trunk/user/test/com/google/web/bindery/requestfactory/server/ServiceLocatorTest.java Modified: /trunk/user/src/com/google/web/bindery/requestfactory/server/LocatorServiceLayer.java /trunk/user/src/com/google/web/bindery/requestfactory/server/ServiceLayer.java /trunk/user/src/com/google/web/bindery/requestfactory/server/ServiceLayerDecorator.java /trunk/user/test/com/google/web/bindery/requestfactory/vm/RequestFactoryJreSuite.java === --- /dev/null +++ /trunk/user/test/com/google/web/bindery/requestfactory/server/ServiceLocatorTest.java Tue Apr 19 07:59:33 2011 @@ -0,0 +1,55 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.web.bindery.requestfactory.server; + +import com.google.web.bindery.requestfactory.shared.ServiceLocator; + +import junit.framework.TestCase; + +/** + * Tests creating of ServiceLocators with custom ServiceLayerDecorators + */ +public class ServiceLocatorTest extends TestCase { + + static class CustomLocatorLayer extends ServiceLayerDecorator { +@Override +@SuppressWarnings(unchecked) +public T extends ServiceLocator T createServiceLocator(ClassT clazz) { + return (T) ServiceLocatorImpl.INSTANCE; +} + } + + static class ServiceLocatorImpl implements ServiceLocator { +static final ServiceLocatorImpl INSTANCE = new ServiceLocatorImpl(); + +public Object getInstance(Class? clazz) { + return new Object(); +} + } + + public void testGetsServiceLocatorFromDecorator() { +ServiceLayer layer = ServiceLayer.create(new CustomLocatorLayer()); +ServiceLocatorImpl locator = layer.createServiceLocator(ServiceLocatorImpl.class); +assertSame(ServiceLocatorImpl.INSTANCE, locator); + } + + public void testInstantiatesServiceLocatorByDefault() { +ServiceLayer layer = ServiceLayer.create(); +ServiceLocatorImpl locator = layer.createServiceLocator(ServiceLocatorImpl.class); +assertNotNull(locator); +assertNotSame(ServiceLocatorImpl.INSTANCE, locator); + } +} === --- /trunk/user/src/com/google/web/bindery/requestfactory/server/LocatorServiceLayer.java Tue Apr 5 10:47:39 2011 +++ /trunk/user/src/com/google/web/bindery/requestfactory/server/LocatorServiceLayer.java Tue Apr 19 07:59:33 2011 @@ -50,15 +50,21 @@ @Override public Object createServiceInstance(Method contextMethod, Method domainMethod) { -Class? extends ServiceLocator locatorType = -getTop().resolveServiceLocator(contextMethod, domainMethod); -ServiceLocator locator = newInstance(locatorType, ServiceLocator.class); +Class? extends ServiceLocator locatorType = getTop().resolveServiceLocator( +contextMethod, domainMethod); +ServiceLocator locator = getTop().createServiceLocator(locatorType); // Enclosing class may be a parent class, so invoke on service class Class? declaringClass = contextMethod.getDeclaringClass(); -Class? serviceClass = - getTop().resolveServiceClass(declaringClass.asSubclass(RequestContext.class)); +Class? serviceClass = getTop().resolveServiceClass( +declaringClass.asSubclass(RequestContext.class)); return locator.getInstance(serviceClass); } + + @Override + public T extends ServiceLocator T createServiceLocator( + ClassT serviceLocatorType) { +return newInstance(serviceLocatorType, ServiceLocator.class); + } @Override public Object getId(Object domainObject) { @@ -94,7 +100,8 @@ * method is non-static. */ @Override - public boolean requiresServiceLocator(Method contextMethod, Method domainMethod) { + public boolean requiresServiceLocator(Method contextMethod, + Method domainMethod) { return Request.class.isAssignableFrom(contextMethod.getReturnType()) !Modifier.isStatic(domainMethod.getModifiers()); } @@ -102,7 +109,8 @@ @Override public Class? extends Locator?, ? resolveLocator(Class? domainType) {
[gwt-contrib] [google-web-toolkit] r10022 committed - Add @SkipInterfaceValidation to RequestFactory to selectively bypass m...
Revision: 10022 Author: t.bro...@gmail.com Date: Tue Apr 19 06:04:28 2011 Log: Add @SkipInterfaceValidation to RequestFactory to selectively bypass matching interface methods to domain methods. http://gwt-code-reviews.appspot.com/1338807 Patch by: t.broyer Review by: bobv http://code.google.com/p/google-web-toolkit/source/detail?r=10022 Added: /trunk/user/src/com/google/web/bindery/requestfactory/shared/SkipInterfaceValidation.java Modified: /trunk/user/src/com/google/web/bindery/requestfactory/gwt/rebind/model/EntityProxyModel.java /trunk/user/src/com/google/web/bindery/requestfactory/server/RequestFactoryInterfaceValidator.java /trunk/user/test/com/google/web/bindery/requestfactory/server/RequestFactoryInterfaceValidatorTest.java === --- /dev/null +++ /trunk/user/src/com/google/web/bindery/requestfactory/shared/SkipInterfaceValidation.java Tue Apr 19 06:04:28 2011 @@ -0,0 +1,35 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.web.bindery.requestfactory.shared; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Annotation on methods of {@link RequestContext}, {@link EntityProxy}, or + * {@link ValueProxy} interfaces so that the + * {@link com.google.web.bindery.requestfactory.server.RequestFactoryInterfaceValidator + * RequestFactoryInterfaceValidator} doesn't enforce the presence of a + * corresponding method on the domain type. + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface SkipInterfaceValidation { +} === --- /trunk/user/src/com/google/web/bindery/requestfactory/gwt/rebind/model/EntityProxyModel.java Tue Apr 5 10:47:39 2011 +++ /trunk/user/src/com/google/web/bindery/requestfactory/gwt/rebind/model/EntityProxyModel.java Tue Apr 19 06:04:28 2011 @@ -43,10 +43,6 @@ public EntityProxyModel peek() { return toReturn; } - -public void setProxyFor(Class? value) { - toReturn.proxyFor = value; -} public void setQualifiedBinaryName(String qualifiedBinaryName) { toReturn.qualifiedBinaryName = qualifiedBinaryName; @@ -74,7 +70,6 @@ ENTITY, VALUE } - private Class? proxyFor; private String qualifiedBinaryName; private String qualifiedSourceName; private ListRequestMethod requestMethods; @@ -91,10 +86,6 @@ } visitor.endVisit(this); } - - public Class? getProxyFor() { -return proxyFor; - } public String getQualifiedBinaryName() { return qualifiedBinaryName; === --- /trunk/user/src/com/google/web/bindery/requestfactory/server/RequestFactoryInterfaceValidator.java Mon Apr 18 02:42:06 2011 +++ /trunk/user/src/com/google/web/bindery/requestfactory/server/RequestFactoryInterfaceValidator.java Tue Apr 19 06:04:28 2011 @@ -39,6 +39,7 @@ import com.google.web.bindery.requestfactory.shared.RequestFactory; import com.google.web.bindery.requestfactory.shared.Service; import com.google.web.bindery.requestfactory.shared.ServiceName; +import com.google.web.bindery.requestfactory.shared.SkipInterfaceValidation; import com.google.web.bindery.requestfactory.shared.ValueProxy; import java.io.IOException; @@ -416,17 +417,27 @@ if (clinit.equals(name) || init.equals(name)) { return null; } - RFMethod method = new RFMethod(name, desc); + final RFMethod method = new RFMethod(name, desc); method.setDeclaredStatic((access Opcodes.ACC_STATIC) != 0); method.setDeclaredSignature(signature); methods.add(method); - return null; + + return new EmptyVisitor() { +@Override +public AnnotationVisitor visitAnnotation(String desc, boolean visible) { + if (desc.equals(Type.getDescriptor(SkipInterfaceValidation.class))) { +method.setValidationSkipped(true); + } + return null; +} + }; } } private static class RFMethod extends Method { private boolean isDeclaredStatic; private String signature; +private boolean isValidationSkipped; public RFMethod(String name, String desc) { super(name, desc); @@ -439,6 +450,10 @@ public
[gwt-contrib] [google-web-toolkit] r10023 committed - Make EventBus backward compatible....
Revision: 10023 Author: rj...@google.com Date: Tue Apr 19 06:56:46 2011 Log: Make EventBus backward compatible. Review at http://gwt-code-reviews.appspot.com/1423803 Review by: robertvaw...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=10023 Modified: /trunk/user/src/com/google/gwt/event/shared/EventBus.java /trunk/user/src/com/google/gwt/event/shared/ResettableEventBus.java /trunk/user/src/com/google/gwt/event/shared/SimpleEventBus.java /trunk/user/src/com/google/gwt/event/shared/testing/CountingEventBus.java === --- /trunk/user/src/com/google/gwt/event/shared/EventBus.java Mon Apr 18 16:25:25 2011 +++ /trunk/user/src/com/google/gwt/event/shared/EventBus.java Tue Apr 19 06:56:46 2011 @@ -21,8 +21,9 @@ * Extends {com.google.web.bindery.event.shared.EventBus} for legacy * compatibility. */ -public abstract class EventBus extends com.google.web.bindery.event.shared.EventBus implements HasHandlers { - +public abstract class EventBus extends com.google.web.bindery.event.shared.EventBus implements +HasHandlers { + public H extends EventHandler HandlerRegistration addHandler(GwtEvent.TypeH type, H handler) { return wrap(addHandler((Event.TypeH) type, handler)); } @@ -31,8 +32,24 @@ Object source, H handler) { return wrap(addHandlerToSource((Event.TypeH) type, source, handler)); } - - public void fireEvent(GwtEvent? event) { + + public void fireEvent(Event? event) { +throw new UnsupportedOperationException(Subclass responsibility. ++ This class is a legacy wrapper for com.google.web.bindery.event.shared.EventBus. ++ Use that directly, or try com.google.gwt.event.shared.SimpleEventBus); + } + + public abstract void fireEvent(GwtEvent? event); + + public void fireEventFromSource(Event? event, Object source) { +throw new UnsupportedOperationException(Subclass responsibility. ++ This class is a legacy wrapper for com.google.web.bindery.event.shared.EventBus. ++ Use that directly, or try com.google.gwt.event.shared.SimpleEventBus); + } + + public abstract void fireEventFromSource(GwtEvent? event, Object source); + + protected void castFireEvent(GwtEvent? event) { try { fireEvent((Event?) event); } catch (com.google.web.bindery.event.shared.UmbrellaException e) { @@ -40,7 +57,7 @@ } } - public void fireEventFromSource(GwtEvent? event, Object source) { + protected void castFireEventFromSource(GwtEvent? event, Object source) { try { fireEventFromSource((Event?) event, source); } catch (com.google.web.bindery.event.shared.UmbrellaException e) { === --- /trunk/user/src/com/google/gwt/event/shared/ResettableEventBus.java Mon Apr 18 16:25:25 2011 +++ /trunk/user/src/com/google/gwt/event/shared/ResettableEventBus.java Tue Apr 19 06:56:46 2011 @@ -58,11 +58,21 @@ public void fireEvent(Event? event) { real.fireEvent(event); } + + @Override + public void fireEvent(GwtEvent? event) { +castFireEvent(event); + } @Override public void fireEventFromSource(Event? event, Object source) { real.fireEventFromSource(event, source); } + + @Override + public void fireEventFromSource(GwtEvent? event, Object source) { +castFireEventFromSource(event, source); + } public void removeHandlers() { real.removeHandlers(); === --- /trunk/user/src/com/google/gwt/event/shared/SimpleEventBus.java Mon Apr 18 16:25:25 2011 +++ /trunk/user/src/com/google/gwt/event/shared/SimpleEventBus.java Tue Apr 19 06:56:46 2011 @@ -41,9 +41,19 @@ public void fireEvent(Event? event) { real.fireEvent(event); } + + @Override + public void fireEvent(GwtEvent? event) { +castFireEvent(event); + } @Override public void fireEventFromSource(Event? event, Object source) { real.fireEventFromSource(event, source); } -} + + @Override + public void fireEventFromSource(GwtEvent? event, Object source) { +castFireEventFromSource(event, source); + } +} === --- /trunk/user/src/com/google/gwt/event/shared/testing/CountingEventBus.java Mon Apr 18 16:25:25 2011 +++ /trunk/user/src/com/google/gwt/event/shared/testing/CountingEventBus.java Tue Apr 19 06:56:46 2011 @@ -49,11 +49,21 @@ public void fireEvent(Event? event) { real.fireEvent(event); } + + @Override + public void fireEvent(GwtEvent? event) { +castFireEvent(event); + } @Override public void fireEventFromSource(Event? event, Object source) { real.fireEventFromSource(event, source); } + + @Override + public void fireEventFromSource(GwtEvent? event, Object source) { +castFireEventFromSource(event, source); + } public int getCount(GwtEvent.Type? type) { return real.getCount(type); --
[gwt-contrib] [google-web-toolkit] r10025 committed - Supress errors when the binary validation.jar file is missing from the...
Revision: 10025 Author: zun...@google.com Date: Tue Apr 19 07:37:00 2011 Log: Supress errors when the binary validation.jar file is missing from the class path (previous patch only address source jar) Review at http://gwt-code-reviews.appspot.com/1422804 http://code.google.com/p/google-web-toolkit/source/detail?r=10025 Modified: /trunk/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenTypeAssignableTo.java /trunk/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java === --- /trunk/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenTypeAssignableTo.java Tue Apr 19 04:01:17 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenTypeAssignableTo.java Tue Apr 19 07:37:00 2011 @@ -106,7 +106,7 @@ if (!warnedMissingValidationJar) { warnedMissingValidationJar = true; logger.log(TreeLogger.WARN, Detected warnings related to ' + typeName + '. -+ Is validation-api-version-sources.jar on the classpath?); ++ Are validation-api-version.jar and validation-api-version-sources.jar on the classpath?); logger.log(TreeLogger.INFO, Specify -logLevel DEBUG to see all errors.); // Show the first error that matches return false; === --- /trunk/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java Wed Feb 9 07:49:06 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java Tue Apr 19 07:37:00 2011 @@ -25,15 +25,15 @@ import com.google.gwt.dev.asm.signature.SignatureReader; import com.google.gwt.dev.asm.util.TraceClassVisitor; import com.google.gwt.dev.javac.asm.CollectAnnotationData; +import com.google.gwt.dev.javac.asm.CollectAnnotationData.AnnotationData; import com.google.gwt.dev.javac.asm.CollectClassData; +import com.google.gwt.dev.javac.asm.CollectClassData.AnnotationEnum; import com.google.gwt.dev.javac.asm.CollectFieldData; import com.google.gwt.dev.javac.asm.CollectMethodData; import com.google.gwt.dev.javac.asm.CollectTypeParams; import com.google.gwt.dev.javac.asm.ResolveClassSignature; import com.google.gwt.dev.javac.asm.ResolveMethodSignature; import com.google.gwt.dev.javac.asm.ResolveTypeSignature; -import com.google.gwt.dev.javac.asm.CollectAnnotationData.AnnotationData; -import com.google.gwt.dev.javac.asm.CollectClassData.AnnotationEnum; import com.google.gwt.dev.javac.typemodel.JAbstractMethod; import com.google.gwt.dev.javac.typemodel.JArrayType; import com.google.gwt.dev.javac.typemodel.JClassType; @@ -239,6 +239,11 @@ */ private static final boolean TRACE_CLASSES = false; + /** + * Suppress some warnings related to missing valiation.jar on classpath. + */ + private static boolean warnedMissingValidationJar = false; + private static JTypeParameter[] collectTypeParams(String signature) { if (signature != null) { ListJTypeParameter params = new ArrayListJTypeParameter(); @@ -541,22 +546,27 @@ private Class? extends Annotation getAnnotationClass(TreeLogger logger, AnnotationData annotData) { Type type = Type.getType(annotData.getDesc()); +String typeName = type.getClassName(); try { - Class? clazz = Class.forName(type.getClassName(), false, + Class? clazz = Class.forName(typeName, false, Thread.currentThread().getContextClassLoader()); if (!Annotation.class.isAssignableFrom(clazz)) { -logger.log(TreeLogger.ERROR, Type + type.getClassName() +logger.log(TreeLogger.ERROR, Type + typeName + is not an annotation); return null; } return clazz.asSubclass(Annotation.class); } catch (ClassNotFoundException e) { - logger.log(TreeLogger.WARN, Ignoring unresolvable annotation type - + type.getClassName()); + TreeLogger.Type level = TreeLogger.WARN; + if (shouldSuppressUnresolvableAnnotation(logger, typeName)) { +level = TreeLogger.DEBUG; + } + logger.log(level, Ignoring unresolvable annotation type + + typeName); return null; } } - + @SuppressWarnings(unused) private Class? getClassLiteralForPrimitive(Type type) { switch (type.getSort()) { @@ -583,7 +593,7 @@ return null; } } - + /** * Map a bitset onto a different bitset. * @@ -1164,4 +1174,27 @@ return null; } } -} + + /** + * Suppress multiple validation related messages and replace with a hint. + * + * @param typeName fully qualified type name to check for filtering + */ + // TODO(zundel): Can be removed when javax.validation is included in the JRE + private boolean shouldSuppressUnresolvableAnnotation(TreeLogger logger, String typeName) { +if (typeName.startsWith(javax.validation.) +|| typeName.startsWith(com.google.gwt.validation.)) { + if (!warnedMissingValidationJar) { +warnedMissingValidationJar = true; +
[gwt-contrib] [google-web-toolkit] r10026 committed - Proposition: Use ConcurrentHashMap to avoid locking when using the...
Revision: 10026 Author: bub...@google.com Date: Tue Apr 19 08:27:36 2011 Log: Proposition: Use ConcurrentHashMap to avoid locking when using the clientOracleCache. Review at http://gwt-code-reviews.appspot.com/1425803 http://code.google.com/p/google-web-toolkit/source/detail?r=10026 Modified: /trunk/user/src/com/google/gwt/rpc/server/RpcServlet.java === --- /trunk/user/src/com/google/gwt/rpc/server/RpcServlet.java Thu Dec 16 11:33:51 2010 +++ /trunk/user/src/com/google/gwt/rpc/server/RpcServlet.java Tue Apr 19 08:27:36 2011 @@ -33,8 +33,8 @@ import java.net.MalformedURLException; import java.net.URL; import java.net.UnknownHostException; -import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import java.util.zip.GZIPOutputStream; import javax.servlet.ServletException; @@ -53,7 +53,7 @@ protected static final String CLIENT_ORACLE_EXTENSION = .gwt.rpc; private static final boolean DUMP_PAYLOAD = Boolean.getBoolean(gwt.rpc.dumpPayload); - private final MapString, SoftReferenceClientOracle clientOracleCache = new HashMapString, SoftReferenceClientOracle(); + private final MapString, SoftReferenceClientOracle clientOracleCache = new ConcurrentHashMapString, SoftReferenceClientOracle(); /** * The implementation of the service. @@ -98,6 +98,17 @@ ClientOracle toReturn; +// Fast path if the ClientOracle is already cached. +if (clientOracleCache.containsKey(permutationStrongName)) { + toReturn = clientOracleCache.get(permutationStrongName).get(); + if (toReturn != null) { +return toReturn; + } +} + +/* Synchronize to make sure expensive calls are executed only once. + Double checked locking idiom works here because of volatiles in + ConcurrentHashMap.*/ synchronized (clientOracleCache) { if (clientOracleCache.containsKey(permutationStrongName)) { toReturn = clientOracleCache.get(permutationStrongName).get(); -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10027 committed - Cherry pick r9903 into releases/2.3, fix compiler handling of int += d...
Revision: 10027 Author: rj...@google.com Date: Tue Apr 19 08:27:27 2011 Log: Cherry pick r9903 into releases/2.3, fix compiler handling of int += double http://code.google.com/p/google-web-toolkit/source/detail?r=10027 Added: /releases/2.3/dev/core/javatests /releases/2.3/dev/core/test/com/google/gwt/dev/jjs/impl/PostOptimizationCompoundAssignmentNormalizerTest.java Modified: /releases/2.3/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java /releases/2.3/dev/core/src/com/google/gwt/dev/jjs/impl/CompoundAssignmentNormalizer.java /releases/2.3/dev/core/src/com/google/gwt/dev/jjs/impl/PostOptimizationCompoundAssignmentNormalizer.java === --- /dev/null +++ /releases/2.3/dev/core/javatestsTue Apr 19 08:27:27 2011 @@ -0,0 +1,1 @@ +test === --- /dev/null +++ /releases/2.3/dev/core/test/com/google/gwt/dev/jjs/impl/PostOptimizationCompoundAssignmentNormalizerTest.java Tue Apr 19 08:27:27 2011 @@ -0,0 +1,63 @@ +/* + * Copyright 2008 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.dev.jjs.impl; + +import com.google.gwt.core.ext.UnableToCompleteException; +import com.google.gwt.dev.jjs.ast.JMethod; +import com.google.gwt.dev.jjs.ast.JProgram; + +/** + * Tests {@link PostOptimizationCompoundAssignmentNormalizer}. + */ +public class PostOptimizationCompoundAssignmentNormalizerTest +extends OptimizerTestBase { + + public void testIntegralFloatCoercion() throws Exception { +// long op= float +optimize(void, long x=2L; float d=3; x += d;).into( +long x=2L; float d=3; x = (long)((float)x + d);); +// long op= long + optimize(void, long x=2L; long d=3L; x += d;).into( +long x=2L; long d=3L; x = x + d;); +// don't touch int op= int +optimize(void, int x=2; int d=3; x += d;).into( +int x=2; int d=3; x += d;); +// don't touch, integral types with lhs wider than rhs +optimize(void, int x=2; short d=3; x += d;).into( +int x=2; short d=3; x += d;); +// different integral types, but should narrow result +optimize(void, int x=2; short d=3; d += x;).into( +int x=2; short d=3; d = (short)(d + x);); +// integral with long, should break up +optimize(void, int x=2; long d=3L; x += d;).into( +int x=2; long d=3L; x = (int)((long)x + d);); +// integral with float +optimize(void, int x=2; float d=3.0f; x += d;).into( +int x=2; float d=3.0f; x = (int)(x + d);); +// integral with double +optimize(void, int x=2; double d=3.0; x += d;).into( +int x=2; double d=3.0; x = (int)(x + d);); +// float and double, don't touch +optimize(void, float x=2; double d=3.0; x += d;).into( +float x=2; double d=3.0; x += d;); + } + + protected boolean optimizeMethod(JProgram program, JMethod method) { +PostOptimizationCompoundAssignmentNormalizer.exec(program); +LongCastNormalizer.exec(program); +return true; + } +} === --- /releases/2.3/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java Tue Mar 22 11:44:40 2011 +++ /releases/2.3/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java Tue Apr 19 08:27:27 2011 @@ -292,10 +292,10 @@ // (5) Normalize the high-level Java tree into a lower-level tree more // suited for JavaScript code generation. Don't go reordering these // willy-nilly because there are some subtle interdependencies. - LongCastNormalizer.exec(jprogram); JsoDevirtualizer.exec(jprogram); CatchBlockNormalizer.exec(jprogram); PostOptimizationCompoundAssignmentNormalizer.exec(jprogram); + LongCastNormalizer.exec(jprogram); LongEmulationNormalizer.exec(jprogram); CastNormalizer.exec(jprogram, options.isCastCheckingDisabled()); ArrayNormalizer.exec(jprogram); === --- /releases/2.3/dev/core/src/com/google/gwt/dev/jjs/impl/CompoundAssignmentNormalizer.java Fri May 28 06:43:34 2010 +++ /releases/2.3/dev/core/src/com/google/gwt/dev/jjs/impl/CompoundAssignmentNormalizer.java Tue Apr 19 08:27:27 2011 @@ -161,8 +161,10 @@ new JMultiExpression(x.getSourceInfo())); JExpression newLhs = replacer.accept(x.getLhs()); - JBinaryOperation operation = new JBinaryOperation(x.getSourceInfo(), + JExpression operation =
[gwt-contrib] [google-web-toolkit] r10028 committed - Cherry picking r9887
Revision: 10028 Author: gwt.mirror...@gmail.com Date: Tue Apr 19 08:29:47 2011 Log: Cherry picking r9887 http://code.google.com/p/google-web-toolkit/source/detail?r=10028 Added: /releases/2.3/user/src/com/google/gwt/event/dom/client/CanPlayThroughEvent.java /releases/2.3/user/src/com/google/gwt/event/dom/client/CanPlayThroughHandler.java /releases/2.3/user/src/com/google/gwt/event/dom/client/EndedEvent.java /releases/2.3/user/src/com/google/gwt/event/dom/client/EndedHandler.java /releases/2.3/user/src/com/google/gwt/event/dom/client/HasAllMediaHandlers.java /releases/2.3/user/src/com/google/gwt/event/dom/client/HasCanPlayThroughHandlers.java /releases/2.3/user/src/com/google/gwt/event/dom/client/HasEndedHandlers.java /releases/2.3/user/src/com/google/gwt/event/dom/client/HasProgressHandlers.java /releases/2.3/user/src/com/google/gwt/event/dom/client/ProgressEvent.java /releases/2.3/user/src/com/google/gwt/event/dom/client/ProgressHandler.java /releases/2.3/user/test/com/google/gwt/user/client/MediaEventsSinkTest.java Modified: /releases/2.3/dev/core/src/com/google/gwt/dev/js/ast/JsRootScope.java /releases/2.3/user/src/com/google/gwt/user/client/DOM.java /releases/2.3/user/src/com/google/gwt/user/client/Event.java /releases/2.3/user/src/com/google/gwt/user/client/impl/DOMImpl.java /releases/2.3/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java /releases/2.3/user/src/com/google/gwt/user/client/impl/DOMImplTrident.java /releases/2.3/user/src/com/google/gwt/user/client/ui/UIObject.java /releases/2.3/user/src/com/google/gwt/user/client/ui/Widget.java === --- /dev/null +++ /releases/2.3/user/src/com/google/gwt/event/dom/client/CanPlayThroughEvent.java Tue Apr 19 08:29:47 2011 @@ -0,0 +1,64 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.event.dom.client; + +/** + * Represents a native media can play through event. + * + * p + * span style=color:redExperimental API: This API is still under development + * and is subject to change. + * /span + * /p + */ +public class CanPlayThroughEvent extends DomEventCanPlayThroughHandler { + + /** + * Event type for media can play through events. Represents the meta-data + * associated with this event. + */ + private static final TypeCanPlayThroughHandler TYPE = new Type + CanPlayThroughHandler(canplaythrough, new CanPlayThroughEvent()); + + /** + * Gets the event type associated with media can play through events. + * + * @return the handler type + */ + public static TypeCanPlayThroughHandler getType() { +return TYPE; + } + + /** + * Protected constructor, use {@link + * DomEvent#fireNativeEvent(com.google.gwt.dom.client.NativeEvent, + * com.google.gwt.event.shared.HasHandlers)} to fire media can play through + * events. + */ + protected CanPlayThroughEvent() { + } + + @Override + public final TypeCanPlayThroughHandler getAssociatedType() { +return TYPE; + } + + + @Override + protected void dispatch(CanPlayThroughHandler handler) { +handler.onCanPlayThrough(this); + } +} === --- /dev/null +++ /releases/2.3/user/src/com/google/gwt/event/dom/client/CanPlayThroughHandler.java Tue Apr 19 08:29:47 2011 @@ -0,0 +1,37 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.event.dom.client; + +import com.google.gwt.event.shared.EventHandler; + +/** + * Handler interface for {@link CanPlayThroughEvent} events. + * + * p + * span style=color:redExperimental API: This API is still under development + * and is subject to change. + * /span + * /p + */ +public interface CanPlayThroughHandler extends EventHandler { + + /** + * Called when CanPlayThroughEvent is fired. + * + * @param event the {@link CanPlayThroughEvent} that
[gwt-contrib] [google-web-toolkit] r10029 committed - Cherry-pick r9991 into 2.3 release branch.
Revision: 10029 Author: gwt.mirror...@gmail.com Date: Tue Apr 19 12:07:49 2011 Log: Cherry-pick r9991 into 2.3 release branch. http://code.google.com/p/google-web-toolkit/source/detail?r=10029 Modified: /releases/2.3/user/src/com/google/gwt/user/server/rpc/AbstractXsrfProtectedServiceServlet.java /releases/2.3/user/src/com/google/gwt/user/server/rpc/XsrfProtectedServiceServlet.java /releases/2.3/user/src/com/google/gwt/user/server/rpc/XsrfTokenServiceServlet.java === --- /releases/2.3/user/src/com/google/gwt/user/server/rpc/AbstractXsrfProtectedServiceServlet.java Wed Feb 23 14:40:04 2011 +++ /releases/2.3/user/src/com/google/gwt/user/server/rpc/AbstractXsrfProtectedServiceServlet.java Tue Apr 19 08:53:49 2011 @@ -41,6 +41,24 @@ */ public abstract class AbstractXsrfProtectedServiceServlet extends RemoteServiceServlet { + + /** + * The default constructor used by service implementations that + * extend this class. The servlet will delegate AJAX requests to + * the appropriate method in the subclass. + */ + public AbstractXsrfProtectedServiceServlet() { +super(); + } + + /** + * The wrapping constructor used by service implementations that are + * separate from this class. The servlet will delegate AJAX + * requests to the appropriate method in the given object. + */ + public AbstractXsrfProtectedServiceServlet(Object delegate) { +super(delegate); + } @Override protected void onAfterRequestDeserialized(RPCRequest rpcRequest) { === --- /releases/2.3/user/src/com/google/gwt/user/server/rpc/XsrfProtectedServiceServlet.java Mon Feb 28 10:45:39 2011 +++ /releases/2.3/user/src/com/google/gwt/user/server/rpc/XsrfProtectedServiceServlet.java Tue Apr 19 08:53:49 2011 @@ -63,6 +63,16 @@ public XsrfProtectedServiceServlet(String sessionCookieName) { this.sessionCookieName = sessionCookieName; } + + public XsrfProtectedServiceServlet(Object delegate) { +this(delegate, null); + } + + public XsrfProtectedServiceServlet(Object delegate, + String sessionCookieName) { +super(delegate); +this.sessionCookieName = sessionCookieName; + } @Override public void init() throws ServletException { === --- /releases/2.3/user/src/com/google/gwt/user/server/rpc/XsrfTokenServiceServlet.java Mon Feb 28 10:45:39 2011 +++ /releases/2.3/user/src/com/google/gwt/user/server/rpc/XsrfTokenServiceServlet.java Tue Apr 19 08:53:49 2011 @@ -94,7 +94,7 @@ * public void onSuccess(XsrfToken result) { * MyRpcServiceAsync rpc = (MyRpcServiceAsync)GWT.create(MyRpcService.class); * ((HasRpcToken) rpc).setRpcToken(result); - * // make XSRF protection RPC calls using + * // make XSRF protected RPC call * rpc.doStuff(new AsyncCallbacklt;Voidgt;() { * // ... * }); -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10030 committed - Cherry picking r10020 into releases/gwt/2.3
Revision: 10030 Author: zun...@google.com Date: Tue Apr 19 09:13:32 2011 Log: Cherry picking r10020 into releases/gwt/2.3 http://code.google.com/p/google-web-toolkit/source/detail?r=10030 Modified: /releases/2.3/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenTypeAssignableTo.java === --- /releases/2.3/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenTypeAssignableTo.java Wed Aug 11 09:22:23 2010 +++ /releases/2.3/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenTypeAssignableTo.java Tue Apr 19 09:13:32 2011 @@ -27,6 +27,8 @@ */ public class ConditionWhenTypeAssignableTo extends Condition { + private static boolean warnedMissingValidationJar = false; + private final String assignableToTypeName; public ConditionWhenTypeAssignableTo(String assignableToTypeName) { @@ -59,7 +61,12 @@ // This isn't a strict failure case because stale rules can reference // types that have been deleted. // - logger.log(TreeLogger.WARN, Unknown type ' + assignableToTypeName + TreeLogger.Type level = TreeLogger.WARN; + if (shouldSuppressWarning(logger, assignableToTypeName)) { +// Suppress validation related errors +level = TreeLogger.DEBUG; + } + logger.log(level, Unknown type ' + assignableToTypeName + ' specified in deferred binding rule, null); return false; } @@ -85,4 +92,27 @@ return toString(); } -} + /** + * Suppress multiple validation related messages and replace with a hint. + * + * @param typeName fully qualified type name to check for filtering + */ + // TODO(zundel): Can be removed when javax.validation is included in the JRE + private boolean shouldSuppressWarning(TreeLogger logger, String typeName) { +if (typeName.startsWith(javax.validation.) +|| typeName.startsWith(com.google.gwt.validation.) +|| typeName.startsWith(com.google.gwt.editor.client)) { + if (!warnedMissingValidationJar) { +warnedMissingValidationJar = true; +logger.log(TreeLogger.WARN, Detected warnings related to ' + typeName + '. ++ Is validation-api-version-sources.jar on the classpath?); +logger.log(TreeLogger.INFO, Specify -logLevel DEBUG to see all errors.); +// Show the first error that matches +return false; + } + // Suppress subsequent errors that match + return true; +} +return false; + } +} -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10032 committed - Modify the version of xalan-2.7.1.jar used to stop including an old ve...
Revision: 10032 Author: jac...@google.com Date: Tue Apr 19 11:27:51 2011 Log: Modify the version of xalan-2.7.1.jar used to stop including an old version of the Java Cup runtime (version .10). Add java-cup-11a.jar (version .11a) to the tools/lib directory. Review at http://gwt-code-reviews.appspot.com/1404801 Review by: fabb...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=10032 Modified: /trunk/dev/build.xml /trunk/eclipse/external/cldr-tools/.classpath /trunk/eclipse/user/.classpath === --- /trunk/dev/build.xmlMon Mar 28 04:59:34 2011 +++ /trunk/dev/build.xmlTue Apr 19 11:27:51 2011 @@ -102,7 +102,8 @@ include name=htmlunit/htmlunit-r5940/htmlunit-core-js-r5940.jar / include name=nekohtml/nekohtml-1.9.13.jar / include name=streamhtmlparser/streamhtmlparser-jsilver-r10/streamhtmlparser-jsilver-r10-1.5-rebased.jar / - include name=xalan/xalan-2.7.1.jar / + include name=cup/java-cup-11a.jar / + include name=xalan/xalan-2.7.1-nocup.jar / include name=xerces/xerces-2_9_1/serializer.jar / include name=xerces/xerces-2_9_1/xercesImpl-NoMetaInf.jar / include name=xerces/xerces-2_9_1/xml-apis.jar / @@ -165,7 +166,8 @@ zipfileset src=${gwt.tools.lib}/htmlunit/htmlunit-r5940/htmlunit-r5940.jar / zipfileset src=${gwt.tools.lib}/htmlunit/htmlunit-r5940/htmlunit-core-js-r5940.jar / zipfileset src=${gwt.tools.lib}/nekohtml/nekohtml-1.9.13.jar / - zipfileset src=${gwt.tools.lib}/xalan/xalan-2.7.1.jar / + zipfileset src=${gwt.tools.lib}/cup/java-cup-11a.jar / + zipfileset src=${gwt.tools.lib}/xalan/xalan-2.7.1-nocup.jar / zipfileset src=${gwt.tools.lib}/xerces/xerces-2_9_1/serializer.jar / zipfileset src=${gwt.tools.lib}/xerces/xerces-2_9_1/xercesImpl-NoMetaInf.jar / zipfileset src=${gwt.tools.lib}/xerces/xerces-2_9_1/xml-apis.jar / === --- /trunk/eclipse/external/cldr-tools/.classpath Fri Apr 8 07:51:16 2011 +++ /trunk/eclipse/external/cldr-tools/.classpath Tue Apr 19 11:27:51 2011 @@ -2,7 +2,8 @@ classpath classpathentry excluding=org/unicode/cldr/web/| org/unicode/cldr/tool/templates/ kind=src path=java/ classpathentry kind=con path=org.eclipse.jdt.launching.JRE_CONTAINER/ - classpathentry kind=var path=GWT_TOOLS/lib/xalan/xalan-2.7.1.jar/ + classpathentry kind=var path=GWT_TOOLS/lib/cup/java-cup-11a.jar/ + classpathentry kind=var path=GWT_TOOLS/lib/xalan/xalan-2.7.1-nocup.jar/ classpathentry kind=var path=GWT_TOOLS/lib/apache/ant-1.7.1.jar/ classpathentry kind=var path=GWT_TOOLS/lib/icu4j/4.4.2/icu4j.jar sourcepath=/GWT_TOOLS/lib/icu4j/4.4.2/icu4jsrc.jar/ classpathentry kind=var path=GWT_TOOLS/lib/icu4j/4.4.2/utilities.jar sourcepath=/GWT_TOOLS/lib/icu4j/4.4.2/icu4jsrc.jar/ === --- /trunk/eclipse/user/.classpath Wed Mar 9 04:56:27 2011 +++ /trunk/eclipse/user/.classpath Tue Apr 19 11:27:51 2011 @@ -21,7 +21,8 @@ classpathentry kind=var path=GWT_TOOLS/lib/cssparser/cssparser-0.9.5.jar/ classpathentry kind=var path=GWT_TOOLS/lib/nekohtml/nekohtml-1.9.13.jar/ classpathentry kind=var path=GWT_TOOLS/lib/selenium/selenium-java-client-driver.jar sourcepath=/GWT_TOOLS/lib/selenium/selenium-java-client-driver-sources.jar/ - classpathentry kind=var path=GWT_TOOLS/lib/xalan/xalan-2.7.1.jar/ + classpathentry kind=var path=GWT_TOOLS/lib/cup/java-cup-11a.jar/ + classpathentry kind=var path=GWT_TOOLS/lib/xalan/xalan-2.7.1-nocup.jar/ classpathentry kind=var path=GWT_TOOLS/lib/xerces/xerces-2_9_1/serializer.jar/ classpathentry kind=var path=GWT_TOOLS/lib/xerces/xerces-2_9_1/xercesImpl-NoMetaInf.jar/ classpathentry kind=var path=GWT_TOOLS/lib/xerces/xerces-2_9_1/xml-apis.jar/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10033 committed - Finishes the job of making EventBus backward compatible,...
Revision: 10033 Author: rj...@google.com Date: Tue Apr 19 15:43:31 2011 Log: Finishes the job of making EventBus backward compatible, half done in r10023 Review at http://gwt-code-reviews.appspot.com/1425804 Review by: robertvaw...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=10033 Added: /trunk/user/test/com/google/gwt/event/shared/EventBusTest.java Modified: /trunk/user/src/com/google/gwt/event/shared/EventBus.java /trunk/user/src/com/google/gwt/event/shared/ResettableEventBus.java /trunk/user/src/com/google/gwt/event/shared/SimpleEventBus.java /trunk/user/src/com/google/gwt/event/shared/testing/CountingEventBus.java /trunk/user/test/com/google/gwt/event/EventSuite.java === --- /dev/null +++ /trunk/user/test/com/google/gwt/event/shared/EventBusTest.java Tue Apr 19 15:43:31 2011 @@ -0,0 +1,55 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.event.shared; + +import com.google.gwt.event.shared.GwtEvent.Type; + +import junit.framework.TestCase; + +/** + * Test that EventBus is api compatible after its retrofit to extend + * {@link com.google.web.bindery.event.shared.EventBus}. + */ +public class EventBusTest extends TestCase { + EventBus bus = new EventBus() { + +@Override +public H extends EventHandler HandlerRegistration addHandler(TypeH type, H handler) { + throw new UnsupportedOperationException(); +} + +@Override +public H extends EventHandler HandlerRegistration addHandlerToSource(TypeH type, +Object source, H handler) { + throw new UnsupportedOperationException(); +} + +@Override +public void fireEvent(GwtEvent? event) { + throw new UnsupportedOperationException(); +} + +@Override +public void fireEventFromSource(GwtEvent? event, Object source) { + throw new UnsupportedOperationException(); +} + }; + + public void testOne() { +// Nothing to test, really, just make sure it still compiles. +assertNotNull(bus); + } +} === --- /trunk/user/src/com/google/gwt/event/shared/EventBus.java Tue Apr 19 06:56:46 2011 +++ /trunk/user/src/com/google/gwt/event/shared/EventBus.java Tue Apr 19 15:43:31 2011 @@ -24,15 +24,27 @@ public abstract class EventBus extends com.google.web.bindery.event.shared.EventBus implements HasHandlers { - public H extends EventHandler HandlerRegistration addHandler(GwtEvent.TypeH type, H handler) { -return wrap(addHandler((Event.TypeH) type, handler)); - } - - public H extends EventHandler HandlerRegistration addHandlerToSource(GwtEvent.TypeH type, + @Override + public H com.google.web.bindery.event.shared.HandlerRegistration addHandler(Event.TypeH type, H handler) { +throw new UnsupportedOperationException(Subclass responsibility. ++ This class is a legacy wrapper for com.google.web.bindery.event.shared.EventBus. ++ Use that directly, or try com.google.gwt.event.shared.SimpleEventBus); + } + + public abstract H extends EventHandler HandlerRegistration addHandler(GwtEvent.TypeH type, H handler); + + @Override + public H com.google.web.bindery.event.shared.HandlerRegistration addHandlerToSource(Event.TypeH type, Object source, H handler) { -return wrap(addHandlerToSource((Event.TypeH) type, source, handler)); +throw new UnsupportedOperationException(Subclass responsibility. ++ This class is a legacy wrapper for com.google.web.bindery.event.shared.EventBus. ++ Use that directly, or try com.google.gwt.event.shared.SimpleEventBus); } + public abstract H extends EventHandler HandlerRegistration addHandlerToSource(GwtEvent.TypeH type, + Object source, H handler); + + @Override public void fireEvent(Event? event) { throw new UnsupportedOperationException(Subclass responsibility. + This class is a legacy wrapper for com.google.web.bindery.event.shared.EventBus. @@ -41,6 +53,8 @@ public abstract void fireEvent(GwtEvent? event); + + @Override public void fireEventFromSource(Event? event, Object source) { throw new UnsupportedOperationException(Subclass responsibility. + This class is a legacy wrapper for com.google.web.bindery.event.shared.EventBus. === ---
[gwt-contrib] [google-web-toolkit] r10034 committed - Created wiki page through web user interface.
Revision: 10034 Author: b...@google.com Date: Tue Apr 19 16:46:49 2011 Log: Created wiki page through web user interface. http://code.google.com/p/google-web-toolkit/source/detail?r=10034 Added: /wiki/RequestFactoryMovingParts.wiki === --- /dev/null +++ /wiki/RequestFactoryMovingParts.wikiTue Apr 19 16:46:49 2011 @@ -0,0 +1,101 @@ +#summary A summary of the bits that make up RequestFactory + +* Work in progress * + +wiki:toc level='2' / + += Introduction = + +The RequestFactory system is composed of a number of discrete component pieces. This document will describe the rough functionality of the RequestFactory components as a aid to developers who wish to work on RequestFactory or adapt RequestFactory to non-standard deployment environments. This document assumes a working knowledge of how to use RequestFactory. + +img src=http://i.imgur.com/WNqrg.jpg; title=If it doesn't fit on a sticky note, it's too complicated. alt=Schematic drawing of the major components of RequestFactory/ + += Flow = + + * Instantiate an instance of a `RequestFactory` via `GWT.create()` or `RequestFactorySource` + * Obtain an instance of `RequestContext` by calling an accessor method defined within the `RequestFactory` +* Use `RequestContext.create()` and `RequestContext.edit()` to accumulate zero or more *operations* to be applied to domain objects by the server. +* Obtain one or more `Request` objects to accumulate *invocations* on server code. + * The `Request.to()` method provides a `Receiver` that will be notified of the outcome of the invocation associated with the `Request`. +* Call `Request.fire()` or `RequestContext.fire()` to send the accumulated data to the server. + * The accumulated state is transmitted to the server, where the following operations take place: +* All domain objects referred to by the payload will be loaded. +* All accumulated operations will be applied to the domain objects. +* All method invocations in the payload are executed. +* The states of entities referred to in the original payload are compared to the up-to-date states of the entities after all work has been performed. + * Entities with updated properties are enqueued to be sent back to the client. + * Entities that can be no longer retrieved after all work has been performed are reported as having been deleted. + * The return payload is assembled and sent to the client. +* The various `Receivers` attached to `Requests` or the `RequestContext` are invoked to report success, failure, or validation violations. + += Parts Glossary = + +This section contains a brief discussion of each of the major parts of RequestFactory, in no particular order. + +== Code == + +Depending on the terminology used, this may be called business logic, an RPC service layer, or domain behavior. Regardless of the phraseology used, this code exists as either static or instance methods that are mapped onto a `RequestContext` interface. + +RequestFactory assumes that server code will execute in a synchronous, blocking fashion. + +== POJO == + +RequestFactory minimizes the number of assumptions that it makes about server-side (domain) objects. Most operations are performed assuming that domain objects are simply plain old Java objects that are default-instantiable (i.e. a public no-arg constructor) and have pairs of getters and setters. Setters are not required for immutable properties. The requirement for default-instantiability can be removed via the use of a `Locator`. + +=== Entity === + +An Entity is any object with a well-defined identity and version. Entities are mapped on the client as `EntityProxy` subtypes, while all other POJOS can be mapped as `ValueProxy` subtypes. + +While entity domain objects need not extend any particular base type or interface, they must implement the following informal protocol: + * The domain type is default-instantiable + * `I getId()` must return a stable value + * `V getVersion()` must change every time the meaningful state of the domain object changes. No assumption is made about the semantic meaning of the value, just that it is non-`equal()` to state version values. + * `static Entity find(I id)` is used to retrieve a previously-referenced entity, using a value returned by `getId()`. The `find()` method may return `null` to indicate that the entity has been deleted or is otherwise unavailable. + +Domain types that cannot satisfy some or all of the requirements of the entity protocol may participate as entities by using a `Locator`. + +Entities can be transferred in a sparse manner, as any undefined properties can be later retrieved since the entity has a persistent id. By default, reference properties are not transferred unless explicitly specified by a `Request.with()`predicate. + +=== Values === + +A Value is
[gwt-contrib] Re: Comment on ScottSoulBinderDesignDoc in google-web-toolkit
Comment by miller.garym: Who will be demoing the HTML5 SoulStorage feature at I/O? For more information: http://code.google.com/p/google-web-toolkit/wiki/ScottSoulBinderDesignDoc -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10010 committed - Adds back Util.toHexString() and Util.hex4() as deprecated methods....
Revision: 10010 Author: zun...@google.com Date: Mon Apr 18 04:15:28 2011 Log: Adds back Util.toHexString() and Util.hex4() as deprecated methods. They were moved to the Utility class. This gives 3rd party linker and generator authors a chance to migrate their code. Review at http://gwt-code-reviews.appspot.com/1420802 http://code.google.com/p/google-web-toolkit/source/detail?r=10010 Modified: /trunk/dev/core/src/com/google/gwt/dev/util/Util.java === --- /trunk/dev/core/src/com/google/gwt/dev/util/Util.java Tue Apr 5 03:08:39 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/util/Util.java Mon Apr 18 04:15:28 2011 @@ -140,7 +140,7 @@ public static String computeStrongName(byte[] content) { return computeStrongName(new byte[][] {content}); } - + /** * Computes the MD5 hash of the specified byte arrays. * @@ -174,7 +174,7 @@ } return Utility.toHexString(md5.digest()); } - + public static void copy(InputStream is, OutputStream os) throws IOException { try { copyNoClose(is, os); @@ -433,6 +433,16 @@ File file = new File(installPath + '/' + relativePath); return readFileAsString(file); } + + /** + * A 4-digit hex result. + * + * @deprecated use {@link Utility#hex4(char, StringBuffer)} instead. + */ + @Deprecated + public static void hex4(char c, StringBuffer sb) { +Utility.hex4(c, sb); + } /** * This method invokes an inaccessible method in another class. @@ -480,22 +490,6 @@ return true; } - - // /** - // * Reads the file as an array of strings. - // */ - // public static String[] readURLAsStrings(URL url) { - // ArrayList lines = new ArrayList(); - // String contents = readURLAsString(url); - // if (contents != null) { - // StringReader sr = new StringReader(contents); - // BufferedReader br = new BufferedReader(sr); - // String line; - // while (null != (line = readNextLine(br))) - // lines.add(line); - // } - // return (String[]) lines.toArray(new String[lines.size()]); - // } /** * Attempts to make a path relative to a particular directory. @@ -547,6 +541,22 @@ return relativeFile; } + + // /** + // * Reads the file as an array of strings. + // */ + // public static String[] readURLAsStrings(URL url) { + // ArrayList lines = new ArrayList(); + // String contents = readURLAsString(url); + // if (contents != null) { + // StringReader sr = new StringReader(contents); + // BufferedReader br = new BufferedReader(sr); + // String line; + // while (null != (line = readNextLine(br))) + // lines.add(line); + // } + // return (String[]) lines.toArray(new String[lines.size()]); + // } public static String makeRelativePath(File from, File to) { File f = makeRelativeFile(from, to); @@ -895,6 +905,20 @@ } return a; } + + /** + * Returns a string representation of the byte array as a series of + * hexadecimal characters. + * + * @param bytes byte array to convert + * @return a string representation of the byte array as a series of + * hexadecimal characters + * @deprecated use {@link Utility#toHexString(byte[])} instead. + */ + @Deprecated + public static String toHexString(byte[] bytes) { +return Utility.toHexString(bytes); + } /** * Returns a String representing the character content of the bytes; the bytes -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10011 committed - Cherry picking r10010 into releases/gwt_2.3
Revision: 10011 Author: gwt.mirror...@gmail.com Date: Mon Apr 18 08:17:02 2011 Log: Cherry picking r10010 into releases/gwt_2.3 http://code.google.com/p/google-web-toolkit/source/detail?r=10011 Modified: /releases/2.3/dev/core/src/com/google/gwt/dev/util/Util.java === --- /releases/2.3/dev/core/src/com/google/gwt/dev/util/Util.java Sun Feb 6 16:09:46 2011 +++ /releases/2.3/dev/core/src/com/google/gwt/dev/util/Util.java Mon Apr 18 04:51:33 2011 @@ -140,7 +140,7 @@ public static String computeStrongName(byte[] content) { return computeStrongName(new byte[][] {content}); } - + /** * Computes the MD5 hash of the specified byte arrays. * @@ -174,7 +174,7 @@ } return Utility.toHexString(md5.digest()); } - + public static void copy(InputStream is, OutputStream os) throws IOException { try { copyNoClose(is, os); @@ -433,6 +433,16 @@ File file = new File(installPath + '/' + relativePath); return readFileAsString(file); } + + /** + * A 4-digit hex result. + * + * @deprecated use {@link Utility#hex4(char, StringBuffer)} instead. + */ + @Deprecated + public static void hex4(char c, StringBuffer sb) { +Utility.hex4(c, sb); + } /** * This method invokes an inaccessible method in another class. @@ -498,22 +508,6 @@ return true; } - - // /** - // * Reads the file as an array of strings. - // */ - // public static String[] readURLAsStrings(URL url) { - // ArrayList lines = new ArrayList(); - // String contents = readURLAsString(url); - // if (contents != null) { - // StringReader sr = new StringReader(contents); - // BufferedReader br = new BufferedReader(sr); - // String line; - // while (null != (line = readNextLine(br))) - // lines.add(line); - // } - // return (String[]) lines.toArray(new String[lines.size()]); - // } public static void logMissingTypeErrorWithHints(TreeLogger logger, String missingType) { @@ -602,6 +596,22 @@ return relativeFile; } + + // /** + // * Reads the file as an array of strings. + // */ + // public static String[] readURLAsStrings(URL url) { + // ArrayList lines = new ArrayList(); + // String contents = readURLAsString(url); + // if (contents != null) { + // StringReader sr = new StringReader(contents); + // BufferedReader br = new BufferedReader(sr); + // String line; + // while (null != (line = readNextLine(br))) + // lines.add(line); + // } + // return (String[]) lines.toArray(new String[lines.size()]); + // } public static String makeRelativePath(File from, File to) { File f = makeRelativeFile(from, to); @@ -1008,6 +1018,20 @@ } return a; } + + /** + * Returns a string representation of the byte array as a series of + * hexadecimal characters. + * + * @param bytes byte array to convert + * @return a string representation of the byte array as a series of + * hexadecimal characters + * @deprecated use {@link Utility#toHexString(byte[])} instead. + */ + @Deprecated + public static String toHexString(byte[] bytes) { +return Utility.toHexString(bytes); + } /** * Returns a String representing the character content of the bytes; the bytes -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10012 committed - Cherry picking r10008 into releases/2.3
Revision: 10012 Author: p...@google.com Date: Mon Apr 18 05:00:15 2011 Log: Cherry picking r10008 into releases/2.3 http://code.google.com/p/google-web-toolkit/source/detail?r=10012 Modified: /releases/2.3/user/src/com/google/gwt/media/client/Audio.java /releases/2.3/user/src/com/google/gwt/media/client/Video.java === --- /releases/2.3/user/src/com/google/gwt/media/client/Audio.java Mon Apr 18 04:08:56 2011 +++ /releases/2.3/user/src/com/google/gwt/media/client/Audio.java Mon Apr 18 05:00:15 2011 @@ -80,7 +80,7 @@ * @return true if supported, false otherwise. */ static native boolean isSupportedRunTime(AudioElement element) /*-{ - return !!element.play; + return !!element.canPlayType; }-*/; /** === --- /releases/2.3/user/src/com/google/gwt/media/client/Video.java Mon Apr 18 04:08:56 2011 +++ /releases/2.3/user/src/com/google/gwt/media/client/Video.java Mon Apr 18 05:00:15 2011 @@ -78,7 +78,7 @@ * @return true if supported, false otherwise. */ static native boolean isSupportedRunTime(VideoElement element) /*-{ - return !!element.play; + return !!element.canPlayType; }-*/; /** @@ -143,7 +143,7 @@ /** * Creates a Video widget with a given source URL. - * + * * @param src a String URL. * @deprecated use {@link #createIfSupported()}. */ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10013 committed - Removing duplicate entries from User.gwt.xml that were added in r9976 ...
Revision: 10013 Author: jlaba...@google.com Date: Mon Apr 18 05:33:30 2011 Log: Removing duplicate entries from User.gwt.xml that were added in r9976 due to an undetected merge conflict with r9879, in which the entries were sorted alphabetically. Review at http://gwt-code-reviews.appspot.com/1422801 Review by: p...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=10013 Modified: /trunk/user/src/com/google/gwt/user/User.gwt.xml === --- /trunk/user/src/com/google/gwt/user/User.gwt.xml Tue Apr 12 06:14:57 2011 +++ /trunk/user/src/com/google/gwt/user/User.gwt.xml Mon Apr 18 05:33:30 2011 @@ -27,6 +27,7 @@ inherits name=com.google.gwt.layout.Layout/ inherits name=com.google.gwt.media.Media/ inherits name=com.google.gwt.resources.Resources/ + inherits name=com.google.gwt.safecss.SafeCss / inherits name=com.google.gwt.safehtml.SafeHtml / inherits name=com.google.gwt.storage.Storage / inherits name=com.google.gwt.text.Text/ @@ -54,15 +55,6 @@ inherits name=com.google.gwt.user.SplitPanel/ inherits name=com.google.gwt.user.TextBox/ inherits name=com.google.gwt.user.Tree/ - inherits name=com.google.gwt.user.Hyperlink/ - inherits name=com.google.gwt.user.FileUpload/ - inherits name=com.google.gwt.user.ResizeLayoutPanel/ - inherits name=com.google.gwt.user.ScrollPanel/ - inherits name=com.google.gwt.user.datepicker.DatePicker/ - inherits name=com.google.gwt.user.cellview.CellView/ - inherits name=com.google.gwt.safecss.SafeCss / - inherits name=com.google.gwt.safehtml.SafeHtml / - inherits name=com.google.gwt.storage.Storage / inherits name=com.google.gwt.user.Window / inherits name=com.google.gwt.widget.Widget/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10015 committed - Remove error spam from RPCSuite.gwt.xml; non-existent servlet is refer...
Revision: 10015 Author: sco...@google.com Date: Mon Apr 18 08:45:48 2011 Log: Remove error spam from RPCSuite.gwt.xml; non-existent servlet is referenced. Review by: zh...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=10015 Modified: /trunk/user/test/com/google/gwt/user/RPCSuite.gwt.xml === --- /trunk/user/test/com/google/gwt/user/RPCSuite.gwt.xml Wed Apr 13 06:21:31 2011 +++ /trunk/user/test/com/google/gwt/user/RPCSuite.gwt.xml Mon Apr 18 08:45:48 2011 @@ -47,7 +47,5 @@ class='com.google.gwt.user.server.rpc.UnicodeEscapingServiceImpl' / servlet path='/recursiveclass' class='com.google.gwt.user.server.rpc.RecursiveClassTestServiceImpl' / - servlet path='/finalfields' -class='com.google.gwt.user.server.rpc.FinalFieldsTestServiceImpl' / /module -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10017 committed - Remove stray reference to ElementFactory...
Revision: 10017 Author: sbruba...@google.com Date: Mon Apr 18 10:41:11 2011 Log: Remove stray reference to ElementFactory Review at http://gwt-code-reviews.appspot.com/1423801 Review by: rj...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=10017 Modified: /trunk/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java === --- /trunk/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java Tue Apr 12 12:31:13 2011 +++ /trunk/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java Mon Apr 18 10:41:11 2011 @@ -47,8 +47,6 @@ private static final String TEMPLATE_SUFFIX = .ui.xml; - private static final String ELEMENT_FACTORY_PROPERTY = uibinder.html.elementfactory; - private static final String XSS_SAFE_CONFIG_PROPERTY = UiBinder.useSafeHtmlTemplates; /** -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Comment on ScottSoulBinderDesignDoc in google-web-toolkit
Comment by j...@google.com: I'm going to have an HTML5 coprocessor added to my own soul. It's the only way I could figure out how to learn native HTML5. For more information: http://code.google.com/p/google-web-toolkit/wiki/ScottSoulBinderDesignDoc -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Comment on ScottSoulBinderDesignDoc in google-web-toolkit
Comment by j...@google.com: John actually does have a soul, by the way -- it' just a tag interface. For more information: http://code.google.com/p/google-web-toolkit/wiki/ScottSoulBinderDesignDoc -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9996 committed - Update package of RequestFactoryJreSuite...
Revision: 9996 Author: r...@google.com Date: Fri Apr 15 04:55:40 2011 Log: Update package of RequestFactoryJreSuite Review at http://gwt-code-reviews.appspot.com/1416802 Review by: rchan...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9996 Modified: /trunk/user/src/com/google/web/bindery/requestfactory/server/RequestFactoryJarExtractor.java === --- /trunk/user/src/com/google/web/bindery/requestfactory/server/RequestFactoryJarExtractor.java Tue Apr 5 10:47:39 2011 +++ /trunk/user/src/com/google/web/bindery/requestfactory/server/RequestFactoryJarExtractor.java Fri Apr 15 04:55:40 2011 @@ -656,7 +656,7 @@ SEEDS.put( test + CODE_AND_SOURCE, Collections.unmodifiableList(Arrays.Class? asList( - Class.forName(com.google.web.bindery.requestfactory.RequestFactoryJreSuite), + Class.forName(com.google.web.bindery.requestfactory.vm.RequestFactoryJreSuite), Class.forName(com.google.web.bindery.requestfactory.server.SimpleBar; } catch (ClassNotFoundException ignored) { } -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9997 committed - Fixing a bug in CellTree where the Show More button doesn't work for t...
Revision: 9997 Author: gwt.mirror...@gmail.com Date: Fri Apr 15 08:19:00 2011 Log: Fixing a bug in CellTree where the Show More button doesn't work for the root node. Issue: 5547 Review at http://gwt-code-reviews.appspot.com/1420801 Review by: rchan...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9997 Modified: /trunk/user/src/com/google/gwt/user/cellview/client/CellTree.java === --- /trunk/user/src/com/google/gwt/user/cellview/client/CellTree.java Tue Apr 12 06:14:57 2011 +++ /trunk/user/src/com/google/gwt/user/cellview/client/CellTree.java Fri Apr 15 08:19:00 2011 @@ -682,7 +682,7 @@ final boolean isMouseDown = mousedown.equals(eventType); final boolean isClick = click.equals(eventType); final CellTreeNodeView? nodeView = findItemByChain(chain, 0, rootNode); -if (nodeView != null nodeView != rootNode) { +if (nodeView != null) { if (isMouseDown) { Element showMoreElem = nodeView.getShowMoreElement(); if (nodeView.getImageElement().isOrHasChild(target)) { @@ -697,7 +697,7 @@ } // Forward the event to the cell - if (nodeView.getSelectionElement().isOrHasChild(target)) { + if (nodeView != rootNode nodeView.getSelectionElement().isOrHasChild(target)) { // Move the keyboard focus to the clicked item. if (isClick) { /* -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9998 committed - Edited wiki page UiBinder through web user interface.
Revision: 9998 Author: rj...@google.com Date: Fri Apr 15 09:24:12 2011 Log: Edited wiki page UiBinder through web user interface. http://code.google.com/p/google-web-toolkit/source/detail?r=9998 Modified: /wiki/UiBinder.wiki === --- /wiki/UiBinder.wiki Sun Dec 13 13:50:48 2009 +++ /wiki/UiBinder.wiki Fri Apr 15 09:24:12 2011 @@ -1,4 +1,5 @@ #summary UiBinder use cases +#labels Deprecated = GWT UiBinder Use Cases = -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10000 committed - Design doc for integrating Scott's Soul into GWT
Revision: 1 Author: jlaba...@google.com Date: Fri Apr 15 09:28:19 2011 Log: Design doc for integrating Scott's Soul into GWT http://code.google.com/p/google-web-toolkit/source/detail?r=1 Added: /wiki/ScottSoulBinderDesignDoc.wiki === --- /dev/null +++ /wiki/ScottSoulBinderDesignDoc.wiki Fri Apr 15 09:28:19 2011 @@ -0,0 +1,89 @@ +#summary Design Doc for integrating Scott's soul into GWT +#labels Phase-Design + += Introduction = + +Having Scott in the office is useful, but any GWT application would benefit from a little more Scott. Trouble is, he can't be everywhere at once. + +http://google-web-toolkit.googlecode.com/files/ScottSoul.jpg + += Goals = + + * Improve the usability of GWT + * Leverage the new HTML5 SoulStorage feature + += Proposal = + +I propose a new API for accessing Scott's soul. The interface would include useful methods that can access part of Scott's abilities. + +{{{ +// TODO(jlabanca): Should this implement HasValue? +interface ScottSoul implements HasValue{ + + /** + * Be sarcastic in an overly complex way. + * + * @return true if successful, false if too complicated for anyone to get it. + */ + boolean complexSarcasm(); + + /** + * Improve the speed of the compiler, optionally introducing + * an obscure compiler bug that only occurs when passing a + * null value for an Enum of RPC. + * + * @param introduceObscureCompilerBug true to introduce a compiler bug, + *false to introduce one anyway + */ + void improveCompilerSpeed(boolean introduceObscureCompilerBug); + + /** + * Launch a powerful ping pong attack against opponents. Anything higher + * than level 50 will disarm the opponent of his ping pong paddle. Anything + * higher than level 75 will disarm the opponent of his life. + * + * @param level the attack level - valid values are -1 and 86 + */ + void pingPongAttack(int level); +} +}}} + + +This interface can be easily integrated with UiBinder: +{{{ +ui:UiBinder + xmlns:ui=urn:ui:com.google.gwt.uibinder + + ui:with field=soul type=com.google.gwt.scott.soul.ScottSoul / + + g:HTMLPanel +g:Labelui:msg src=soul.complexSarcasm//g:Label + g:/HTMLPanel + +/ui:UiBinder +}}} + += Testing = + +Scott's soul is easily mocked, which makes it great for testing. I'm working on a default implementation that I plan to provide after I resolve an issue with the implementation of complexSarcasm(). For some reason, if you call it too many times, it starts to return false every time. + += Alternatives = + +We considered the following alternatives, but ultimately chose to go with Scott's soul. + +== Tamplin's Soul == + +Integrating Tamplin's soul would provide more depth, but the API is far too complicated for most users. It would lead to too much confusion. + +== Joel's Soul == + +Joel's soul is the most cross-browser compatible solution, but its too dynamic to capture in an API. Scott's Soul, on the other hand, is fairly steady. + +== LaBanca's Soul == + +Integrating my own soul was the most obvious choice, but we quickly realized that I have no soul, which wouldn't add much to the library. + +{{{ +interface LabancaSoul{ +} +}}} -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9999 committed - Cherry picking r9997 into releases/2.3 for issue #5547.
Revision: Author: gwt.mirror...@gmail.com Date: Fri Apr 15 09:28:17 2011 Log: Cherry picking r9997 into releases/2.3 for issue #5547. http://code.google.com/p/google-web-toolkit/source/detail?r= Modified: /releases/2.3/user/src/com/google/gwt/user/cellview/client/CellTree.java === --- /releases/2.3/user/src/com/google/gwt/user/cellview/client/CellTree.java Tue Apr 12 08:34:05 2011 +++ /releases/2.3/user/src/com/google/gwt/user/cellview/client/CellTree.java Fri Apr 15 09:28:17 2011 @@ -682,7 +682,7 @@ final boolean isMouseDown = mousedown.equals(eventType); final boolean isClick = click.equals(eventType); final CellTreeNodeView? nodeView = findItemByChain(chain, 0, rootNode); -if (nodeView != null nodeView != rootNode) { +if (nodeView != null) { if (isMouseDown) { Element showMoreElem = nodeView.getShowMoreElement(); if (nodeView.getImageElement().isOrHasChild(target)) { @@ -697,7 +697,7 @@ } // Forward the event to the cell - if (nodeView.getSelectionElement().isOrHasChild(target)) { + if (nodeView != rootNode nodeView.getSelectionElement().isOrHasChild(target)) { // Move the keyboard focus to the clicked item. if (isClick) { /* -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10002 committed - Clean up the CrossSiteIFrameLoadingStrategy class, removing some dead ...
Revision: 10002 Author: gwt.mirror...@gmail.com Date: Fri Apr 15 10:46:57 2011 Log: Clean up the CrossSiteIFrameLoadingStrategy class, removing some dead code, adding comments to clarify what is going on, and making it throw an error which is more explicit about what triggered the error Review at http://gwt-code-reviews.appspot.com/1413801 http://code.google.com/p/google-web-toolkit/source/detail?r=10002 Modified: /trunk/user/src/com/google/gwt/core/client/CodeDownloadException.java /trunk/user/src/com/google/gwt/core/client/impl/CrossSiteIframeLoadingStrategy.java === --- /trunk/user/src/com/google/gwt/core/client/CodeDownloadException.java Mon Mar 21 12:22:19 2011 +++ /trunk/user/src/com/google/gwt/core/client/CodeDownloadException.java Fri Apr 15 10:46:57 2011 @@ -30,16 +30,21 @@ /** * Generic code for terminating the download. */ -TERMINATED +TERMINATED, } private final Reason reason; + public CodeDownloadException(String message) { +super(message); +this.reason = Reason.TERMINATED; + } + public CodeDownloadException(String message, Reason reason) { super(message); this.reason = reason; } - + public Reason getReason() { return reason; } === --- /trunk/user/src/com/google/gwt/core/client/impl/CrossSiteIframeLoadingStrategy.java Mon Mar 21 12:22:19 2011 +++ /trunk/user/src/com/google/gwt/core/client/impl/CrossSiteIframeLoadingStrategy.java Fri Apr 15 07:23:44 2011 @@ -16,7 +16,6 @@ package com.google.gwt.core.client.impl; -import com.google.gwt.core.client.CodeDownloadException; import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.JavaScriptObject; import com.google.gwt.core.client.impl.AsyncFragmentLoader.LoadTerminatedHandler; @@ -25,14 +24,6 @@ /** * Load runAsync code using a script tag. Intended for use with the * {@link com.google.gwt.core.linker.CrossSiteIframeLinker}. - * - * p - * The linker wraps its selection script code with a function refered to by - * code__gwtModuleFunction/code. On that function is a property - * codeinstallCode/code that can be invoked to eval more code in a scope - * nested somewhere within that function. The loaded script for fragment 123 is - * expected to invoke code__gwtModuleFunction.runAsyncCallback123/code - * as the final thing it does. */ public class CrossSiteIframeLoadingStrategy implements LoadingStrategy { /** @@ -57,10 +48,6 @@ this[x] = y; }-*/; } - - private static final RuntimeException LoadTerminated = - new CodeDownloadException(Code download terminated, -CodeDownloadException.Reason.TERMINATED); /** * Clear callbacks on script objects. This is important on IE 6 and 7 to @@ -73,13 +60,6 @@ script.onerror = script.onload = script.onreadystatechange = nop; }-*/; - /** - * Clear the success callback for fragment codefragment/code. - */ - private static native void clearOnSuccess(int fragment) /*-{ -delete __gwtModuleFunction['runAsyncCallback'+fragment]; - }-*/; - private static native JavaScriptObject createScriptTag(String url) /*-{ var head = document.getElementsByTagName('head').item(0); var script = document.createElement('script'); @@ -97,33 +77,43 @@ LoadTerminatedHandler loadFinishedHandler) /*-{ return function(exception) { if (tag.parentNode == null) { - // onSuccess or onFailure must have already been called. + // This function must have already been called. return; } var head = document.getElementsByTagName('head').item(0); - @com.google.gwt.core.client.impl.CrossSiteIframeLoadingStrategy::clearOnSuccess(*)(fragment); @com.google.gwt.core.client.impl.CrossSiteIframeLoadingStrategy::clearCallbacks(*)(tag); head.removeChild(tag); + // It seems unintuitive to call the error function every time, but + // it appears that AsyncFragmentLoader::fragmentHasLoaded (which is + // called by each fragment) will set the fragmentLoading variable to + // -1 when the code in this fragment executes, so this + // loadTerminated call will fail the (fragmentLoading == fragment) check + // and will immediately exit, so no errors are actually fired. function callLoadTerminated() { loadfinishedhandl...@com.google.gwt.core.client.impl.AsyncFragmentLoader.LoadTerminatedHandler::loadTerminated(*)(exception); } $entry(callLoadTerminated)(); } }-*/; - + private static native void setOnTerminated(JavaScriptObject script, JavaScriptObject callback) /*-{ -var exception = @com.google.gwt.core.client.impl.CrossSiteIframeLoadingStrategy::LoadTerminated; script.onerror = function() { - callback(exception); + var error = Code download terminated, onerror
[gwt-contrib] Comment on ScottSoulBinderDesignDoc in google-web-toolkit
Comment by zun...@google.com: Above code does not follow code style guidelines. Please add a space between interface name and { For more information: http://code.google.com/p/google-web-toolkit/wiki/ScottSoulBinderDesignDoc -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10005 committed - Fixing a bug in Image where IE throws a native JavaScript exception if...
Revision: 10005 Author: jlaba...@google.com Date: Fri Apr 15 08:30:31 2011 Log: Fixing a bug in Image where IE throws a native JavaScript exception if an image is attached and detached immediately. The problem occurs when we try to dispatch a synthetic load event on an unattached element, which IE doesn't like. Now, if we detect that the widget is detached, we mark an expando so that we trigger the event the next time the image is attached. Also, I fixed a bug where we were firing multiple load events after multiple synchronous changes to a clipped state when we should only fire one load event. The test cases were incorrectly testing that we received multiple events, but all four load events would fire AFTER the final synchronous change, which is not useful, and contradictary to how load events are fired if you change the src of an img multiple times in a single event loop. Review at http://gwt-code-reviews.appspot.com/1421801 Review by: p...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=10005 Modified: /trunk/user/src/com/google/gwt/user/client/ui/Image.java /trunk/user/test/com/google/gwt/user/client/ui/ImageTest.java === --- /trunk/user/src/com/google/gwt/user/client/ui/Image.java Tue Apr 5 08:03:17 2011 +++ /trunk/user/src/com/google/gwt/user/client/ui/Image.java Fri Apr 15 08:30:31 2011 @@ -16,6 +16,8 @@ package com.google.gwt.user.client.ui; import com.google.gwt.core.client.GWT; +import com.google.gwt.core.client.Scheduler; +import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.google.gwt.dom.client.Document; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.ImageElement; @@ -72,8 +74,6 @@ import com.google.gwt.event.dom.client.TouchStartHandler; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.resources.client.ImageResource; -import com.google.gwt.user.client.Command; -import com.google.gwt.user.client.DeferredCommand; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.impl.ClippedImageImpl; @@ -137,6 +137,7 @@ private int height = 0; private int left = 0; +private boolean pendingNativeLoadEvent = true; private int top = 0; private String url = null; private int width = 0; @@ -184,6 +185,13 @@ public int getWidth(Image image) { return width; } + +@Override +public void onLoadEvent(Image image) { + // A load event has fired. + pendingNativeLoadEvent = false; + super.onLoadEvent(image); +} @Override public void setUrl(Image image, String url) { @@ -194,42 +202,40 @@ } @Override -public void setUrlAndVisibleRect(Image image, String url, int left, -int top, int width, int height) { - if (!this.url.equals(url) || this.left != left || this.top != top - || this.width != width || this.height != height) { - -this.url = url; -this.left = left; -this.top = top; -this.width = width; -this.height = height; - -impl.adjust(image.getElement(), url, left, top, width, height); -fireSyntheticLoadEvent(image); - } -} - -@Override -public void setVisibleRect(Image image, int left, int top, int width, +public void setUrlAndVisibleRect(Image image, String url, int left, int top, int width, int height) { /* * In the event that the clipping rectangle has not changed, we want to * skip all of the work required with a getImpl().adjust, and we do not * want to fire a load event. */ - if (this.left != left || this.top != top || this.width != width + if (!this.url.equals(url) || this.left != left || this.top != top || this.width != width || this.height != height) { +this.url = url; this.left = left; this.top = top; this.width = width; this.height = height; impl.adjust(image.getElement(), url, left, top, width, height); -fireSyntheticLoadEvent(image); + +/* + * The native load event hasn't fired yet, so we don't need to + * synthesize an event. If we did synthesize an event, we would get two + * load events. + */ +if (!pendingNativeLoadEvent) { + fireSyntheticLoadEvent(image); +} } } + +@Override +public void setVisibleRect(Image image, int left, int top, int width, +int height) { + setUrlAndVisibleRect(image, url, left, top, width, height); +} /* This method is used only by unit tests */ @Override @@ -244,6 +250,11 @@ */ private abstract static class State { +/** + * The pending command to create a synthetic event. + */ +private ScheduledCommand syntheticEventCommand = null; + public abstract int getHeight(Image image);
[gwt-contrib] Re: Comment on ScottSoulBinderDesignDoc in google-web-toolkit
Comment by t.broyer: Joel's soul is the most cross-browser compatible solution, but does it speak native HTML5 too? if not, can it (and, eventually, will it) be updated? http://blogs.msdn.com/b/ie/archive/2011/04/12/native-html5-first-ie10-platform-preview-available-for-download.aspx For more information: http://code.google.com/p/google-web-toolkit/wiki/ScottSoulBinderDesignDoc -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r10006 committed - Edited wiki page TroubleshootingOOPHM through web user interface.
Revision: 10006 Author: fre...@google.com Date: Fri Apr 15 15:09:20 2011 Log: Edited wiki page TroubleshootingOOPHM through web user interface. http://code.google.com/p/google-web-toolkit/source/detail?r=10006 Modified: /wiki/TroubleshootingOOPHM.wiki === --- /wiki/TroubleshootingOOPHM.wiki Fri Jan 21 13:24:30 2011 +++ /wiki/TroubleshootingOOPHM.wiki Fri Apr 15 15:09:20 2011 @@ -3,11 +3,11 @@ ==(Chrome only) Do you see a Gray GWT Toolbox in your omnibar?== -The chrome plugin can't ask for permission like the Safari or Firefox plugins. However, the GWT toolbox will appear in the omnibar whenever you try to use devmode, and a gray toolbox indicates you have a permissions issue. You can click on the gray toolbox to jump to the configuration page and add your host to the whitelist. If your permissions are all in order, it will turn red. +The Chrome GWT plugin can't ask for permission like the Safari or Firefox GWT plugins. However, the GWT toolbox will appear in the omnibar whenever you try to use Development Mode. A gray toolbox icon indicates you have a permissions issue. You can click on the gray toolbox to jump to the configuration page and add your host to the whitelist. If your permissions are all in order, the toolbox icon will turn red. ==Are you trying cross-machine debugging?== -You need to supply -bindAddress 0.0.0.0 (or a particular real address) to get the code server to bind on all addresses, rather than just localhost. +You need to supply `-bindAddress 0.0.0.0` (or a particular real address) to get the code server to bind on all addresses, rather than just localhost. ==Did you have a compile error?== -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9992 committed - Validation serializers should extend CustomSerializer...
Revision: 9992 Author: ncha...@google.com Date: Thu Apr 14 06:53:21 2011 Log: Validation serializers should extend CustomSerializer Review at http://gwt-code-reviews.appspot.com/1415803 Review by: rchan...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9992 Modified: /trunk/user/src/javax/validation/ConstraintViolationException_CustomFieldSerializer.java /trunk/user/src/org/hibernate/validator/engine/ConstraintViolationImpl_CustomFieldSerializer.java /trunk/user/src/org/hibernate/validator/engine/PathImpl_CustomFieldSerializer.java === --- /trunk/user/src/javax/validation/ConstraintViolationException_CustomFieldSerializer.java Fri Oct 22 08:52:03 2010 +++ /trunk/user/src/javax/validation/ConstraintViolationException_CustomFieldSerializer.java Thu Apr 14 06:53:21 2011 @@ -1,12 +1,12 @@ /* * Copyright 2010 Google Inc. - * + * * Licensed under the Apache License, Version 2.0 (the License); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -15,6 +15,7 @@ */ package javax.validation; +import com.google.gwt.user.client.rpc.CustomFieldSerializer; import com.google.gwt.user.client.rpc.SerializationException; import com.google.gwt.user.client.rpc.SerializationStreamReader; import com.google.gwt.user.client.rpc.SerializationStreamWriter; @@ -24,19 +25,21 @@ /** * Custom Serializer for {@link ConstraintViolationException}. */ -public class ConstraintViolationException_CustomFieldSerializer { - +public class ConstraintViolationException_CustomFieldSerializer extends +CustomFieldSerializerConstraintViolationException { + + @SuppressWarnings(unused) public static void deserialize(SerializationStreamReader streamReader, ConstraintViolationException instance) throws SerializationException { // no fields } public static ConstraintViolationException instantiate( - SerializationStreamReader streamReader) - throws SerializationException { + SerializationStreamReader streamReader) throws SerializationException { String message = streamReader.readString(); @SuppressWarnings(unchecked) -SetConstraintViolation? set = (SetConstraintViolation?) streamReader.readObject(); +SetConstraintViolation? set = (SetConstraintViolation?) streamReader +.readObject(); return new ConstraintViolationException(message, set); } @@ -45,4 +48,27 @@ streamWriter.writeString(instance.getMessage()); streamWriter.writeObject(instance.getConstraintViolations()); } -} + + @Override + public void deserializeInstance(SerializationStreamReader streamReader, + ConstraintViolationException instance) throws SerializationException { +deserialize(streamReader, instance); + } + + @Override + public boolean hasCustomInstantiateInstance() { +return true; + } + + @Override + public ConstraintViolationException instantiateInstance( + SerializationStreamReader streamReader) throws SerializationException { +return instantiate(streamReader); + } + + @Override + public void serializeInstance(SerializationStreamWriter streamWriter, + ConstraintViolationException instance) throws SerializationException { +serialize(streamWriter, instance); + } +} === --- /trunk/user/src/org/hibernate/validator/engine/ConstraintViolationImpl_CustomFieldSerializer.java Fri Oct 22 08:52:03 2010 +++ /trunk/user/src/org/hibernate/validator/engine/ConstraintViolationImpl_CustomFieldSerializer.java Thu Apr 14 06:53:21 2011 @@ -15,6 +15,7 @@ */ package org.hibernate.validator.engine; +import com.google.gwt.user.client.rpc.CustomFieldSerializer; import com.google.gwt.user.client.rpc.SerializationException; import com.google.gwt.user.client.rpc.SerializationStreamReader; import com.google.gwt.user.client.rpc.SerializationStreamWriter; @@ -27,8 +28,11 @@ /** * Custom Serializer for {@link ConstraintViolationImpl}. */ -public class ConstraintViolationImpl_CustomFieldSerializer { - +@SuppressWarnings(rawtypes) +public class ConstraintViolationImpl_CustomFieldSerializer extends +CustomFieldSerializerConstraintViolationImpl { + + @SuppressWarnings(unused) public static void deserialize(SerializationStreamReader streamReader, ConstraintViolationImpl instance) throws SerializationException { // no fields @@ -78,4 +82,27 @@ // streamWriter.writeObject(instance.getConstraintDescriptor()); // ElementType } -} + + @Override + public void deserializeInstance(SerializationStreamReader streamReader, +
[gwt-contrib] [google-web-toolkit] r9993 committed - Users found that the error spam reduction hid too many errors. This c...
Revision: 9993 Author: zun...@google.com Date: Thu Apr 14 07:13:39 2011 Log: Users found that the error spam reduction hid too many errors. This change makes the error spam reduction take into account inner classes and uses the code dependencies instead of just the API dependencies. Review at http://gwt-code-reviews.appspot.com/1416801 http://code.google.com/p/google-web-toolkit/source/detail?r=9993 Modified: /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java === --- /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java Tue Apr 5 03:08:39 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java Thu Apr 14 07:13:39 2011 @@ -65,17 +65,11 @@ URL sourceURL = Util.findSourceInClassPath(cl, missingType); if (sourceURL != null) { + Messages.HINT_PRIOR_COMPILER_ERRORS.log(logger, null); if (missingType.indexOf(.client.) != -1) { -Messages.HINT_PRIOR_COMPILER_ERRORS.log(logger, null); Messages.HINT_CHECK_MODULE_INHERITANCE.log(logger, null); } else { -// Give the best possible hint here. -// -if (Util.findSourceInClassPath(cl, missingType) == null) { - Messages.HINT_CHECK_MODULE_NONCLIENT_SOURCE_DECL.log(logger, null); -} else { - Messages.HINT_PRIOR_COMPILER_ERRORS.log(logger, null); -} +Messages.HINT_CHECK_MODULE_NONCLIENT_SOURCE_DECL.log(logger, null); } } else if (!missingType.equals(java.lang.Object)) { Messages.HINT_CHECK_TYPENAME.log(logger, missingType, null); @@ -195,22 +189,26 @@ return false; } TreeLogger branch = -CompilationProblemReporter.reportErrors(logger, unit.getProblems(), unit -.getResourceLocation(), unit.isError(), new SourceFetcher() { - - public String getSource() { -return unit.getSource(); - } - -}, unit.getTypeName(), suppressErrors); +CompilationProblemReporter.reportErrors(logger, unit.getProblems(), +unit.getResourceLocation(), unit.isError(), new SourceFetcher() { + + public String getSource() { +return unit.getSource(); + } + +}, unit.getTypeName(), suppressErrors); return branch != null; } - private static void addUnitToVisit(MapString, CompilationUnit unitMap, String typeName, - QueueCompilationUnit toVisit) { -CompilationUnit found = unitMap.get(typeName); + private static void addUnitToVisit(MapString, CompiledClass classMap, String typeName, + QueueCompilationUnit toVisit, SetCompilationUnit visited) { +CompiledClass found = classMap.get(typeName); if (found != null) { - toVisit.add(found); + CompilationUnit unit = found.getUnit(); + if (!visited.contains(unit)) { +toVisit.add(unit); +visited.add(unit); + } } } @@ -235,8 +233,7 @@ CompilationState compilationState) { final SetCompilationUnit visited = new HashSetCompilationUnit(); final QueueCompilationUnit toVisit = new LinkedListCompilationUnit(); - -MapString, CompilationUnit unitMap = compilationState.unitMap; +MapString, CompiledClass classMap = compilationState.getClassFileMapBySource(); /* * Traverses CompilationUnits enqueued in toVisit(), calling {@link @@ -244,21 +241,17 @@ * CompilationUnit is visited only once, and only if it is reachable via the * {@link Dependencies} graph. */ -addUnitToVisit(unitMap, missingType, toVisit); +addUnitToVisit(classMap, missingType, toVisit, visited); while (!toVisit.isEmpty()) { CompilationUnit unit = toVisit.remove(); - if (visited.contains(unit)) { -continue; - } - visited.add(unit); CompilationProblemReporter.reportErrors(logger, unit, false); - Dependencies deps = unit.getDependencies(); - for (String ref : deps.getApiRefs()) { -addUnitToVisit(unitMap, ref, toVisit); + for (String apiRef : unit.getDependencies().getApiRefs()) { +addUnitToVisit(classMap, apiRef, toVisit, visited); } } +logger.log(TreeLogger.DEBUG, Checked + visited.size() + dependencies for errors.); } /** -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9994 committed - Include Custom Field Serializers in the HibernateValidator module....
Revision: 9994 Author: ncha...@google.com Date: Thu Apr 14 08:22:41 2011 Log: Include Custom Field Serializers in the HibernateValidator module. Review at http://gwt-code-reviews.appspot.com/1416803 Review by: rchan...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9994 Modified: /trunk/user/src/org/hibernate/validator/HibernateValidator.gwt.xml === --- /trunk/user/src/org/hibernate/validator/HibernateValidator.gwt.xml Mon Dec 20 11:43:41 2010 +++ /trunk/user/src/org/hibernate/validator/HibernateValidator.gwt.xml Thu Apr 14 08:22:41 2011 @@ -10,9 +10,9 @@ exclude name=super/ / /source source path=engine -include name=ConstraintViolationImpl.java/ +include name=ConstraintViolationImpl*.java/ include name=NodeImpl.java/ -include name=PathImpl.java/ +include name=PathImpl*.java/ /source source path= include name=ValidationMessages.java/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9995 committed - removes extra source path entry from GWT datetimefmtcreator eclipse pr...
Revision: 9995 Author: gwt.mirror...@gmail.com Date: Thu Apr 14 15:47:12 2011 Log: removes extra source path entry from GWT datetimefmtcreator eclipse project Review at http://gwt-code-reviews.appspot.com/1406803 http://code.google.com/p/google-web-toolkit/source/detail?r=9995 Modified: /trunk/eclipse/tools/datetimefmtcreator/.classpath === --- /trunk/eclipse/tools/datetimefmtcreator/.classpath Mon Jun 14 12:28:42 2010 +++ /trunk/eclipse/tools/datetimefmtcreator/.classpath Thu Apr 14 15:47:12 2011 @@ -1,7 +1,6 @@ ?xml version=1.0 encoding=UTF-8? classpath classpathentry kind=src path=core/src/ - classpathentry kind=src path=core/test/ classpathentry kind=con path=org.eclipse.jdt.launching.JRE_CONTAINER/ classpathentry combineaccessrules=false exported=true kind=src path=/gwt-user/ classpathentry kind=var path=GWT_TOOLS/lib/icu4j/icu4j-4_4_1.jar/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Comment on CssResource in google-web-toolkit
Comment by t.broyer: See http://code.google.com/p/google-web-toolkit/issues/detail?id=4877#c2 for an example of literal() with moz-linear-gradient. For more information: http://code.google.com/p/google-web-toolkit/wiki/CssResource -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9985 committed - Resubmtiting r9970....
Revision: 9985 Author: jlaba...@google.com Date: Wed Apr 13 08:22:34 2011 Log: Resubmtiting r9970. Review at http://gwt-code-reviews.appspot.com/1355805/ Review by: fabb...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9985 Added: /trunk/user/src/com/google/gwt/animation/client/AnimationImpl.java /trunk/user/src/com/google/gwt/animation/client/AnimationImplMozAnimTiming.java /trunk/user/src/com/google/gwt/animation/client/AnimationImplTimer.java /trunk/user/src/com/google/gwt/animation/client/AnimationImplWebkitAnimTiming.java Modified: /trunk/user/src/com/google/gwt/animation/Animation.gwt.xml /trunk/user/src/com/google/gwt/animation/client/Animation.java /trunk/user/src/com/google/gwt/layout/client/Layout.java /trunk/user/src/com/google/gwt/user/cellview/client/CellBrowser.java /trunk/user/src/com/google/gwt/user/client/ui/DeckPanel.java === --- /dev/null +++ /trunk/user/src/com/google/gwt/animation/client/AnimationImpl.java Wed Apr 13 08:22:34 2011 @@ -0,0 +1,45 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.animation.client; + +import com.google.gwt.dom.client.Element; + +/** + * Base class for animation implementations. + */ +abstract class AnimationImpl { + + /** + * Cancel the animation. + */ + public abstract void cancel(Animation animation); + + /** + * Run the animation with an optional bounding element. + */ + public abstract void run(Animation animation, Element element); + + /** + * Update the {@link Animation}. + * + * @param animation the {@link Animation} + * @param curTime the current time + * @return true if the animation is complete, false if still running + */ + protected final boolean updateAnimation(Animation animation, double curTime) { +return animation.isRunning() animation.update(curTime); + } +} === --- /dev/null +++ /trunk/user/src/com/google/gwt/animation/client/AnimationImplMozAnimTiming.java Wed Apr 13 08:22:34 2011 @@ -0,0 +1,56 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.animation.client; + +import com.google.gwt.dom.client.Element; + +/** + * Implementation using codemozRequestAnimationFrame/code. + * + * @see a href=https://developer.mozilla.org/en/DOM/window.mozRequestAnimationFrame; + * Documentation on the MDN/a + */ +class AnimationImplMozAnimTiming extends AnimationImpl { + + private int handle; + + @Override + public void cancel(Animation animation) { +handle++; + } + + @Override + public void run(Animation animation, Element element) { +handle++; +nativeRun(animation); + } + + private native void nativeRun(Animation animation) /*-{ +var self = this; +var handle = th...@com.google.gwt.animation.client.AnimationImplMozAnimTiming::handle; +var callback = $entry(function(time) { + if (handle != se...@com.google.gwt.animation.client.AnimationImplMozAnimTiming::handle) { +return; // cancelled + } + var complete = se...@com.google.gwt.animation.client.AnimationImpl::updateAnimation(Lcom/google/gwt/animation/client/Animation;D)(animation, time); + if (!complete) { +$wnd.mozRequestAnimationFrame(callback); + } +}); + +$wnd.mozRequestAnimationFrame(callback); + }-*/; +} === --- /dev/null +++ /trunk/user/src/com/google/gwt/animation/client/AnimationImplTimer.java Wed Apr 13 08:22:34 2011 @@ -0,0 +1,87 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by
[gwt-contrib] [google-web-toolkit] r9986 committed - Reverting r9985 due to build break caused by use of soft permutation....
Revision: 9986 Author: gwt.mirror...@gmail.com Date: Wed Apr 13 09:22:27 2011 Log: Reverting r9985 due to build break caused by use of soft permutation. Review at http://gwt-code-reviews.appspot.com/1414802 Review by: fabb...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9986 Deleted: /trunk/user/src/com/google/gwt/animation/client/AnimationImpl.java /trunk/user/src/com/google/gwt/animation/client/AnimationImplMozAnimTiming.java /trunk/user/src/com/google/gwt/animation/client/AnimationImplTimer.java /trunk/user/src/com/google/gwt/animation/client/AnimationImplWebkitAnimTiming.java Modified: /trunk/user/src/com/google/gwt/animation/Animation.gwt.xml /trunk/user/src/com/google/gwt/animation/client/Animation.java /trunk/user/src/com/google/gwt/layout/client/Layout.java /trunk/user/src/com/google/gwt/user/cellview/client/CellBrowser.java /trunk/user/src/com/google/gwt/user/client/ui/DeckPanel.java === --- /trunk/user/src/com/google/gwt/animation/client/AnimationImpl.java Wed Apr 13 08:22:34 2011 +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the License); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.animation.client; - -import com.google.gwt.dom.client.Element; - -/** - * Base class for animation implementations. - */ -abstract class AnimationImpl { - - /** - * Cancel the animation. - */ - public abstract void cancel(Animation animation); - - /** - * Run the animation with an optional bounding element. - */ - public abstract void run(Animation animation, Element element); - - /** - * Update the {@link Animation}. - * - * @param animation the {@link Animation} - * @param curTime the current time - * @return true if the animation is complete, false if still running - */ - protected final boolean updateAnimation(Animation animation, double curTime) { -return animation.isRunning() animation.update(curTime); - } -} === --- /trunk/user/src/com/google/gwt/animation/client/AnimationImplMozAnimTiming.java Wed Apr 13 08:22:34 2011 +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the License); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.animation.client; - -import com.google.gwt.dom.client.Element; - -/** - * Implementation using codemozRequestAnimationFrame/code. - * - * @see a href=https://developer.mozilla.org/en/DOM/window.mozRequestAnimationFrame; - * Documentation on the MDN/a - */ -class AnimationImplMozAnimTiming extends AnimationImpl { - - private int handle; - - @Override - public void cancel(Animation animation) { -handle++; - } - - @Override - public void run(Animation animation, Element element) { -handle++; -nativeRun(animation); - } - - private native void nativeRun(Animation animation) /*-{ -var self = this; -var handle = th...@com.google.gwt.animation.client.AnimationImplMozAnimTiming::handle; -var callback = $entry(function(time) { - if (handle != se...@com.google.gwt.animation.client.AnimationImplMozAnimTiming::handle) { -return; // cancelled - } - var complete = se...@com.google.gwt.animation.client.AnimationImpl::updateAnimation(Lcom/google/gwt/animation/client/Animation;D)(animation, time); - if (!complete) { -$wnd.mozRequestAnimationFrame(callback); - } -}); - -$wnd.mozRequestAnimationFrame(callback); - }-*/; -} === --- /trunk/user/src/com/google/gwt/animation/client/AnimationImplTimer.java Wed Apr 13 08:22:34 2011 +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the License); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - *
[gwt-contrib] [google-web-toolkit] r9987 committed - Allows the gwt.persistentunitcache property to accept a boolean...
Revision: 9987 Author: zun...@google.com Date: Wed Apr 13 10:08:39 2011 Log: Allows the gwt.persistentunitcache property to accept a boolean argument (case insenstivive true) to turn on the cache. Any value other than a blank turns the cache off. Review at http://gwt-code-reviews.appspot.com/1415802 Review by: to...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9987 Modified: /trunk/dev/core/src/com/google/gwt/dev/javac/UnitCacheFactory.java === --- /trunk/dev/core/src/com/google/gwt/dev/javac/UnitCacheFactory.java Mon Mar 28 11:28:56 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/javac/UnitCacheFactory.java Wed Apr 13 10:08:39 2011 @@ -28,8 +28,10 @@ /** * The API must be enabled explicitly for persistent caching to be live. */ - private static final boolean usePersistent = System.getProperties().containsKey( - gwt.persistentunitcache); + private static final String configPropertyValue = System.getProperty(gwt.persistentunitcache, + false); + private static final boolean usePersistent = configPropertyValue.length() == 0 + || Boolean.parseBoolean(configPropertyValue); private static UnitCache instance = null; /** -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9988 committed - Improving TouchScroller to allow native document level scrolling when ...
Revision: 9988 Author: jlaba...@google.com Date: Wed Apr 13 10:30:02 2011 Log: Improving TouchScroller to allow native document level scrolling when appropriate. If the scrollable widget is scrolled as far as it can go in a direction, and the user tries to scroll in that direction, then we defer to document level scrolling. For example, in the Showcase app (which is not a mobile specific app), if you scroll the menu bar to the bottom, then scrolling it again allows the document to scroll down, revealing the rest of the page. It isn't perfect because we cannot disable native scrolling in one direction (as in, allow native horizontal but disable native vertical), but its a drastic improvement and make Showcase usable on mobile. This change also fixes a bug in TouchScroller where it always busts the next click, even if Momentum has finished. The next click should only be busted if the user interupts momentum to stop it. Also, we cancel momentum on WindowResize (and by extension, orientation change) to account for the fact that resizing the scrollable widget will cause the contents to reflow, and the old scroll positions become stale. Review at http://gwt-code-reviews.appspot.com/1410803 Review by: p...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9988 Modified: /trunk/user/src/com/google/gwt/touch/client/TouchScroller.java /trunk/user/test/com/google/gwt/touch/client/TouchScrollTest.java === --- /trunk/user/src/com/google/gwt/touch/client/TouchScroller.java Mon Mar 21 12:22:19 2011 +++ /trunk/user/src/com/google/gwt/touch/client/TouchScroller.java Wed Apr 13 10:30:02 2011 @@ -30,11 +30,14 @@ import com.google.gwt.event.dom.client.TouchMoveHandler; import com.google.gwt.event.dom.client.TouchStartEvent; import com.google.gwt.event.dom.client.TouchStartHandler; +import com.google.gwt.event.logical.shared.ResizeEvent; +import com.google.gwt.event.logical.shared.ResizeHandler; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.touch.client.Momentum.State; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.Event.NativePreviewEvent; import com.google.gwt.user.client.Event.NativePreviewHandler; +import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.HasScrolling; import java.util.ArrayList; @@ -99,6 +102,7 @@ private final Point initialPosition = getWidgetScrollPosition(); private int lastElapsedMillis = 0; private State state; +private HandlerRegistration windowResizeHandler; /** * Construct a {@link MomentumCommand}. @@ -107,6 +111,18 @@ */ public MomentumCommand(Point endVelocity) { state = momentum.createState(initialPosition, endVelocity); + + /** + * If the user resizes the window (which happens on orientation change of + * a mobile device), cancel the momentum. The scrollable widget may be + * resized, which will cause its content to reflow and invalidates the + * current scrolling position. + */ + windowResizeHandler = Window.addResizeHandler(new ResizeHandler() { +public void onResize(ResizeEvent event) { + finish(); +} + }); } public boolean execute() { @@ -115,6 +131,7 @@ * disabled. */ if (this != momentumCommand) { +finish(); return false; } @@ -127,9 +144,9 @@ // Calculate the new state. boolean notDone = momentum.updateState(state); - // Momementum is finished, so the user is free to click. + // Momentum is finished, so the user is free to click. if (!notDone) { -setBustNextClick(false); +finish(); } /* @@ -139,6 +156,20 @@ setWidgetScrollPosition(state.getPosition()); return notDone; } + +/** + * Finish and cleanup this momentum command. + */ +private void finish() { + if (windowResizeHandler != null) { +windowResizeHandler.removeHandler(); +windowResizeHandler = null; + } + if (this == momentumCommand) { +momentumCommand = null; +setBustNextClick(false); + } +} } /** @@ -492,9 +523,6 @@ if (!touching) { return; } - -// Prevent native scrolling. -event.preventDefault(); // Check if we should start dragging. Touch touch = getTouchFromEvent(event); @@ -506,11 +534,60 @@ double absDiffX = Math.abs(diff.getX()); double absDiffY = Math.abs(diff.getY()); if (absDiffX MIN_TRACKING_FOR_DRAG || absDiffY MIN_TRACKING_FOR_DRAG) { +/* + * Check if we should defer to native scrolling. If the scrollable + * widget is already scrolled as far as it will go, then we don't want + * to prevent scrolling of the document. + * + * We cannot prevent native scrolling in only
[gwt-contrib] [google-web-toolkit] r9989 committed - Cherry picking r9988 into releases/2.3.
Revision: 9989 Author: jlaba...@google.com Date: Wed Apr 13 11:00:31 2011 Log: Cherry picking r9988 into releases/2.3. http://code.google.com/p/google-web-toolkit/source/detail?r=9989 Modified: /releases/2.3/user/src/com/google/gwt/touch/client/TouchScroller.java /releases/2.3/user/test/com/google/gwt/touch/client/TouchScrollTest.java === --- /releases/2.3/user/src/com/google/gwt/touch/client/TouchScroller.java Tue Mar 22 11:44:40 2011 +++ /releases/2.3/user/src/com/google/gwt/touch/client/TouchScroller.java Wed Apr 13 11:00:31 2011 @@ -30,11 +30,14 @@ import com.google.gwt.event.dom.client.TouchMoveHandler; import com.google.gwt.event.dom.client.TouchStartEvent; import com.google.gwt.event.dom.client.TouchStartHandler; +import com.google.gwt.event.logical.shared.ResizeEvent; +import com.google.gwt.event.logical.shared.ResizeHandler; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.touch.client.Momentum.State; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.Event.NativePreviewEvent; import com.google.gwt.user.client.Event.NativePreviewHandler; +import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.HasScrolling; import java.util.ArrayList; @@ -99,6 +102,7 @@ private final Point initialPosition = getWidgetScrollPosition(); private int lastElapsedMillis = 0; private State state; +private HandlerRegistration windowResizeHandler; /** * Construct a {@link MomentumCommand}. @@ -107,6 +111,18 @@ */ public MomentumCommand(Point endVelocity) { state = momentum.createState(initialPosition, endVelocity); + + /** + * If the user resizes the window (which happens on orientation change of + * a mobile device), cancel the momentum. The scrollable widget may be + * resized, which will cause its content to reflow and invalidates the + * current scrolling position. + */ + windowResizeHandler = Window.addResizeHandler(new ResizeHandler() { +public void onResize(ResizeEvent event) { + finish(); +} + }); } public boolean execute() { @@ -115,6 +131,7 @@ * disabled. */ if (this != momentumCommand) { +finish(); return false; } @@ -127,9 +144,9 @@ // Calculate the new state. boolean notDone = momentum.updateState(state); - // Momementum is finished, so the user is free to click. + // Momentum is finished, so the user is free to click. if (!notDone) { -setBustNextClick(false); +finish(); } /* @@ -139,6 +156,20 @@ setWidgetScrollPosition(state.getPosition()); return notDone; } + +/** + * Finish and cleanup this momentum command. + */ +private void finish() { + if (windowResizeHandler != null) { +windowResizeHandler.removeHandler(); +windowResizeHandler = null; + } + if (this == momentumCommand) { +momentumCommand = null; +setBustNextClick(false); + } +} } /** @@ -493,9 +524,6 @@ if (!touching) { return; } - -// Prevent native scrolling. -event.preventDefault(); // Check if we should start dragging. Touch touch = getTouchFromEvent(event); @@ -507,11 +535,60 @@ double absDiffX = Math.abs(diff.getX()); double absDiffY = Math.abs(diff.getY()); if (absDiffX MIN_TRACKING_FOR_DRAG || absDiffY MIN_TRACKING_FOR_DRAG) { +/* + * Check if we should defer to native scrolling. If the scrollable + * widget is already scrolled as far as it will go, then we don't want + * to prevent scrolling of the document. + * + * We cannot prevent native scrolling in only one direction (ie. we + * cannot allow native horizontal scrolling but prevent native vertical + * scrolling), so we make a best guess based on the direction of the + * drag. + */ +if (absDiffX absDiffY) { + /* + * The user scrolled primarily in the horizontal direction, so check + * if we should defer left/right scrolling to the document. + */ + int hPosition = widget.getHorizontalScrollPosition(); + int hMin = widget.getMinimumHorizontalScrollPosition(); + int hMax = widget.getMaximumHorizontalScrollPosition(); + if (diff.getX() 0 hMax = hPosition) { +// Already scrolled to the right. +cancelAll(); +return; + } else if (diff.getX() 0 hMin = hPosition) { +// Already scrolled to the left. +cancelAll(); +return; + } +} else { + /* + * The user scrolled primarily in the vertical direction, so check if + * we should defer up/down scrolling to the
[gwt-contrib] [google-web-toolkit] r9990 committed - update EntityProxyChange javadoc...
Revision: 9990 Author: rj...@google.com Date: Wed Apr 13 14:35:14 2011 Log: update EntityProxyChange javadoc Review at http://gwt-code-reviews.appspot.com/1414801 Review by: robertvaw...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9990 Modified: /trunk/user/src/com/google/web/bindery/requestfactory/shared/EntityProxyChange.java /trunk/user/src/com/google/web/bindery/requestfactory/shared/WriteOperation.java === --- /trunk/user/src/com/google/web/bindery/requestfactory/shared/EntityProxyChange.java Tue Apr 5 10:47:39 2011 +++ /trunk/user/src/com/google/web/bindery/requestfactory/shared/EntityProxyChange.java Wed Apr 13 14:35:14 2011 @@ -21,17 +21,19 @@ import com.google.gwt.event.shared.HandlerRegistration; /** - * Abstract base class for an event announcing changes to an - * {@link EntityProxy}. + * Event posted by a {@link RequestFactory} when changes to an entity are + * detected. Provides a {@link WriteOperation} value describing the change, and + * the {@link EntityProxyId} of the entity in question. * p - * Note that this event includes an unpopulated copy of the changed proxy - * mdash; all properties are undefined except it's id. That is, the event - * includes only enough information for receivers to issue requests to get - * themselves fresh copies of the proxy. - * p - * TODO: use ProxyId rather than an empty proxy - * + * EntityProxyChange events are posted with the relevant EntityProxy + * Class as their source, allowing handlers to register for changes only + * of the type they care about via + * {@link #registerForProxyType(EventBus, Class, Handler)}. + * * @param P the type of the proxy + * + * @see RequestFactory#initialize(EventBus) + * @see RequestFactory#find(EntityProxyId) */ public class EntityProxyChangeP extends EntityProxy extends GwtEventEntityProxyChange.HandlerP { === --- /trunk/user/src/com/google/web/bindery/requestfactory/shared/WriteOperation.java Tue Apr 5 10:47:39 2011 +++ /trunk/user/src/com/google/web/bindery/requestfactory/shared/WriteOperation.java Wed Apr 13 14:35:14 2011 @@ -16,15 +16,24 @@ package com.google.web.bindery.requestfactory.shared; /** - * The enum used in {@link EntityProxyChange}. - * ul - * liA PERSIST event is fired after a proxy that was created on the client has - * been persisted on the server. - * liAn UPDATE event is fired whenever a client encounters a proxy for the - * first time, or encounters a proxy whose version number has changed. - * liA DELETE event is fired after a proxy that was deleted on the client is - * deleted on the server as well. - * /ul + * The values returned by {@link EntityProxyChange#getWriteOperation()} to + * describe the type of change being announced. + * + * dl + * dtPERSIST + * ddAn {@link EntityProxy} that was created on the client has been persisted + * on the server + * + * dtUPDATE + * ddAn {@link EntityProxy} has been encountered by the client for the first + * time, or its version value has changed + * + * dtDELETE + * ddThe server has confirmed the success of a client request to delete an + * {@link EntityProxy} + * /dl + * + * @see EntityProxyChange#getWriteOperation() */ public enum WriteOperation { PERSIST(PERSIST), UPDATE(UPDATE), DELETE(DELETE); -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9991 committed - Expose delegate constructor....
Revision: 9991 Author: me...@google.com Date: Wed Apr 13 19:08:53 2011 Log: Expose delegate constructor. Review by: j...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9991 Modified: /trunk/user/src/com/google/gwt/user/server/rpc/AbstractXsrfProtectedServiceServlet.java /trunk/user/src/com/google/gwt/user/server/rpc/XsrfProtectedServiceServlet.java /trunk/user/src/com/google/gwt/user/server/rpc/XsrfTokenServiceServlet.java === --- /trunk/user/src/com/google/gwt/user/server/rpc/AbstractXsrfProtectedServiceServlet.java Wed Feb 23 14:40:04 2011 +++ /trunk/user/src/com/google/gwt/user/server/rpc/AbstractXsrfProtectedServiceServlet.java Wed Apr 13 19:08:53 2011 @@ -41,6 +41,24 @@ */ public abstract class AbstractXsrfProtectedServiceServlet extends RemoteServiceServlet { + + /** + * The default constructor used by service implementations that + * extend this class. The servlet will delegate AJAX requests to + * the appropriate method in the subclass. + */ + public AbstractXsrfProtectedServiceServlet() { +super(); + } + + /** + * The wrapping constructor used by service implementations that are + * separate from this class. The servlet will delegate AJAX + * requests to the appropriate method in the given object. + */ + public AbstractXsrfProtectedServiceServlet(Object delegate) { +super(delegate); + } @Override protected void onAfterRequestDeserialized(RPCRequest rpcRequest) { === --- /trunk/user/src/com/google/gwt/user/server/rpc/XsrfProtectedServiceServlet.java Mon Feb 28 10:45:39 2011 +++ /trunk/user/src/com/google/gwt/user/server/rpc/XsrfProtectedServiceServlet.java Wed Apr 13 19:08:53 2011 @@ -63,6 +63,16 @@ public XsrfProtectedServiceServlet(String sessionCookieName) { this.sessionCookieName = sessionCookieName; } + + public XsrfProtectedServiceServlet(Object delegate) { +this(delegate, null); + } + + public XsrfProtectedServiceServlet(Object delegate, + String sessionCookieName) { +super(delegate); +this.sessionCookieName = sessionCookieName; + } @Override public void init() throws ServletException { === --- /trunk/user/src/com/google/gwt/user/server/rpc/XsrfTokenServiceServlet.java Mon Feb 28 10:45:39 2011 +++ /trunk/user/src/com/google/gwt/user/server/rpc/XsrfTokenServiceServlet.java Wed Apr 13 19:08:53 2011 @@ -94,7 +94,7 @@ * public void onSuccess(XsrfToken result) { * MyRpcServiceAsync rpc = (MyRpcServiceAsync)GWT.create(MyRpcService.class); * ((HasRpcToken) rpc).setRpcToken(result); - * // make XSRF protection RPC calls using + * // make XSRF protected RPC call * rpc.doStuff(new AsyncCallbacklt;Voidgt;() { * // ... * }); -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Comment on TroubleshootingOOPHM in google-web-toolkit
Comment by flavio.e...@gmail.com: Can somebody please update http://code.google.com/webtoolkit/usingeclipse.html with this instructions or a link? Particularly the way to start the application is a little misrepresented there... For more information: http://code.google.com/p/google-web-toolkit/wiki/TroubleshootingOOPHM -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9977 committed - Addresses ClassNotFoundException problems when the data structures ser...
Revision: 9977 Author: zun...@google.com Date: Tue Apr 12 07:43:39 2011 Log: Addresses ClassNotFoundException problems when the data structures serialized in the unit cache log files no longer matches due to changes in GWT. Review at http://gwt-code-reviews.appspot.com/1412801 http://code.google.com/p/google-web-toolkit/source/detail?r=9977 Modified: /trunk/dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java /trunk/dev/core/test/com/google/gwt/dev/javac/PersistentUnitCacheTest.java === --- /trunk/dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java Thu Mar 31 08:40:20 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java Tue Apr 12 07:43:39 2011 @@ -266,7 +266,7 @@ */ static final String UNIT_CACHE_PREFIX = gwt-unitCache; - static final String CACHE_PREFIX = UNIT_CACHE_PREFIX + -; + static final String CACHE_FILE_PREFIX = UNIT_CACHE_PREFIX + -; /** * If there are more than this many files in the cache, clean up the old @@ -310,7 +310,7 @@ long timestamp = System.currentTimeMillis(); do { currentCacheFile = - new File(cacheDirectory, CACHE_PREFIX + String.format(%016X, timestamp++)); + new File(cacheDirectory, CACHE_FILE_PREFIX + String.format(%016X, timestamp++)); } while (currentCacheFile.exists()); // this isn't 100% reliable if multiple processes are in contention @@ -424,7 +424,7 @@ File[] files = cacheDirectory.listFiles(); ListFile cacheFiles = new ArrayListFile(); for (File file : files) { -if (file.getName().startsWith(CACHE_PREFIX)) { +if (file.getName().startsWith(CACHE_FILE_PREFIX)) { cacheFiles.add(file); } } @@ -460,6 +460,7 @@ if (cacheFile.equals(currentCacheFile)) { continue; } + boolean deleteCacheFile = false; try { fis = new FileInputStream(cacheFile); bis = new BufferedInputStream(fis); @@ -487,15 +488,21 @@ } catch (EOFException ex) { // Go on to the next file. } catch (IOException ex) { -logger.log(TreeLogger.WARN, Error reading cache file: + cacheFile.getAbsolutePath(), -ex); +deleteCacheFile = true; +logger.log(TreeLogger.TRACE, Ignoring and deleting cache log ++ cacheFile.getAbsolutePath() + due to read error., ex); } catch (ClassNotFoundException ex) { -logger.log(TreeLogger.ERROR, Error deserializing CompilationUnit in -+ cacheFile.getAbsolutePath(), ex); +deleteCacheFile = true; +logger.log(TreeLogger.TRACE, Ignoring and deleting cache log ++ cacheFile.getAbsolutePath() + due to deserialization error., ex); } finally { Utility.close(inputStream); Utility.close(bis); Utility.close(fis); + } + if (deleteCacheFile) { +cacheFile.delete(); + } else { logger.log(TreeLogger.TRACE, cacheFile.getName() + : Load complete); } } === --- /trunk/dev/core/test/com/google/gwt/dev/javac/PersistentUnitCacheTest.java Thu Mar 31 08:40:20 2011 +++ /trunk/dev/core/test/com/google/gwt/dev/javac/PersistentUnitCacheTest.java Tue Apr 12 07:43:39 2011 @@ -22,13 +22,32 @@ import junit.framework.TestCase; import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; /** * Unit test for {@link PersistentUnitCache}. */ public class PersistentUnitCacheTest extends TestCase { + private static class ThrowsClassNotFoundException implements Serializable { +@SuppressWarnings(unused) +private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { + throw new ClassNotFoundException(); +} + } + + private static class ThrowsIOException implements Serializable { +@SuppressWarnings(unused) +private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { + throw new IOException(); +} + } + File lastCacheDir = null; public void tearDown() { @@ -39,22 +58,17 @@ } /** - * The cache should recursively create the directories it needs. + * When a cache file encounters a serialization error, the logic should assume + * the cache log is stale and remove it. */ - public void testNewDir() throws IOException, UnableToCompleteException { -TreeLogger logger = TreeLogger.NULL; -File baseDir = File.createTempFile(PersistentUnitTest-newDir, ); -assertNotNull(baseDir); -assertTrue(baseDir.exists()); -assertTrue(baseDir.delete()); -File
[gwt-contrib] [google-web-toolkit] r9979 committed - Escape single characters in SafeHtmlBuilder/SafeHtmlUtils (external is...
Revision: 9979 Author: r...@google.com Date: Tue Apr 12 09:34:50 2011 Log: Escape single characters in SafeHtmlBuilder/SafeHtmlUtils (external issue 6222) Review at http://gwt-code-reviews.appspot.com/1413802 http://code.google.com/p/google-web-toolkit/source/detail?r=9979 Modified: /trunk/user/src/com/google/gwt/safehtml/shared/SafeHtmlBuilder.java /trunk/user/src/com/google/gwt/safehtml/shared/SafeHtmlUtils.java /trunk/user/test/com/google/gwt/safehtml/shared/GwtSafeHtmlBuilderTest.java /trunk/user/test/com/google/gwt/safehtml/shared/GwtSafeHtmlUtilsTest.java === --- /trunk/user/src/com/google/gwt/safehtml/shared/SafeHtmlBuilder.java Thu Dec 16 11:33:51 2010 +++ /trunk/user/src/com/google/gwt/safehtml/shared/SafeHtmlBuilder.java Tue Apr 12 09:34:50 2011 @@ -80,9 +80,10 @@ * * @param c the character whose string representation to append * @return a reference to this object + * @see SafeHtmlUtils#htmlEscape(char) */ public SafeHtmlBuilder append(char c) { -sb.append(c); +sb.append(SafeHtmlUtils.htmlEscape(c)); return this; } @@ -147,6 +148,7 @@ * * @param text the string to append * @return a reference to this object + * @see SafeHtmlUtils#htmlEscape(String) */ public SafeHtmlBuilder appendEscaped(String text) { sb.append(SafeHtmlUtils.htmlEscape(text)); @@ -156,10 +158,11 @@ /** * Appends a string consisting of several newline-separated lines after * HTML-escaping it. Newlines in the original string are converted to {@code - * br}. + * br} tags. * * @param text the string to append * @return a reference to this object + * @see SafeHtmlUtils#htmlEscape(String) */ public SafeHtmlBuilder appendEscapedLines(String text) { sb.append(SafeHtmlUtils.htmlEscape(text).replaceAll(\n, br)); === --- /trunk/user/src/com/google/gwt/safehtml/shared/SafeHtmlUtils.java Thu Dec 16 11:33:51 2010 +++ /trunk/user/src/com/google/gwt/safehtml/shared/SafeHtmlUtils.java Tue Apr 12 09:34:50 2011 @@ -37,7 +37,7 @@ private static final RegExp QUOT_RE = RegExp.compile(\, g); /** - * Returns a SafeHtml constructed from a safe string, i.e., without escaping + * Returns a {@link SafeHtml} constructed from a safe string, i.e., without escaping * the string. * * p @@ -85,7 +85,7 @@ * Returns a {@link SafeHtml} containing the escaped string. * * @param s the input String - * @return a SafeHtml instance + * @return a {@link SafeHtml} instance */ public static SafeHtml fromString(String s) { return new SafeHtmlString(htmlEscape(s)); @@ -94,24 +94,59 @@ /** * Returns a {@link SafeHtml} constructed from a trusted string, i.e., without * escaping the string. No checks are performed. The calling code should be - * carefully reviewed to ensure the argument meets the SafeHtml contract. + * carefully reviewed to ensure the argument meets the {@link SafeHtml} contract. * * @param s the input String - * @return a SafeHtml instance + * @return a {@link SafeHtml} instance */ public static SafeHtml fromTrustedString(String s) { return new SafeHtmlString(s); } + + /** + * HTML-escapes a character. HTML meta characters + * will be escaped as follows: + * + * pre + * amp; - amp;amp; + * lt; - amp;lt; + * gt; - amp;gt; + * quot; - amp;quot; + * #39; - amp;#39; + * /pre + * + * @param c the character to be escaped + * @return a string containing either the input character + * or an equivalent HTML Entity Reference + */ + public static String htmlEscape(char c) { +switch (c) { + case '': +return amp;; + case '': +return lt;; + case '': +return gt;; + case '': +return quot;; + case '\'': +return #39;; + default: +return + c; +} + } /** * HTML-escapes a string. * * Note: The following variants of this function were profiled on FF36, * Chrome6, IE8: - * #1) for each case, check indexOf, then use s.replace(regex, string) - * #2) for each case, check indexOf, then use s.replaceAll() - * #3) check if any metachar is present using a regex, then use #1 - * #4) for each case, use s.replace(regex, string) + * ol + * liFor each case, check indexOf, then use s.replace(regex, string)/li + * liFor each case, check indexOf, then use s.replaceAll()/li + * liCheck if any metachar is present using a regex, then use #1/li + * liFor each case, use s.replace(regex, string)/li + * /ol * * #1 was found to be the fastest, and is used below. * === --- /trunk/user/test/com/google/gwt/safehtml/shared/GwtSafeHtmlBuilderTest.java Mon Sep 20 07:10:58 2010 +++ /trunk/user/test/com/google/gwt/safehtml/shared/GwtSafeHtmlBuilderTest.java Tue Apr 12 09:34:50
[gwt-contrib] Re: Comment on CodeSplitting in google-web-toolkit
Comment by mohanam...@gmail.com: I believe GWT Team deserves a lot of credit for their contributions to the AJAX toolset. When we standardized on GWT, my vision/hope was that GWT would emerge as the #1 (top) toolset for AJAX development. Are we there yet? We designed our own frameworks on top of GWT for modular development and dynamic registration at onModuleLoad. But the initial download and the login screen takes about 40 seconds depending on the network bandwidth. Unless we supply some toys to play with, this is not acceptable performance. We have been looking for ways to optimize the initialization. The code spliting feature did sound promising, iniitally. I went through its documentation and examples for several times. I could be missing something here. But something does not look right. The GWT code splitting feature does not easily work our modular design. Too invasive - requiring insertion of GWT.runAsync calls in the code. (Hacking?) In my experience, well-designed features are highly intutive and extremely flexible. Unfortunately, the GWT Code Splitting is not even close. For example, can I simply designate an EntryPoint in module.gwt.xml to be loaded on demand? A simple onDemand=true/false in the entry-point tag could have been very elegant solution. Some people believe in simplicity. Any thoughts please? For more information: http://code.google.com/p/google-web-toolkit/wiki/CodeSplitting -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9980 committed - Delete partially implemented HtmlElementFactory feature....
Revision: 9980 Author: rj...@google.com Date: Tue Apr 12 12:31:13 2011 Log: Delete partially implemented HtmlElementFactory feature. Review at http://gwt-code-reviews.appspot.com/1412802 Review by: rchan...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9980 Deleted: /trunk/user/src/com/google/gwt/uibinder/rebind/GwtDomHtmlElementFactory.java /trunk/user/src/com/google/gwt/uibinder/rebind/HtmlElementFactory.java Modified: /trunk/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml /trunk/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java /trunk/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java /trunk/user/test/com/google/gwt/uibinder/elementparsers/ElementParserTester.java /trunk/user/test/com/google/gwt/uibinder/elementparsers/MockUiBinderWriter.java === --- /trunk/user/src/com/google/gwt/uibinder/rebind/GwtDomHtmlElementFactory.java Wed Feb 9 13:31:48 2011 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the License); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.uibinder.rebind; - -import com.google.gwt.core.ext.typeinfo.JClassType; -import com.google.gwt.core.ext.typeinfo.TypeOracle; -import com.google.gwt.dom.client.TagName; - -/** - * Looks up implementation of DOM elements via @TagName interface in GWT DOM - * package. - */ -public class GwtDomHtmlElementFactory implements HtmlElementFactory { - - public JClassType findElementTypeForTag(String htmlTag, TypeOracle oracle) { -JClassType elementClass = oracle.findType(com.google.gwt.dom.client.Element); -JClassType[] types = elementClass.getSubtypes(); -for (JClassType type : types) { - TagName annotation = type.getAnnotation(TagName.class); - if (annotation != null) { -for (String annotationTag : annotation.value()) { - if (annotationTag.equals(htmlTag)) { -return type; - } -} - } -} -return elementClass; - } -} === --- /trunk/user/src/com/google/gwt/uibinder/rebind/HtmlElementFactory.java Wed Feb 9 13:31:48 2011 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the License); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.uibinder.rebind; - -import com.google.gwt.core.ext.typeinfo.JClassType; -import com.google.gwt.core.ext.typeinfo.TypeOracle; - -/** - * Looks up html tag names and returns corresponding type used to represent - * its bindings. - */ -public interface HtmlElementFactory { - JClassType findElementTypeForTag(String htmlTag, TypeOracle oracle); -} === --- /trunk/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml Wed Apr 6 03:31:11 2011 +++ /trunk/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml Tue Apr 12 12:31:13 2011 @@ -19,10 +19,6 @@ source path=client/ source path=resources/ - !-- Pluggable factory for creating field types for HTML elements -- - define-configuration-property name=uibinder.html.elementfactory is-multi-valued=false/ - set-configuration-property name=uibinder.html.elementfactory value=com.google.gwt.uibinder.rebind.GwtDomHtmlElementFactory/ - !-- By default UiBinder implementations are generated to use SafeHtmlTemplates to help protect against the introduction of cross-site scripting (XSS) attacks. This deprecated property can be used to disable that integration while the === --- /trunk/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java Wed Apr 6 03:31:11 2011 +++ /trunk/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java Tue Apr 12 12:31:13 2011 @@ -16,7 +16,6 @@ package com.google.gwt.uibinder.rebind; import com.google.gwt.core.ext.BadPropertyValueException; -import com.google.gwt.core.ext.ConfigurationProperty; import
[gwt-contrib] [google-web-toolkit] r9981 committed - Cherry pick r9912 and r9914 to releases/2.3 (add...
Revision: 9981 Author: rj...@google.com Date: Tue Apr 12 13:37:16 2011 Log: Cherry pick r9912 and r9914 to releases/2.3 (add CSS_ATTRIBUTE_START to HtmlTemplateParser, and fix things it broke). Someone didn't run the smoke tests on the relase branch, ahem. http://code.google.com/p/google-web-toolkit/source/detail?r=9981 Modified: /releases/2.3/user/src/com/google/gwt/safehtml/rebind/HtmlTemplateParser.java /releases/2.3/user/src/com/google/gwt/safehtml/rebind/ParsedHtmlTemplate.java /releases/2.3/user/src/com/google/gwt/safehtml/rebind/SafeHtmlTemplatesImplMethodCreator.java /releases/2.3/user/test/com/google/gwt/safehtml/client/SafeHtmlTemplatesTest.java /releases/2.3/user/test/com/google/gwt/safehtml/rebind/HtmlTemplateParserTest.java === --- /releases/2.3/user/src/com/google/gwt/safehtml/rebind/HtmlTemplateParser.java Thu Dec 9 08:34:53 2010 +++ /releases/2.3/user/src/com/google/gwt/safehtml/rebind/HtmlTemplateParser.java Tue Apr 12 13:37:16 2011 @@ -74,10 +74,14 @@ * ddThis context corresponds to a parameter that appears at the very start of * a URL-valued HTML attribute's value; in the above example this applies to * parameter #1. + * dt{@link HtmlContext.Type#CSS_ATTRIBUTE_START} + * ddThis context corresponds to a parameter that appears at the very + * beginning of a {@code style} attribute's value; in the above example this + * applies to parameter #0. * dt{@link HtmlContext.Type#CSS_ATTRIBUTE} * ddThis context corresponds to a parameter that appears in the context of a - * {@code style} attribute; in the above example this applies to - * parameter #0. + * {@code style} attribute, except at the very beginning of the attribute's + * value. * dt{@link HtmlContext.Type#ATTRIBUTE_VALUE} * ddThis context corresponds to a parameter that appears within an attribute * and is not in one of the more specific in-attribute contexts above. In @@ -210,7 +214,11 @@ */ private HtmlContext getHtmlContextFromParseState() throws UnableToCompleteException { - +// TODO(xtof): Consider refactoring such that state related to the position +// of the template variable in an attribute is exposed separately (as +// HtmlContext#isAttributeStart(), etc). In doing so, consider trade off +// between combinatorial explosion of possible states vs. complexity of +// client code. if (streamHtmlParser.getState().equals(HtmlParser.STATE_ERROR)) { logger.log(TreeLogger.ERROR, Parsing template resulted in parse error: @@ -250,7 +258,11 @@ if (streamHtmlParser.isUrlStart()) { return new HtmlContext(HtmlContext.Type.URL_START, tag, attribute); } else if (streamHtmlParser.inCss()) { -return new HtmlContext(HtmlContext.Type.CSS_ATTRIBUTE, tag, attribute); +if (streamHtmlParser.getValueIndex() == 0) { + return new HtmlContext(HtmlContext.Type.CSS_ATTRIBUTE_START, tag, attribute); +} else { + return new HtmlContext(HtmlContext.Type.CSS_ATTRIBUTE, tag, attribute); +} } else { return new HtmlContext( HtmlContext.Type.ATTRIBUTE_VALUE, tag, attribute); === --- /releases/2.3/user/src/com/google/gwt/safehtml/rebind/ParsedHtmlTemplate.java Thu Dec 9 08:34:53 2010 +++ /releases/2.3/user/src/com/google/gwt/safehtml/rebind/ParsedHtmlTemplate.java Tue Apr 12 13:37:16 2011 @@ -64,7 +64,11 @@ /** * CSS (style) attribute context. */ - CSS_ATTRIBUTE + CSS_ATTRIBUTE, + /** + * At the very start of a CSS (style) attribute context. + */ + CSS_ATTRIBUTE_START } private final Type type; === --- /releases/2.3/user/src/com/google/gwt/safehtml/rebind/SafeHtmlTemplatesImplMethodCreator.java Tue Apr 12 08:34:05 2011 +++ /releases/2.3/user/src/com/google/gwt/safehtml/rebind/SafeHtmlTemplatesImplMethodCreator.java Tue Apr 12 13:37:16 2011 @@ -307,6 +307,7 @@ break; case CSS_ATTRIBUTE: + case CSS_ATTRIBUTE_START: /* * We already checked if the user tried to use SafeStyles in an invalid * (non-CSS_ATTRIBUTE) context, but now we check if the user could have === --- /releases/2.3/user/test/com/google/gwt/safehtml/client/SafeHtmlTemplatesTest.java Tue Apr 12 08:34:05 2011 +++ /releases/2.3/user/test/com/google/gwt/safehtml/client/SafeHtmlTemplatesTest.java Tue Apr 12 13:37:16 2011 @@ -71,6 +71,9 @@ @Template(spanimg src=\{0}/{1}\//span) SafeHtml templateWithTwoPartUriAttribute(String baseUrl, String urlPart); + +@Template(span style='{0}; color: green;'/span) +SafeHtml templateWithStyleAttribute(String style); } public void testSimpleTemplate() { @@ -130,4 +133,10 @@
[gwt-contrib] [google-web-toolkit] r9982 committed - Cherry picking r9980 into releases/2.3, remove half baked HtmlElementF...
Revision: 9982 Author: rj...@google.com Date: Tue Apr 12 13:51:55 2011 Log: Cherry picking r9980 into releases/2.3, remove half baked HtmlElementFactory http://code.google.com/p/google-web-toolkit/source/detail?r=9982 Deleted: /releases/2.3/user/src/com/google/gwt/uibinder/rebind/GwtDomHtmlElementFactory.java /releases/2.3/user/src/com/google/gwt/uibinder/rebind/HtmlElementFactory.java Modified: /releases/2.3/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml /releases/2.3/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java /releases/2.3/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java /releases/2.3/user/test/com/google/gwt/uibinder/elementparsers/ElementParserTester.java /releases/2.3/user/test/com/google/gwt/uibinder/elementparsers/MockUiBinderWriter.java === --- /releases/2.3/user/src/com/google/gwt/uibinder/rebind/GwtDomHtmlElementFactory.java Wed Feb 9 13:31:48 2011 +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the License); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.uibinder.rebind; - -import com.google.gwt.core.ext.typeinfo.JClassType; -import com.google.gwt.core.ext.typeinfo.TypeOracle; -import com.google.gwt.dom.client.TagName; - -/** - * Looks up implementation of DOM elements via @TagName interface in GWT DOM - * package. - */ -public class GwtDomHtmlElementFactory implements HtmlElementFactory { - - public JClassType findElementTypeForTag(String htmlTag, TypeOracle oracle) { -JClassType elementClass = oracle.findType(com.google.gwt.dom.client.Element); -JClassType[] types = elementClass.getSubtypes(); -for (JClassType type : types) { - TagName annotation = type.getAnnotation(TagName.class); - if (annotation != null) { -for (String annotationTag : annotation.value()) { - if (annotationTag.equals(htmlTag)) { -return type; - } -} - } -} -return elementClass; - } -} === --- /releases/2.3/user/src/com/google/gwt/uibinder/rebind/HtmlElementFactory.java Wed Feb 9 13:31:48 2011 +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the License); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.uibinder.rebind; - -import com.google.gwt.core.ext.typeinfo.JClassType; -import com.google.gwt.core.ext.typeinfo.TypeOracle; - -/** - * Looks up html tag names and returns corresponding type used to represent - * its bindings. - */ -public interface HtmlElementFactory { - JClassType findElementTypeForTag(String htmlTag, TypeOracle oracle); -} === --- /releases/2.3/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml Thu Apr 7 08:40:59 2011 +++ /releases/2.3/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml Tue Apr 12 13:51:55 2011 @@ -19,10 +19,6 @@ source path=client/ source path=resources/ - !-- Pluggable factory for creating field types for HTML elements -- - define-configuration-property name=uibinder.html.elementfactory is-multi-valued=false/ - set-configuration-property name=uibinder.html.elementfactory value=com.google.gwt.uibinder.rebind.GwtDomHtmlElementFactory/ - !-- Set this property to true to turn on UiBinder's new SafeHtmlTemplates integration. The default value will be true in future releases of GWT -- === --- /releases/2.3/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java Thu Apr 7 08:40:59 2011 +++ /releases/2.3/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java Tue Apr 12 13:51:55 2011 @@ -16,7 +16,6 @@ package com.google.gwt.uibinder.rebind; import com.google.gwt.core.ext.BadPropertyValueException; -import com.google.gwt.core.ext.ConfigurationProperty; import com.google.gwt.core.ext.Generator; import
[gwt-contrib] Re: Comment on CssResource in google-web-toolkit
Comment by seebau...@cip.ifi.lmu.de: Hi, I have a problem with the point 'removing all nessecary whitespaces' (aktually I'm working with gwt 2.1.1, because the new gxt-version isn't in mvn2rep) my code usually looked like this (other user.agents omitted for readability): {{{ @if user.agent safari{ .top {background-color: silver; background-image: -webkit-gradient(linear,left top,left bottom,from(white),to(silver));} }… }}} inspecting this with Chromium devtools I see, that the rule becomes to: {{{.GEEGQDBNF { background-color: silver; background-image: -webkit-gradient(linear,lefttop,leftbottom,from(white),to(silver)); } }}} Ok, looks like the whitespaces get optimized away, but what can I do against it? i tried this: {{{ … background-image: -webkit-gradient(linear,left\ top, left\ bottom, from(white), to(silver)); … /* but it became:*/ background-image: -webkit-gradient(linear,left topp,left bottomm,from(white),to(silver)) }}} Escaping other spaces led to similar results with other characters duplicated. I'm not sure if I understood the @literal-syntax, because I always get some warnings and the poperties I use it with don't appear in the optimized rules. For more information: http://code.google.com/p/google-web-toolkit/wiki/CssResource -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Comment on CssResource in google-web-toolkit
Comment by seebau...@cip.ifi.lmu.de: Hi, I have a problem with the point 'removing all nessecary whitespaces' (aktually I'm working with gwt 2.1.1, because the new gxt-version isn't in mvn2rep) my code usually looked like this (other user.agents omitted for readability): {{{ @if user.agent safari{ .top {background-color: silver; background-image: -webkit-gradient(linear,left top,left bottom,from(white),to(silver));} }… }}} inspecting this with Chromium devtools I see, that the rule becomes to: {{{ .GEEGQDBNF { background-color: silver; background-image: -webkit-gradient(linear,lefttop,leftbottom,from(white),to(silver)); } }}} Ok, looks like the whitespaces get optimized away, but what can I do against it? i tried this: {{{ … background-image: -webkit-gradient(linear,left\ top, left\ bottom, from(white), to(silver)); … /* but it became:*/ background-image: -webkit-gradient(linear,left topp,left bottomm,from(white),to(silver)); }}} Escaping other spaces led to similar results with other characters duplicated. I'm not sure if I understood the @literal-syntax, because I always get some warnings and the poperties I use it with don't appear in the optimized rules. For more information: http://code.google.com/p/google-web-toolkit/wiki/CssResource -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9970 committed - Adds {moz,webkit}RequestAnimationFrame support to animations....
Revision: 9970 Author: jlaba...@google.com Date: Mon Apr 11 07:56:01 2011 Log: Adds {moz,webkit}RequestAnimationFrame support to animations. Refactor Animation with different implementations, adding mozRequestAnimationFrame and webkitRequestAnimationFrame support in addition to the timer-based implementation. ALso adds run() overloads taking an 'element' argument, that visually scopes the animation (so that browsers can, as an optimization, skip steps when the element is not visible to the user). Code Review: http://gwt-code-reviews.appspot.com/1355805/ Author: tbroyer Review by: jlabanca http://code.google.com/p/google-web-toolkit/source/detail?r=9970 Added: /trunk/user/src/com/google/gwt/animation/client/AnimationImpl.java /trunk/user/src/com/google/gwt/animation/client/AnimationImplMozAnimTiming.java /trunk/user/src/com/google/gwt/animation/client/AnimationImplTimer.java /trunk/user/src/com/google/gwt/animation/client/AnimationImplWebkitAnimTiming.java Modified: /trunk/user/src/com/google/gwt/animation/Animation.gwt.xml /trunk/user/src/com/google/gwt/animation/client/Animation.java /trunk/user/src/com/google/gwt/layout/client/Layout.java /trunk/user/src/com/google/gwt/user/cellview/client/CellBrowser.java /trunk/user/src/com/google/gwt/user/client/ui/DeckPanel.java === --- /dev/null +++ /trunk/user/src/com/google/gwt/animation/client/AnimationImpl.java Mon Apr 11 07:56:01 2011 @@ -0,0 +1,45 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.animation.client; + +import com.google.gwt.dom.client.Element; + +/** + * Base class for animation implementations. + */ +abstract class AnimationImpl { + + /** + * Cancel the animation. + */ + public abstract void cancel(Animation animation); + + /** + * Run the animation with an optional bounding element. + */ + public abstract void run(Animation animation, Element element); + + /** + * Update the {@link Animation}. + * + * @param animation the {@link Animation} + * @param curTime the current time + * @return true if the animation is complete, false if still running + */ + protected final boolean updateAnimation(Animation animation, double curTime) { +return animation.isRunning() animation.update(curTime); + } +} === --- /dev/null +++ /trunk/user/src/com/google/gwt/animation/client/AnimationImplMozAnimTiming.java Mon Apr 11 07:56:01 2011 @@ -0,0 +1,56 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.animation.client; + +import com.google.gwt.dom.client.Element; + +/** + * Implementation using codemozRequestAnimationFrame/code. + * + * @see a href=https://developer.mozilla.org/en/DOM/window.mozRequestAnimationFrame; + * Documentation on the MDN/a + */ +class AnimationImplMozAnimTiming extends AnimationImpl { + + private int handle; + + @Override + public void cancel(Animation animation) { +handle++; + } + + @Override + public void run(Animation animation, Element element) { +handle++; +nativeRun(animation); + } + + private native void nativeRun(Animation animation) /*-{ +var self = this; +var handle = th...@com.google.gwt.animation.client.AnimationImplMozAnimTiming::handle; +var callback = $entry(function(time) { + if (handle != se...@com.google.gwt.animation.client.AnimationImplMozAnimTiming::handle) { +return; // cancelled + } + var complete = se...@com.google.gwt.animation.client.AnimationImpl::updateAnimation(Lcom/google/gwt/animation/client/Animation;D)(animation, time); + if (!complete) { +$wnd.mozRequestAnimationFrame(callback); + } +}); + +$wnd.mozRequestAnimationFrame(callback); + }-*/; +} === --- /dev/null +++
[gwt-contrib] [google-web-toolkit] r9971 committed - Reverting r9970 due to build break....
Revision: 9971 Author: jlaba...@google.com Date: Mon Apr 11 09:09:49 2011 Log: Reverting r9970 due to build break. Review at http://gwt-code-reviews.appspot.com/1408804 Review by: fabb...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9971 Deleted: /trunk/user/src/com/google/gwt/animation/client/AnimationImpl.java /trunk/user/src/com/google/gwt/animation/client/AnimationImplMozAnimTiming.java /trunk/user/src/com/google/gwt/animation/client/AnimationImplTimer.java /trunk/user/src/com/google/gwt/animation/client/AnimationImplWebkitAnimTiming.java Modified: /trunk/user/src/com/google/gwt/animation/Animation.gwt.xml /trunk/user/src/com/google/gwt/animation/client/Animation.java /trunk/user/src/com/google/gwt/layout/client/Layout.java /trunk/user/src/com/google/gwt/user/cellview/client/CellBrowser.java /trunk/user/src/com/google/gwt/user/client/ui/DeckPanel.java === --- /trunk/user/src/com/google/gwt/animation/client/AnimationImpl.java Mon Apr 11 07:56:01 2011 +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the License); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.animation.client; - -import com.google.gwt.dom.client.Element; - -/** - * Base class for animation implementations. - */ -abstract class AnimationImpl { - - /** - * Cancel the animation. - */ - public abstract void cancel(Animation animation); - - /** - * Run the animation with an optional bounding element. - */ - public abstract void run(Animation animation, Element element); - - /** - * Update the {@link Animation}. - * - * @param animation the {@link Animation} - * @param curTime the current time - * @return true if the animation is complete, false if still running - */ - protected final boolean updateAnimation(Animation animation, double curTime) { -return animation.isRunning() animation.update(curTime); - } -} === --- /trunk/user/src/com/google/gwt/animation/client/AnimationImplMozAnimTiming.java Mon Apr 11 07:56:01 2011 +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the License); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.animation.client; - -import com.google.gwt.dom.client.Element; - -/** - * Implementation using codemozRequestAnimationFrame/code. - * - * @see a href=https://developer.mozilla.org/en/DOM/window.mozRequestAnimationFrame; - * Documentation on the MDN/a - */ -class AnimationImplMozAnimTiming extends AnimationImpl { - - private int handle; - - @Override - public void cancel(Animation animation) { -handle++; - } - - @Override - public void run(Animation animation, Element element) { -handle++; -nativeRun(animation); - } - - private native void nativeRun(Animation animation) /*-{ -var self = this; -var handle = th...@com.google.gwt.animation.client.AnimationImplMozAnimTiming::handle; -var callback = $entry(function(time) { - if (handle != se...@com.google.gwt.animation.client.AnimationImplMozAnimTiming::handle) { -return; // cancelled - } - var complete = se...@com.google.gwt.animation.client.AnimationImpl::updateAnimation(Lcom/google/gwt/animation/client/Animation;D)(animation, time); - if (!complete) { -$wnd.mozRequestAnimationFrame(callback); - } -}); - -$wnd.mozRequestAnimationFrame(callback); - }-*/; -} === --- /trunk/user/src/com/google/gwt/animation/client/AnimationImplTimer.java Mon Apr 11 07:56:01 2011 +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the License); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless
[gwt-contrib] [google-web-toolkit] r9972 committed - make it possible to just use devmode on a particular module while allo...
Revision: 9972 Author: unn...@google.com Date: Mon Apr 11 11:56:17 2011 Log: make it possible to just use devmode on a particular module while allowing the others to run in prod mode Review at http://gwt-code-reviews.appspot.com/1408802 Review by: fabio...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9972 Modified: /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/devmode.js /trunk/dev/core/src/com/google/gwt/core/linker/CrossSiteIframeLinker.java /trunk/dev/core/src/com/google/gwt/core/linker/CrossSiteIframeTemplate.js === --- /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/devmode.js Thu Feb 24 06:41:44 2011 +++ /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/devmode.js Mon Apr 11 11:56:17 2011 @@ -252,7 +252,10 @@ var query = $wnd.location.search; var idx = query.indexOf(gwt.codesvr=); if (idx = 0) { -idx += 12; // gwt.codesvr=.length() == 12 +idx += 12; // gwt.codesvr=.length == 12 + } else { +idx = query.indexOf(gwt.codesvr.__MODULE_NAME__=); +idx += (13 + __MODULE_NAME__.length); // } if (idx = 0) { var amp = query.indexOf(, idx); === --- /trunk/dev/core/src/com/google/gwt/core/linker/CrossSiteIframeLinker.java Mon Mar 21 12:22:19 2011 +++ /trunk/dev/core/src/com/google/gwt/core/linker/CrossSiteIframeLinker.java Mon Apr 11 11:56:17 2011 @@ -339,6 +339,7 @@ outputFilename = getHostedFilenameFull(context); } +replaceAll(buffer, __MODULE_NAME__, context.getModuleName()); String script = generatePrimaryFragmentString(logger, context, result, buffer.toString(), 1, artifacts); === --- /trunk/dev/core/src/com/google/gwt/core/linker/CrossSiteIframeTemplate.js Fri Mar 11 13:16:30 2011 +++ /trunk/dev/core/src/com/google/gwt/core/linker/CrossSiteIframeTemplate.js Mon Apr 11 11:56:17 2011 @@ -34,7 +34,8 @@ function isHostedMode() { var query = $wnd.location.search; -return (query.indexOf('gwt.codesvr=') != -1); +return ((query.indexOf('gwt.codesvr.__MODULE_NAME__=') != -1) || +(query.indexOf('gwt.codesvr=') != -1)); } // Helper function to send statistics to the __gwtStatsEvent function if it -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9973 committed - Fixed pom.xml produced by WebAppCreator. Issue 4878 and Issue 6196....
Revision: 9973 Author: rchan...@google.com Date: Mon Apr 11 13:05:14 2011 Log: Fixed pom.xml produced by WebAppCreator. Issue 4878 and Issue 6196. Review at http://gwt-code-reviews.appspot.com/1407804 Review by: drfibona...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9973 Modified: /trunk/user/src/com/google/gwt/user/tools/templates/maven/pom.xmlsrc === --- /trunk/user/src/com/google/gwt/user/tools/templates/maven/pom.xmlsrc Fri Apr 8 08:46:11 2011 +++ /trunk/user/src/com/google/gwt/user/tools/templates/maven/pom.xmlsrc Mon Apr 11 13:05:14 2011 @@ -40,9 +40,22 @@ dependency groupIdjunit/groupId artifactIdjunit/artifactId - version4.4/version + version4.8.1/version scopetest/scope /dependency +dependency + groupIdjavax.validation/groupId + artifactIdvalidation-api/artifactId + version1.0.0.GA/version + scopeprovided/scope +/dependency +dependency + groupIdjavax.validation/groupId + artifactIdvalidation-api/artifactId + version1.0.0.GA/version + classifiersources/classifier + scopeprovided/scope +/dependency /dependencies build @@ -55,6 +68,24 @@ plugin groupIdorg.codehaus.mojo/groupId artifactIdgwt-maven-plugin/artifactId + version2.2.0/version + dependencies + dependency +groupIdcom.google.gwt/groupId +artifactIdgwt-user/artifactId +version${gwtVersion}/version + /dependency + dependency +groupIdcom.google.gwt/groupId +artifactIdgwt-dev/artifactId +version${gwtVersion}/version + /dependency + dependency +groupIdcom.google.gwt/groupId +artifactIdgwt-servlet/artifactId +version${gwtVersion}/version + /dependency + /dependencies !-- JS is only needed in the package phase, this speeds up testing -- executions execution @@ -72,13 +103,14 @@ !-- Location of the develop-mode web application structure (gwt:run). -- hostedWebapptarget/www/hostedWebapp !-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) -- - soyctrue/soyc + compileReporttrue/compileReport /configuration /plugin !-- Add source folders to test classpath in order to run gwt-tests as normal junit-tests -- plugin artifactIdmaven-surefire-plugin/artifactId + version2.5/version configuration additionalClasspathElements additionalClasspathElement${project.build.sourceDirectory}/additionalClasspathElement @@ -100,6 +132,7 @@ !-- Copy static web files before executing gwt:run -- plugin artifactIdmaven-resources-plugin/artifactId +version2.4.2/version executions execution phasecompile/phase @@ -121,6 +154,7 @@ !-- Delete gwt generated stuff -- plugin artifactIdmaven-clean-plugin/artifactId + version2.3/version configuration filesets filesetdirectorysrc/main/webapp/@renameTo/directory/fileset @@ -131,7 +165,25 @@ /filesets /configuration /plugin - + + plugin + artifactIdmaven-eclipse-plugin/artifactId + version2.7/version !-- Note 2.8 does not work with AspectJ aspect path -- + configuration + downloadSourcestrue/downloadSources + downloadJavadocsfalse/downloadJavadocs + wtpversion2.0/wtpversion + additionalBuildcommands +buildCommand + namecom.google.gwt.eclipse.core.gwtProjectValidator/name +/buildCommand + /additionalBuildcommands + additionalProjectnatures + projectnaturecom.google.gwt.eclipse.core.gwtNature/projectnature + /additionalProjectnatures + /configuration + /plugin + /plugins /build /project -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9974 committed - Cherry picking r9967 into releases/2.3
Revision: 9974 Author: rchan...@google.com Date: Mon Apr 11 13:59:08 2011 Log: Cherry picking r9967 into releases/2.3 http://code.google.com/p/google-web-toolkit/source/detail?r=9974 Modified: /releases/2.3/samples/expenses/pom.xml /releases/2.3/user/src/com/google/gwt/user/tools/templates/maven/pom.xmlsrc === --- /releases/2.3/samples/expenses/pom.xml Wed Mar 9 09:59:27 2011 +++ /releases/2.3/samples/expenses/pom.xml Mon Apr 11 13:59:08 2011 @@ -1,652 +1,652 @@ ?xml version=1.0 encoding=UTF-8 standalone=no? project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd; - modelVersion4.0.0/modelVersion - groupIdcom.google.gwt.sample.expenses/groupId - artifactIdexpenses/artifactId - packagingwar/packaging - version0.1.0.BUILD-SNAPSHOT/version - nameexpenses/name - properties + modelVersion4.0.0/modelVersion + groupIdcom.google.gwt.sample.expenses/groupId + artifactIdexpenses/artifactId + packagingwar/packaging + version0.1.0.BUILD-SNAPSHOT/version + nameexpenses/name + properties gwt.version2.2.0/gwt.version - roo.version1.1.0.RELEASE/roo.version - spring.version3.0.3.RELEASE/spring.version - slf4j.version1.6.1/slf4j.version - gae.version1.4.2/gae.version +roo.version1.1.0.RELEASE/roo.version +spring.version3.0.3.RELEASE/spring.version +slf4j.version1.6.1/slf4j.version +gae.version1.4.2/gae.version gae-test.version1.4.2/gae-test.version gae.home${user.home}/.m2/repository/com/google/appengine/appengine-java-sdk/${gae.version}/appengine-java-sdk-${gae.version}/gae.home datanucleus.version1.1.5/datanucleus.version -/properties - repositories -repository -idspring-maven-release/id -nameSpring Maven Release Repository/name -urlhttp://maven.springframework.org/release/url -/repository -repository -idspring-maven-milestone/id -nameSpring Maven Milestone Repository/name -urlhttp://maven.springframework.org/milestone/url -/repository -repository -idspring-roo-repository/id -nameSpring Roo Repository/name - urlhttp://spring-roo-repository.springsource.org/release/url -/repository + /properties + repositories repository -idDataNucleus_2/id -urlhttp://www.datanucleus.org/downloads/maven2//url -nameDataNucleus/name -/repository + idspring-maven-release/id + nameSpring Maven Release Repository/name + urlhttp://maven.springframework.org/release/url +/repository repository -idJBoss Repo/id - urlhttps://repository.jboss.org/nexus/content/repositories/releases/url -nameJBoss Repo/name -/repository -/repositories -pluginRepositories + idspring-maven-milestone/id + nameSpring Maven Milestone Repository/name + urlhttp://maven.springframework.org/milestone/url +/repository +repository + idspring-roo-repository/id + nameSpring Roo Repository/name + urlhttp://spring-roo-repository.springsource.org/release/url +/repository +repository + idDataNucleus_2/id + urlhttp://www.datanucleus.org/downloads/maven2//url + nameDataNucleus/name +/repository +repository + idJBoss Repo/id + urlhttps://repository.jboss.org/nexus/content/repositories/releases/url + nameJBoss Repo/name +/repository + /repositories + pluginRepositories pluginRepository -idDataNucleus_2/id -urlhttp://www.datanucleus.org/downloads/maven2//url -/pluginRepository -/pluginRepositories - dependencies - !-- General dependencies for standard applications -- - dependency - groupIdjunit/groupId - artifactIdjunit/artifactId - version4.8.1/version - scopetest/scope - /dependency - dependency - groupIdlog4j/groupId - artifactIdlog4j/artifactId - version1.2.16/version - /dependency - dependency - groupIdorg.slf4j/groupId - artifactIdslf4j-api/artifactId - version${slf4j.version}/version - /dependency - dependency - groupIdorg.slf4j/groupId - artifactIdjcl-over-slf4j/artifactId - version${slf4j.version}/version - /dependency - dependency - groupIdorg.slf4j/groupId -
[gwt-contrib] [google-web-toolkit] r9975 committed - Cherry picking r9973 into releases/2.3 for isuees 4878 and 6196
Revision: 9975 Author: rchan...@google.com Date: Mon Apr 11 14:26:39 2011 Log: Cherry picking r9973 into releases/2.3 for isuees 4878 and 6196 http://code.google.com/p/google-web-toolkit/source/detail?r=9975 Modified: /releases/2.3/user/src/com/google/gwt/user/tools/templates/maven/pom.xmlsrc === --- /releases/2.3/user/src/com/google/gwt/user/tools/templates/maven/pom.xmlsrc Mon Apr 11 13:59:08 2011 +++ /releases/2.3/user/src/com/google/gwt/user/tools/templates/maven/pom.xmlsrc Mon Apr 11 14:26:39 2011 @@ -40,9 +40,22 @@ dependency groupIdjunit/groupId artifactIdjunit/artifactId - version4.4/version + version4.8.1/version scopetest/scope /dependency +dependency + groupIdjavax.validation/groupId + artifactIdvalidation-api/artifactId + version1.0.0.GA/version + scopeprovided/scope +/dependency +dependency + groupIdjavax.validation/groupId + artifactIdvalidation-api/artifactId + version1.0.0.GA/version + classifiersources/classifier + scopeprovided/scope +/dependency /dependencies build @@ -55,6 +68,24 @@ plugin groupIdorg.codehaus.mojo/groupId artifactIdgwt-maven-plugin/artifactId + version2.2.0/version + dependencies + dependency +groupIdcom.google.gwt/groupId +artifactIdgwt-user/artifactId +version${gwtVersion}/version + /dependency + dependency +groupIdcom.google.gwt/groupId +artifactIdgwt-dev/artifactId +version${gwtVersion}/version + /dependency + dependency +groupIdcom.google.gwt/groupId +artifactIdgwt-servlet/artifactId +version${gwtVersion}/version + /dependency + /dependencies !-- JS is only needed in the package phase, this speeds up testing -- executions execution @@ -72,13 +103,14 @@ !-- Location of the develop-mode web application structure (gwt:run). -- hostedWebapptarget/www/hostedWebapp !-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) -- - soyctrue/soyc + compileReporttrue/compileReport /configuration /plugin !-- Add source folders to test classpath in order to run gwt-tests as normal junit-tests -- plugin artifactIdmaven-surefire-plugin/artifactId + version2.5/version configuration additionalClasspathElements additionalClasspathElement${project.build.sourceDirectory}/additionalClasspathElement @@ -100,6 +132,7 @@ !-- Copy static web files before executing gwt:run -- plugin artifactIdmaven-resources-plugin/artifactId +version2.4.2/version executions execution phasecompile/phase @@ -121,6 +154,7 @@ !-- Delete gwt generated stuff -- plugin artifactIdmaven-clean-plugin/artifactId + version2.3/version configuration filesets filesetdirectorysrc/main/webapp/@renameTo/directory/fileset @@ -131,7 +165,25 @@ /filesets /configuration /plugin - + + plugin + artifactIdmaven-eclipse-plugin/artifactId + version2.7/version !-- Note 2.8 does not work with AspectJ aspect path -- + configuration + downloadSourcestrue/downloadSources + downloadJavadocsfalse/downloadJavadocs + wtpversion2.0/wtpversion + additionalBuildcommands +buildCommand + namecom.google.gwt.eclipse.core.gwtProjectValidator/name +/buildCommand + /additionalBuildcommands + additionalProjectnatures + projectnaturecom.google.gwt.eclipse.core.gwtNature/projectnature + /additionalProjectnatures + /configuration + /plugin + /plugins /build /project -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9965 committed - Fixes to cldr eclipse projects in GWT....
Revision: 9965 Author: zun...@google.com Date: Fri Apr 8 07:51:16 2011 Log: Fixes to cldr eclipse projects in GWT. Review at http://gwt-code-reviews.appspot.com/1410802 Review by: j...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9965 Modified: /trunk/eclipse/external/cldr-tools/.classpath /trunk/eclipse/tools/cldr-import/.classpath === --- /trunk/eclipse/external/cldr-tools/.classpath Tue Oct 12 14:00:54 2010 +++ /trunk/eclipse/external/cldr-tools/.classpath Fri Apr 8 07:51:16 2011 @@ -4,7 +4,7 @@ classpathentry kind=con path=org.eclipse.jdt.launching.JRE_CONTAINER/ classpathentry kind=var path=GWT_TOOLS/lib/xalan/xalan-2.7.1.jar/ classpathentry kind=var path=GWT_TOOLS/lib/apache/ant-1.7.1.jar/ - classpathentry kind=var path=GWT_TOOLS/lib/icu4j/4.4.2/icu4j.jar/ sourcepath=/GWT_TOOLS/lib/icu4j/4.4.2/icu4jsrc.jar/ + classpathentry kind=var path=GWT_TOOLS/lib/icu4j/4.4.2/icu4j.jar sourcepath=/GWT_TOOLS/lib/icu4j/4.4.2/icu4jsrc.jar/ classpathentry kind=var path=GWT_TOOLS/lib/icu4j/4.4.2/utilities.jar sourcepath=/GWT_TOOLS/lib/icu4j/4.4.2/icu4jsrc.jar/ classpathentry kind=output path=bin/ /classpath === --- /trunk/eclipse/tools/cldr-import/.classpath Tue Mar 8 08:22:05 2011 +++ /trunk/eclipse/tools/cldr-import/.classpath Fri Apr 8 07:51:16 2011 @@ -9,5 +9,6 @@ classpathentry combineaccessrules=false kind=src path=/cldr-tools/ classpathentry combineaccessrules=false kind=src path=/gwt-dev/ classpathentry kind=var path=GWT_TOOLS/lib/icu4j/4.4.2/utilities.jar sourcepath=/GWT_TOOLS/lib/icu4j/4.4.2/icu4jsrc.jar/ +classpathentry kind=var path=GWT_TOOLS/lib/cldr/1.8.1/cldr.jar / classpathentry kind=output path=bin/ /classpath -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9966 committed - Changes the eclipse formatter to put a space between [] and { in an...
Revision: 9966 Author: zun...@google.com Date: Fri Apr 8 07:53:12 2011 Log: Changes the eclipse formatter to put a space between [] and { in an array initializer. Review at http://gwt-code-reviews.appspot.com/1411801 Review by: j...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9966 Modified: /trunk/eclipse/settings/code-style/gwt-format.xml === --- /trunk/eclipse/settings/code-style/gwt-format.xml Tue Mar 1 11:37:55 2011 +++ /trunk/eclipse/settings/code-style/gwt-format.xml Fri Apr 8 07:53:12 2011 @@ -216,7 +216,7 @@ setting id=org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters value=do not insert/ setting id=org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration value=insert/ setting id=org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration value=insert/ -setting id=org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer value=do not insert/ +setting id=org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer value=insert/ setting id=org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block value=insert/ setting id=org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration value=insert/ setting id=org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant value=insert/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9967 committed - Reindented pom.xml files...
Revision: 9967 Author: rchan...@google.com Date: Fri Apr 8 08:46:11 2011 Log: Reindented pom.xml files Review at http://gwt-code-reviews.appspot.com/1410801 Review by: drfibona...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9967 Modified: /trunk/samples/expenses/pom.xml /trunk/user/src/com/google/gwt/user/tools/templates/maven/pom.xmlsrc === --- /trunk/samples/expenses/pom.xml Wed Mar 9 09:59:27 2011 +++ /trunk/samples/expenses/pom.xml Fri Apr 8 08:46:11 2011 @@ -1,652 +1,652 @@ ?xml version=1.0 encoding=UTF-8 standalone=no? project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd; - modelVersion4.0.0/modelVersion - groupIdcom.google.gwt.sample.expenses/groupId - artifactIdexpenses/artifactId - packagingwar/packaging - version0.1.0.BUILD-SNAPSHOT/version - nameexpenses/name - properties + modelVersion4.0.0/modelVersion + groupIdcom.google.gwt.sample.expenses/groupId + artifactIdexpenses/artifactId + packagingwar/packaging + version0.1.0.BUILD-SNAPSHOT/version + nameexpenses/name + properties gwt.version2.2.0/gwt.version - roo.version1.1.0.RELEASE/roo.version - spring.version3.0.3.RELEASE/spring.version - slf4j.version1.6.1/slf4j.version - gae.version1.4.2/gae.version +roo.version1.1.0.RELEASE/roo.version +spring.version3.0.3.RELEASE/spring.version +slf4j.version1.6.1/slf4j.version +gae.version1.4.2/gae.version gae-test.version1.4.2/gae-test.version gae.home${user.home}/.m2/repository/com/google/appengine/appengine-java-sdk/${gae.version}/appengine-java-sdk-${gae.version}/gae.home datanucleus.version1.1.5/datanucleus.version -/properties - repositories -repository -idspring-maven-release/id -nameSpring Maven Release Repository/name -urlhttp://maven.springframework.org/release/url -/repository -repository -idspring-maven-milestone/id -nameSpring Maven Milestone Repository/name -urlhttp://maven.springframework.org/milestone/url -/repository -repository -idspring-roo-repository/id -nameSpring Roo Repository/name - urlhttp://spring-roo-repository.springsource.org/release/url -/repository + /properties + repositories repository -idDataNucleus_2/id -urlhttp://www.datanucleus.org/downloads/maven2//url -nameDataNucleus/name -/repository + idspring-maven-release/id + nameSpring Maven Release Repository/name + urlhttp://maven.springframework.org/release/url +/repository repository -idJBoss Repo/id - urlhttps://repository.jboss.org/nexus/content/repositories/releases/url -nameJBoss Repo/name -/repository -/repositories -pluginRepositories + idspring-maven-milestone/id + nameSpring Maven Milestone Repository/name + urlhttp://maven.springframework.org/milestone/url +/repository +repository + idspring-roo-repository/id + nameSpring Roo Repository/name + urlhttp://spring-roo-repository.springsource.org/release/url +/repository +repository + idDataNucleus_2/id + urlhttp://www.datanucleus.org/downloads/maven2//url + nameDataNucleus/name +/repository +repository + idJBoss Repo/id + urlhttps://repository.jboss.org/nexus/content/repositories/releases/url + nameJBoss Repo/name +/repository + /repositories + pluginRepositories pluginRepository -idDataNucleus_2/id -urlhttp://www.datanucleus.org/downloads/maven2//url -/pluginRepository -/pluginRepositories - dependencies - !-- General dependencies for standard applications -- - dependency - groupIdjunit/groupId - artifactIdjunit/artifactId - version4.8.1/version - scopetest/scope - /dependency - dependency - groupIdlog4j/groupId - artifactIdlog4j/artifactId - version1.2.16/version - /dependency - dependency - groupIdorg.slf4j/groupId - artifactIdslf4j-api/artifactId - version${slf4j.version}/version - /dependency - dependency - groupIdorg.slf4j/groupId - artifactIdjcl-over-slf4j/artifactId - version${slf4j.version}/version - /dependency - dependency -
[gwt-contrib] [google-web-toolkit] r9968 committed - Some small refactors to Css Resource Generation...
Revision: 9968 Author: unn...@google.com Date: Fri Apr 8 11:20:03 2011 Log: Some small refactors to Css Resource Generation Review at http://gwt-code-reviews.appspot.com/1406802 http://code.google.com/p/google-web-toolkit/source/detail?r=9968 Deleted: /trunk/user/src/com/google/gwt/resources/client/CssResourceBase.java /trunk/user/src/com/google/gwt/resources/rg/CssObfuscationStyle.java Modified: /trunk/user/src/com/google/gwt/resources/client/CssResource.java /trunk/user/src/com/google/gwt/resources/rg/CssResourceGenerator.java /trunk/user/test/com/google/gwt/resources/rg/CssTestCase.java === --- /trunk/user/src/com/google/gwt/resources/client/CssResourceBase.java Thu Apr 7 11:55:26 2011 +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the License); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.resources.client; - -/** - * Marker interface for all classes that should be obfuscated together in - * Css Resource generation. - * TODO(unnurg): Try to get rid of the global obfuscation scheme and delete - * this interface. - */ -public interface CssResourceBase extends ResourcePrototype { } === --- /trunk/user/src/com/google/gwt/resources/rg/CssObfuscationStyle.java Thu Apr 7 11:55:26 2011 +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the License); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.resources.rg; - -import com.google.gwt.core.ext.typeinfo.JClassType; - -/** - * Evaluates the obfuscation style the user selected and formats the obfuscated - * name accordingly. - */ -public enum CssObfuscationStyle { - VERBOSE (true, false, true, true), - STABLE_FULL_CLASSNAME (true, true, true, true), - STABLE_SHORT_CLASSNAME (true, true, true, false), - STABLE_NO_CLASSNAME (true, true, false, false), - OBFUSCATED (false, false, false, false); - - static CssObfuscationStyle getObfuscationStyle(String name) { -if (name.equalsIgnoreCase(pretty)) { - return VERBOSE; -} else if (name.equalsIgnoreCase(stable)) { - return STABLE_FULL_CLASSNAME; -} else if (name.equalsIgnoreCase(stable-shorttype)) { - return STABLE_SHORT_CLASSNAME; -} else if (name.equalsIgnoreCase(stable-notype)) { - return STABLE_NO_CLASSNAME; -} -return OBFUSCATED; - } - - private boolean isPretty; - private boolean isStable; - private boolean showClassName; - private boolean showPackageName; - - CssObfuscationStyle(boolean isPretty, boolean isStable, boolean showClassName, - boolean showPackageName) { -this.isPretty = isPretty; -this.isStable = isStable; -this.showClassName = showClassName; -this.showPackageName = showPackageName; - } - - public String getPrettyName(String method, JClassType type, String obfuscatedName) { -if (!isPretty()) { - return obfuscatedName; -} -String toReturn = method; - -/* - * Note that by dropping the type, or using it's short name, you are - * allowing name collisions in the css selector names. These options should - * only be used if you are sure that your GWT application is ensuring that - * there are no namespace collisions. - */ -if (showClassName) { - if (showPackageName) { -toReturn = type.getQualifiedSourceName().replaceAll([.$], -) + - + toReturn; - } else { -toReturn = type.getName() + - + toReturn; - } -} - -/* - * For stable styles the obfuscated class name is dropped from the pretty - * output. This results in class names that are constant, no matter how - * many other selectors are added. - */ -if (!isStable) { - toReturn = obfuscatedName += - + toReturn; -} -return toReturn; - } - - public boolean isPretty() { -return isPretty; - } -} === ---
[gwt-contrib] [google-web-toolkit] r9969 committed - Some small refactors to Css Resource Generation...
Revision: 9969 Author: unn...@google.com Date: Fri Apr 8 13:24:59 2011 Log: Some small refactors to Css Resource Generation Review at http://gwt-code-reviews.appspot.com/1406802 Review by: sce...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9969 Added: /trunk/user/src/com/google/gwt/resources/client/CssResourceBase.java /trunk/user/src/com/google/gwt/resources/rg/CssObfuscationStyle.java Modified: /trunk/user/src/com/google/gwt/resources/client/CssResource.java /trunk/user/src/com/google/gwt/resources/rg/CssResourceGenerator.java /trunk/user/test/com/google/gwt/resources/rg/CssTestCase.java === --- /dev/null +++ /trunk/user/src/com/google/gwt/resources/client/CssResourceBase.java Fri Apr 8 13:24:59 2011 @@ -0,0 +1,24 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.resources.client; + +/** + * Marker interface for all classes that should be obfuscated together in + * Css Resource generation. + * TODO(unnurg): Try to get rid of the global obfuscation scheme and delete + * this interface. + */ +public interface CssResourceBase extends ResourcePrototype { } === --- /dev/null +++ /trunk/user/src/com/google/gwt/resources/rg/CssObfuscationStyle.java Fri Apr 8 13:24:59 2011 @@ -0,0 +1,91 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.resources.rg; + +import com.google.gwt.core.ext.typeinfo.JClassType; + +/** + * Evaluates the obfuscation style the user selected and formats the obfuscated + * name accordingly. + */ +public enum CssObfuscationStyle { + VERBOSE (true, false, true, true), + STABLE_FULL_CLASSNAME (true, true, true, true), + STABLE_SHORT_CLASSNAME (true, true, true, false), + STABLE_NO_CLASSNAME (true, true, false, false), + OBFUSCATED (false, false, false, false); + + static CssObfuscationStyle getObfuscationStyle(String name) { +if (name.equalsIgnoreCase(pretty)) { + return VERBOSE; +} else if (name.equalsIgnoreCase(stable)) { + return STABLE_FULL_CLASSNAME; +} else if (name.equalsIgnoreCase(stable-shorttype)) { + return STABLE_SHORT_CLASSNAME; +} else if (name.equalsIgnoreCase(stable-notype)) { + return STABLE_NO_CLASSNAME; +} +return OBFUSCATED; + } + + private boolean isPretty; + private boolean isStable; + private boolean showClassName; + private boolean showPackageName; + + CssObfuscationStyle(boolean isPretty, boolean isStable, boolean showClassName, + boolean showPackageName) { +this.isPretty = isPretty; +this.isStable = isStable; +this.showClassName = showClassName; +this.showPackageName = showPackageName; + } + + public String getPrettyName(String method, JClassType type, String obfuscatedName) { +if (!isPretty()) { + return obfuscatedName; +} +String toReturn = method; + +/* + * Note that by dropping the type, or using it's short name, you are + * allowing name collisions in the css selector names. These options should + * only be used if you are sure that your GWT application is ensuring that + * there are no namespace collisions. + */ +if (showClassName) { + if (showPackageName) { +toReturn = type.getQualifiedSourceName().replaceAll([.$], -) + - + toReturn; + } else { +toReturn = type.getName() + - + toReturn; + } +} + +/* + * For stable styles the obfuscated class name is dropped from the pretty + * output. This results in class names that are constant, no matter how + * many other selectors are added. + */ +if (!isStable) { + toReturn = obfuscatedName += - + toReturn; +} +return toReturn; + } + + public boolean isPretty() { +return isPretty; + } +}
[gwt-contrib] [google-web-toolkit] r9953 committed - Cherry picking r9948 for UiBinder.useSafeHtmlTemplates
Revision: 9953 Author: rj...@google.com Date: Thu Apr 7 03:48:02 2011 Log: Cherry picking r9948 for UiBinder.useSafeHtmlTemplates http://code.google.com/p/google-web-toolkit/source/detail?r=9953 Modified: /releases/2.3/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml /releases/2.3/user/src/com/google/gwt/uibinder/elementparsers/AttributeMessageInterpreter.java /releases/2.3/user/src/com/google/gwt/uibinder/elementparsers/WidgetInterpreter.java /releases/2.3/user/src/com/google/gwt/uibinder/elementparsers/WidgetPlaceholderInterpreter.java /releases/2.3/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java /releases/2.3/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java /releases/2.3/user/test/com/google/gwt/uibinder/elementparsers/MockUiBinderWriter.java === --- /releases/2.3/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml Wed Feb 9 13:31:48 2011 +++ /releases/2.3/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml Thu Apr 7 03:48:02 2011 @@ -18,9 +18,19 @@ source path=client/ source path=resources/ + !-- Pluggable factory for creating field types for HTML elements -- - define-configuration-property name=uibinder.html.elementfactory is-multi-valued=false/ + define-configuration-property name=uibinder.html.elementfactory is-multi-valued=false/ set-configuration-property name=uibinder.html.elementfactory value=com.google.gwt.uibinder.rebind.GwtDomHtmlElementFactory/ + + !-- By default UiBinder implementations are generated to use SafeHtmlTemplates +to help protect against the introduction of cross-site scripting (XSS) attacks. +This deprecated property can be used to disable that integration while the +kinks are worked out. Its use is strongly discouraged, and the property will +be removed in the near future. -- + define-configuration-property name=UiBinder.useSafeHtmlTemplates is-multi-valued=false/ + set-configuration-property name=UiBinder.useSafeHtmlTemplates value=true/ + generate-with class=com.google.gwt.uibinder.rebind.UiBinderGenerator when-type-assignable class=com.google.gwt.uibinder.client.UiBinder/ /generate-with === --- /releases/2.3/user/src/com/google/gwt/uibinder/elementparsers/AttributeMessageInterpreter.java Wed Mar 9 09:01:28 2011 +++ /releases/2.3/user/src/com/google/gwt/uibinder/elementparsers/AttributeMessageInterpreter.java Thu Apr 7 03:48:02 2011 @@ -46,8 +46,16 @@ throws UnableToCompleteException { MessagesWriter messages = writer.getMessages(); for (AttributeMessage am : messages.consumeAttributeMessages(elem)) { + String message = am.getMessageUnescaped(); + if (!writer.useSafeHtmlTemplates()) { +/* + * We have to do our own simple escaping to if the SafeHtml integration + * is off + */ +message += .replaceAll(\\, \amp;\).replaceAll(\'\, \#39;\); + } elem.setAttribute(am.getAttribute(), -writer.tokenForStringExpression(am.getMessageUnescaped())); +writer.tokenForStringExpression(message)); } /* === --- /releases/2.3/user/src/com/google/gwt/uibinder/elementparsers/WidgetInterpreter.java Wed Mar 9 09:01:28 2011 +++ /releases/2.3/user/src/com/google/gwt/uibinder/elementparsers/WidgetInterpreter.java Thu Apr 7 03:48:02 2011 @@ -91,8 +91,12 @@ // Create an element to hold the widget. String tag = getLegalPlaceholderTag(elem); - return + tag + id=' + uiWriter.tokenForStringExpression(idHolder) - + '/ + tag + ; + if (uiWriter.useSafeHtmlTemplates()) { +idHolder = uiWriter.tokenForStringExpression(idHolder); + } else { +idHolder = \ + + idHolder + + \; + } + return + tag + id=' + idHolder + '/ + tag + ; } return null; } === --- /releases/2.3/user/src/com/google/gwt/uibinder/elementparsers/WidgetPlaceholderInterpreter.java Wed Mar 9 09:01:28 2011 +++ /releases/2.3/user/src/com/google/gwt/uibinder/elementparsers/WidgetPlaceholderInterpreter.java Thu Apr 7 03:48:02 2011 @@ -55,8 +55,10 @@ * message. */ class WidgetPlaceholderInterpreter extends HtmlPlaceholderInterpreter { - // Could break this up into three further classes, for HasText, HasHTML - // and Other, but that seems more trouble than it's worth. + /* + * Could break this up into three further classes, for HasText, HasHTML and + * Other, but that seems more trouble than it's worth. + */ private int serial = 0; private final String ancestorExpression; @@ -132,8 +134,12 @@ } private String genOpenTag(String name, String idHolder) { -String openTag = String.format(span id='%s', -uiWriter.tokenForStringExpression(idHolder)); +if (uiWriter.useSafeHtmlTemplates()) { + idHolder =
[gwt-contrib] [google-web-toolkit] r9954 committed - Fixing a few Cell Widget bugs. I combined these bugs because they are ...
Revision: 9954 Author: jlaba...@google.com Date: Thu Apr 7 05:39:53 2011 Log: Fixing a few Cell Widget bugs. I combined these bugs because they are all quick fixes and fairly straightforward. (Issue 5971) CompositeCell does not implement isEditing. I implemented isEditing in CompositeCell. (Issue 5993) TextInputCell and EditTextCell double escape values before putting them into text boxes. We no longer use the SafeHtmlRenderer to render the content of the input value, as input values are always treat their values as text. SafeHtml isn't valid in an attribute context. Selecting a range in a CellTable only works on the first page. DefaultSelectionEventManager now correctly subtracts the page start index when getting the selected values from the CellTable. Non-bubbling events (change/load/error/focus/blur) aren't captured in CellTable in IE9. Switched IE9 to use the StandardBase implementation, which is much simpler and works for IE9. Review at http://gwt-code-reviews.appspot.com/1408801 Review by: fabio...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9954 Added: /trunk/user/src/com/google/gwt/user/cellview/client/CellBasedWidgetImplStandardBase.java Deleted: /trunk/user/src/com/google/gwt/user/cellview/client/CellBasedWidgetImplSafari.java Modified: /trunk/tools/api-checker/config/gwt22_23userApi.conf /trunk/user/src/com/google/gwt/cell/client/CompositeCell.java /trunk/user/src/com/google/gwt/cell/client/EditTextCell.java /trunk/user/src/com/google/gwt/cell/client/TextInputCell.java /trunk/user/src/com/google/gwt/user/cellview/CellView.gwt.xml /trunk/user/src/com/google/gwt/view/client/DefaultSelectionEventManager.java /trunk/user/test/com/google/gwt/cell/client/CompositeCellTest.java /trunk/user/test/com/google/gwt/cell/client/EditTextCellTest.java /trunk/user/test/com/google/gwt/cell/client/TextInputCellTest.java /trunk/user/test/com/google/gwt/view/client/DefaultSelectionEventManagerTest.java === --- /dev/null +++ /trunk/user/src/com/google/gwt/user/cellview/client/CellBasedWidgetImplStandardBase.java Thu Apr 7 05:39:53 2011 @@ -0,0 +1,31 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.user.cellview.client; + +import com.google.gwt.core.client.Scheduler; +import com.google.gwt.core.client.Scheduler.ScheduledCommand; + +/** + * StandardBase implementation of {@link CellBasedWidgetImpl}. + */ +public class CellBasedWidgetImplStandardBase extends CellBasedWidgetImplStandard { + + @Override + public void resetFocus(ScheduledCommand command) { +// Some browsers will not focus an element that was created in this event loop. +Scheduler.get().scheduleDeferred(command); + } +} === --- /trunk/user/src/com/google/gwt/user/cellview/client/CellBasedWidgetImplSafari.java Wed Oct 13 12:59:56 2010 +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the License); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.user.cellview.client; - -import com.google.gwt.core.client.Scheduler; -import com.google.gwt.core.client.Scheduler.ScheduledCommand; - -/** - * Webkit specified Impl used by cell based widgets. - */ -public class CellBasedWidgetImplSafari extends CellBasedWidgetImplStandard { - - @Override - public void resetFocus(ScheduledCommand command) { -// Webkit will not focus an element that was created in this event loop. -Scheduler.get().scheduleDeferred(command); - } -} === --- /trunk/tools/api-checker/config/gwt22_23userApi.conf Tue Apr 5 10:47:39 2011 +++ /trunk/tools/api-checker/config/gwt22_23userApi.conf Thu Apr 7 05:39:53 2011 @@ -119,3 +119,5 @@ # Overloaded SimplePanel constructor to accept a Widget.
[gwt-contrib] [google-web-toolkit] r9956 committed - Cherry picking r9954 into releases/2.3 for issues 5971, 5993, and 6134...
Revision: 9956 Author: jlaba...@google.com Date: Thu Apr 7 07:38:23 2011 Log: Cherry picking r9954 into releases/2.3 for issues 5971, 5993, and 6134. http://code.google.com/p/google-web-toolkit/source/detail?r=9956 Added: /releases/2.3/user/src/com/google/gwt/user/cellview/client/CellBasedWidgetImplStandardBase.java Deleted: /releases/2.3/user/src/com/google/gwt/user/cellview/client/CellBasedWidgetImplSafari.java Modified: /releases/2.3/tools/api-checker/config/gwt22_23userApi.conf /releases/2.3/user/src/com/google/gwt/cell/client/CompositeCell.java /releases/2.3/user/src/com/google/gwt/cell/client/EditTextCell.java /releases/2.3/user/src/com/google/gwt/cell/client/TextInputCell.java /releases/2.3/user/src/com/google/gwt/user/cellview/CellView.gwt.xml /releases/2.3/user/src/com/google/gwt/view/client/DefaultSelectionEventManager.java /releases/2.3/user/test/com/google/gwt/cell/client/CompositeCellTest.java /releases/2.3/user/test/com/google/gwt/cell/client/EditTextCellTest.java /releases/2.3/user/test/com/google/gwt/cell/client/TextInputCellTest.java /releases/2.3/user/test/com/google/gwt/view/client/DefaultSelectionEventManagerTest.java === --- /dev/null +++ /releases/2.3/user/src/com/google/gwt/user/cellview/client/CellBasedWidgetImplStandardBase.java Thu Apr 7 07:38:23 2011 @@ -0,0 +1,31 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.user.cellview.client; + +import com.google.gwt.core.client.Scheduler; +import com.google.gwt.core.client.Scheduler.ScheduledCommand; + +/** + * StandardBase implementation of {@link CellBasedWidgetImpl}. + */ +public class CellBasedWidgetImplStandardBase extends CellBasedWidgetImplStandard { + + @Override + public void resetFocus(ScheduledCommand command) { +// Some browsers will not focus an element that was created in this event loop. +Scheduler.get().scheduleDeferred(command); + } +} === --- /releases/2.3/user/src/com/google/gwt/user/cellview/client/CellBasedWidgetImplSafari.java Wed Oct 13 12:59:56 2010 +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the License); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.user.cellview.client; - -import com.google.gwt.core.client.Scheduler; -import com.google.gwt.core.client.Scheduler.ScheduledCommand; - -/** - * Webkit specified Impl used by cell based widgets. - */ -public class CellBasedWidgetImplSafari extends CellBasedWidgetImplStandard { - - @Override - public void resetFocus(ScheduledCommand command) { -// Webkit will not focus an element that was created in this event loop. -Scheduler.get().scheduleDeferred(command); - } -} === --- /releases/2.3/tools/api-checker/config/gwt22_23userApi.conf Thu Mar 3 07:14:17 2011 +++ /releases/2.3/tools/api-checker/config/gwt22_23userApi.conf Thu Apr 7 07:38:23 2011 @@ -123,3 +123,5 @@ # Overloaded SimplePanel constructor to accept a Widget. com.google.gwt.user.client.ui.SimplePanel::SimplePanel(Lcom/google/gwt/dom/client/Element;) OVERLOADED_METHOD_CALL +# Renamed CellBasedWidgetImplSafari to CellBasedWidgetImplStandardBase. +com.google.gwt.user.cellview.client.CellBasedWidgetImplSafari MISSING === --- /releases/2.3/user/src/com/google/gwt/cell/client/CompositeCell.java Wed Dec 1 05:40:20 2010 +++ /releases/2.3/user/src/com/google/gwt/cell/client/CompositeCell.java Thu Apr 7 07:38:23 2011 @@ -111,6 +111,18 @@ public boolean handlesSelection() { return handlesSelection; } + + @Override + public boolean isEditing(Context context, Element parent, C value) { +Element curChild = getContainerElement(parent).getFirstChildElement(); +for (HasCellC, ? hasCell : hasCells) { + if
[gwt-contrib] [google-web-toolkit] r9957 committed - Change the default of UiBinder.useSafeHtmlTemplates to false...
Revision: 9957 Author: rj...@google.com Date: Thu Apr 7 08:40:59 2011 Log: Change the default of UiBinder.useSafeHtmlTemplates to false for gwt 2.3 Review by: sbruba...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9957 Modified: /releases/2.3/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml /releases/2.3/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java === --- /releases/2.3/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml Thu Apr 7 03:48:02 2011 +++ /releases/2.3/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml Thu Apr 7 08:40:59 2011 @@ -23,13 +23,13 @@ define-configuration-property name=uibinder.html.elementfactory is-multi-valued=false/ set-configuration-property name=uibinder.html.elementfactory value=com.google.gwt.uibinder.rebind.GwtDomHtmlElementFactory/ - !-- By default UiBinder implementations are generated to use SafeHtmlTemplates -to help protect against the introduction of cross-site scripting (XSS) attacks. -This deprecated property can be used to disable that integration while the -kinks are worked out. Its use is strongly discouraged, and the property will -be removed in the near future. -- - define-configuration-property name=UiBinder.useSafeHtmlTemplates is-multi-valued=false/ - set-configuration-property name=UiBinder.useSafeHtmlTemplates value=true/ + !-- Set this property to true to turn on UiBinder's new + SafeHtmlTemplates integration. The default value will be true in + future releases of GWT -- + define-configuration-property name=UiBinder.useSafeHtmlTemplates + is-multi-valued=false/ + set-configuration-property name=UiBinder.useSafeHtmlTemplates + value=false/ generate-with class=com.google.gwt.uibinder.rebind.UiBinderGenerator when-type-assignable class=com.google.gwt.uibinder.client.UiBinder/ === --- /releases/2.3/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java Thu Apr 7 03:48:02 2011 +++ /releases/2.3/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java Thu Apr 7 08:40:59 2011 @@ -51,6 +51,8 @@ private static final String ELEMENT_FACTORY_PROPERTY = uibinder.html.elementfactory; private static final String XSS_SAFE_CONFIG_PROPERTY = UiBinder.useSafeHtmlTemplates; + + private static boolean xssWarningGiven = false; /** * Given a UiBinder interface, return the path to its ui.xml file, suitable @@ -218,10 +220,12 @@ Boolean rtn = Boolean.valueOf(value); -if (!rtn) { +if (!rtn !xssWarningGiven) { logger.warn(Configuration property %s is false! UiBinder SafeHtml integration is off, - + leaving your users more vulnerable to cross-site scripting attacks., + + leaving your users more vulnerable to cross-site scripting attacks. This + + property will default to true in future releases of GWT., XSS_SAFE_CONFIG_PROPERTY); + xssWarningGiven = true; } return rtn; } -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9959 committed - Don't allow constants folding and copy propagation optimizations to pe...
Revision: 9959 Author: gwt.mirror...@gmail.com Date: Thu Apr 7 13:47:10 2011 Log: Don't allow constants folding and copy propagation optimizations to perform implicit type conversions. Review by: r...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9959 Modified: /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/constants/ConstantsFlowFunction.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/copy/CopyFlowFunction.java /trunk/dev/core/test/com/google/gwt/dev/jjs/impl/gflow/DataflowOptimizerTest.java /trunk/dev/core/test/com/google/gwt/dev/jjs/impl/gflow/constants/ConstantsAnalysisTransformationTest.java /trunk/dev/core/test/com/google/gwt/dev/jjs/impl/gflow/copy/CopyAnalysisTransformationTest.java === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/constants/ConstantsFlowFunction.java Tue Mar 9 10:54:56 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/constants/ConstantsFlowFunction.java Thu Apr 7 13:47:10 2011 @@ -18,6 +18,7 @@ import com.google.gwt.dev.jjs.ast.JBooleanLiteral; import com.google.gwt.dev.jjs.ast.JExpression; import com.google.gwt.dev.jjs.ast.JLocal; +import com.google.gwt.dev.jjs.ast.JNullLiteral; import com.google.gwt.dev.jjs.ast.JParameter; import com.google.gwt.dev.jjs.ast.JValueLiteral; import com.google.gwt.dev.jjs.ast.JVariable; @@ -106,7 +107,14 @@ if (expression != null) { JValueLiteral valueLiteral = ExpressionEvaluator.evaluate(expression, assumption.unwrap()); -assumption.set(var, valueLiteral); +if (valueLiteral != null +(valueLiteral.getType() == var.getType() || + valueLiteral instanceof JNullLiteral)) { + assumption.set(var, valueLiteral); +} else { + // Don't bother to try to get conversions right. + assumption.set(var, null); +} } else { assumption.set(var, null); } === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/copy/CopyFlowFunction.java Tue Mar 9 10:54:56 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/gflow/copy/CopyFlowFunction.java Thu Apr 7 13:47:10 2011 @@ -66,7 +66,8 @@ if (original != targetVariable) { result.kill(targetVariable); - if (isSupportedVar(original)) { + if (isSupportedVar(original) + original.getType() == targetVariable.getType()) { result.addCopy(original, targetVariable); } } else { === --- /trunk/dev/core/test/com/google/gwt/dev/jjs/impl/gflow/DataflowOptimizerTest.java Thu Sep 9 00:20:17 2010 +++ /trunk/dev/core/test/com/google/gwt/dev/jjs/impl/gflow/DataflowOptimizerTest.java Thu Apr 7 13:47:10 2011 @@ -261,6 +261,20 @@ return results; ); } + + public void testImplicitConversion() throws Exception { +optimize(long, +int bar = 0x12345678;, +bar = bar * 1234;, +long lng = bar;, +long lng8 = lng 8;, +return lng8; +).into( + int bar;, + long lng = -1068970384;, + long lng8 = lng 8;, + return lng8;); + } @Override protected boolean optimizeMethod(JProgram program, JMethod method) { === --- /trunk/dev/core/test/com/google/gwt/dev/jjs/impl/gflow/constants/ConstantsAnalysisTransformationTest.java Mon Jun 7 12:20:31 2010 +++ /trunk/dev/core/test/com/google/gwt/dev/jjs/impl/gflow/constants/ConstantsAnalysisTransformationTest.java Thu Apr 7 13:47:10 2011 @@ -134,6 +134,21 @@ transform(boolean, String s = baz(); if (s == null) return false; return s != null;).into( String s = EntryPoint.baz();, if (s == null), return false;, return s != null;); } + + public void testImplicitCasts() throws Exception { +transform(long, +int bar = 0x12345678;, +bar = bar * 1234;, +long lng = bar;, +long lng8 = lng 8;, +return lng8; +).into( + int bar = 305419896;, + bar = -1068970384;, + long lng = -1068970384;, + long lng8 = lng 8;, + return lng8;); + } @Override protected IntegratedAnalysisCfgNode?, CfgEdge, CfgTransformer, Cfg, === --- /trunk/dev/core/test/com/google/gwt/dev/jjs/impl/gflow/copy/CopyAnalysisTransformationTest.java Fri Apr 2 14:35:01 2010 +++ /trunk/dev/core/test/com/google/gwt/dev/jjs/impl/gflow/copy/CopyAnalysisTransformationTest.java Thu Apr 7 13:47:10 2011 @@ -61,6 +61,21 @@ i = i;, return i;); } + + public void testImplicitConversion() throws Exception { +transform(long, +int bar = 0x12345678;, +bar =
[gwt-contrib] [google-web-toolkit] r9960 committed - Updating Showcase to use LayoutPanels throughout the hierarchy, thus i...
Revision: 9960 Author: gwt.mirror...@gmail.com Date: Thu Apr 7 14:18:12 2011 Log: Updating Showcase to use LayoutPanels throughout the hierarchy, thus implementing ProvidesResize down to the examples. This allows the examples to look better, especially examples that implement RequiresResize. Most of the example look the same, but TabLayoutPanel and SplitLayoutPanel now take up a larger area to illustrate how they would be used in most apps. This change Also modifies ContentWidget to use SafeHtml instead of a String html for the example descriptions, and fixes some warnings in Showcase. Review at http://gwt-code-reviews.appspot.com/1409801 Review by: p...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9960 Modified: /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidget.java /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidgetView.java /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidgetView.ui.xml /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.java /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.ui.xml /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/ContactDatabase.java /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellSampler.java /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/ShowMorePagerPanel.java /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/content/other/CwCookies.java /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwAbsolutePanel.java /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwDockPanel.java /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwSplitLayoutPanel.java /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwTabLayoutPanel.java === --- /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidget.java Mon Feb 28 08:19:11 2011 +++ /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidget.java Thu Apr 7 14:18:12 2011 @@ -1,12 +1,12 @@ /* * Copyright 2008 Google Inc. - * + * * Licensed under the Apache License, Version 2.0 (the License); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -26,9 +26,11 @@ import com.google.gwt.http.client.RequestException; import com.google.gwt.http.client.Response; import com.google.gwt.i18n.client.LocaleInfo; +import com.google.gwt.safehtml.shared.SafeHtml; +import com.google.gwt.safehtml.shared.SafeHtmlUtils; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.AsyncCallback; -import com.google.gwt.user.client.ui.LazyPanel; +import com.google.gwt.user.client.ui.SimpleLayoutPanel; import com.google.gwt.user.client.ui.Widget; import java.util.ArrayList; @@ -48,12 +50,12 @@ * and css tabs are loaded using an RPC call to the server. * /p */ -public abstract class ContentWidget extends LazyPanel -implements HasValueChangeHandlersString { +public abstract class ContentWidget extends SimpleLayoutPanel implements +HasValueChangeHandlersString { /** * Generic callback used for asynchronously loaded data. - * + * * @param T the data type */ public static interface CallbackT { @@ -64,7 +66,7 @@ /** * Get the simple filename of a class. - * + * * @param c the class */ protected static String getSimpleName(Class? c) { @@ -75,7 +77,7 @@ /** * A description of the example. */ - private final String description; + private final SafeHtml description; /** * True if this example has associated styles, false if not. @@ -125,13 +127,25 @@ /** * Construct a {@link ContentWidget}. - * - * @param name the name of the example - * @param description a description of the example + * + * @param name the text name of the example + * @param description a text description of the example * @param hasStyle true if the example has associated styles * @param rawSourceFiles the list of raw source files to include */ - public ContentWidget(String name, String description, boolean hasStyle, + public ContentWidget(String name, String description, boolean hasStyle, String... rawSourceFiles) { +this(name, SafeHtmlUtils.fromString(description), hasStyle, rawSourceFiles); + } + + /** + * Construct a {@link
[gwt-contrib] [google-web-toolkit] r9961 committed - Fixing issue 6206 (CellWidget#getValue() is never updated) and 6216 (C...
Revision: 9961 Author: jlaba...@google.com Date: Thu Apr 7 10:52:25 2011 Log: Fixing issue 6206 (CellWidget#getValue() is never updated) and 6216 (CellWidget should implement IsEditorC). Review at http://gwt-code-reviews.appspot.com/1400802/. Issue: 6206, 6216 Patch by: tbroyer Review by: jlabanca http://code.google.com/p/google-web-toolkit/source/detail?r=9961 Modified: /trunk/user/src/com/google/gwt/user/cellview/CellView.gwt.xml /trunk/user/src/com/google/gwt/user/cellview/client/CellWidget.java /trunk/user/test/com/google/gwt/user/cellview/client/CellWidgetTest.java === --- /trunk/user/src/com/google/gwt/user/cellview/CellView.gwt.xml Thu Apr 7 05:39:53 2011 +++ /trunk/user/src/com/google/gwt/user/cellview/CellView.gwt.xml Thu Apr 7 10:52:25 2011 @@ -16,6 +16,7 @@ module inherits name=com.google.gwt.user.User/ inherits name=com.google.gwt.cell.Cell/ + inherits name=com.google.gwt.editor.Editor/ inherits name=com.google.gwt.view.View/ inherits name=com.google.gwt.user.UserAgent/ source path=client/ === --- /trunk/user/src/com/google/gwt/user/cellview/client/CellWidget.java Thu Mar 24 07:36:36 2011 +++ /trunk/user/src/com/google/gwt/user/cellview/client/CellWidget.java Thu Apr 7 10:52:25 2011 @@ -21,6 +21,9 @@ import com.google.gwt.dom.client.Document; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.editor.client.IsEditor; +import com.google.gwt.editor.client.LeafValueEditor; +import com.google.gwt.editor.client.adapters.TakesValueEditor; import com.google.gwt.event.logical.shared.ValueChangeEvent; import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.event.shared.HandlerRegistration; @@ -37,7 +40,8 @@ * * @param C the type that the Cell represents */ -public class CellWidgetC extends Widget implements HasKeyProviderC, HasValueC { +public class CellWidgetC extends Widget implements HasKeyProviderC, HasValueC, +IsEditorLeafValueEditorC { /** * Create the default element used to wrap the Cell. The default element is a @@ -56,6 +60,11 @@ */ private final CellC cell; + /** + * For use with the editor framework. + */ + private LeafValueEditorC editor; + /** * The key provider for the value. */ @@ -71,7 +80,8 @@ */ private final ValueUpdaterC valueUpdater = new ValueUpdaterC() { public void update(C value) { - ValueChangeEvent.fire(CellWidget.this, value); + // no need to redraw, the Cell took care of it + setValue(value, true, false); } }; @@ -139,6 +149,13 @@ public HandlerRegistration addValueChangeHandler(ValueChangeHandlerC handler) { return addHandler(handler, ValueChangeEvent.getType()); } + + public LeafValueEditorC asEditor() { +if (editor == null) { + editor = TakesValueEditor.of(this); +} +return editor; + } /** * Get the {@link Cell} wrapped by this widget. === --- /trunk/user/test/com/google/gwt/user/cellview/client/CellWidgetTest.java Thu Mar 24 07:36:36 2011 +++ /trunk/user/test/com/google/gwt/user/cellview/client/CellWidgetTest.java Thu Apr 7 10:52:25 2011 @@ -117,6 +117,7 @@ cw.onBrowserEvent(event); cell.assertLastEventKey(test); cell.assertLastEventValue(test); +assertEquals(newValue, cw.getValue()); } public void testOnBrowserEventWithKeyProvider() { @@ -135,6 +136,7 @@ cw.onBrowserEvent(event); cell.assertLastEventKey(t); cell.assertLastEventValue(test); +assertEquals(newValue, cw.getValue()); } public void testOnBrowserEventWithValueChangeHandler() { @@ -152,6 +154,7 @@ cell.assertLastEventKey(test); cell.assertLastEventValue(test); handler.assertLastValue(newValue); +assertEquals(newValue, cw.getValue()); } /** -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9962 committed - Cherry picking r9961 into releases/2.3 for issues 6206 and 6216.
Revision: 9962 Author: gwt.mirror...@gmail.com Date: Thu Apr 7 16:16:56 2011 Log: Cherry picking r9961 into releases/2.3 for issues 6206 and 6216. http://code.google.com/p/google-web-toolkit/source/detail?r=9962 Modified: /releases/2.3/user/src/com/google/gwt/user/cellview/CellView.gwt.xml /releases/2.3/user/src/com/google/gwt/user/cellview/client/CellWidget.java /releases/2.3/user/test/com/google/gwt/user/cellview/client/CellWidgetTest.java === --- /releases/2.3/user/src/com/google/gwt/user/cellview/CellView.gwt.xml Thu Apr 7 07:38:23 2011 +++ /releases/2.3/user/src/com/google/gwt/user/cellview/CellView.gwt.xml Thu Apr 7 16:16:56 2011 @@ -16,6 +16,7 @@ module inherits name=com.google.gwt.user.User/ inherits name=com.google.gwt.cell.Cell/ + inherits name=com.google.gwt.editor.Editor/ inherits name=com.google.gwt.view.View/ inherits name=com.google.gwt.user.UserAgent/ source path=client/ === --- /releases/2.3/user/src/com/google/gwt/user/cellview/client/CellWidget.java Mon Dec 13 11:55:24 2010 +++ /releases/2.3/user/src/com/google/gwt/user/cellview/client/CellWidget.java Thu Apr 7 16:16:56 2011 @@ -20,6 +20,10 @@ import com.google.gwt.cell.client.ValueUpdater; import com.google.gwt.dom.client.Document; import com.google.gwt.dom.client.Element; + +import com.google.gwt.editor.client.IsEditor; +import com.google.gwt.editor.client.LeafValueEditor; +import com.google.gwt.editor.client.adapters.TakesValueEditor; import com.google.gwt.event.logical.shared.ValueChangeEvent; import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.event.shared.HandlerRegistration; @@ -36,8 +40,8 @@ * * @param C the type that the Cell represents */ -public class CellWidgetC extends Widget implements HasKeyProviderC, -HasValueC { +public class CellWidgetC extends Widget implements HasKeyProviderC, HasValueC, +IsEditorLeafValueEditorC { /** * Create the default element used to wrap the Cell. The default element is a @@ -56,6 +60,11 @@ */ private final CellC cell; + /** + * For use with the editor framework. + */ + private LeafValueEditorC editor; + /** * The key provider for the value. */ @@ -71,7 +80,8 @@ */ private final ValueUpdaterC valueUpdater = new ValueUpdaterC() { public void update(C value) { - ValueChangeEvent.fire(CellWidget.this, value); + // no need to redraw, the Cell took care of it + setValue(value, true, false); } }; @@ -140,6 +150,13 @@ public HandlerRegistration addValueChangeHandler(ValueChangeHandlerC handler) { return addHandler(handler, ValueChangeEvent.getType()); } + + public LeafValueEditorC asEditor() { +if (editor == null) { + editor = TakesValueEditor.of(this); +} +return editor; + } /** * Get the {@link Cell} wrapped by this widget. === --- /releases/2.3/user/test/com/google/gwt/user/cellview/client/CellWidgetTest.java Mon Dec 13 11:55:24 2010 +++ /releases/2.3/user/test/com/google/gwt/user/cellview/client/CellWidgetTest.java Thu Apr 7 16:16:56 2011 @@ -115,6 +115,7 @@ cw.onBrowserEvent(event); cell.assertLastEventKey(test); cell.assertLastEventValue(test); +assertEquals(newValue, cw.getValue()); } public void testOnBrowserEventWithKeyProvider() { @@ -134,6 +135,7 @@ cw.onBrowserEvent(event); cell.assertLastEventKey(t); cell.assertLastEventValue(test); +assertEquals(newValue, cw.getValue()); } public void testOnBrowserEventWithValueChangeHandler() { @@ -151,6 +153,7 @@ cell.assertLastEventKey(test); cell.assertLastEventValue(test); handler.assertLastValue(newValue); +assertEquals(newValue, cw.getValue()); } public void testRedraw() { -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9963 committed - Some small refactors to Css Resource Generation...
Revision: 9963 Author: unn...@google.com Date: Thu Apr 7 11:55:26 2011 Log: Some small refactors to Css Resource Generation Review at http://gwt-code-reviews.appspot.com/1406802 http://code.google.com/p/google-web-toolkit/source/detail?r=9963 Added: /trunk/user/src/com/google/gwt/resources/client/CssResourceBase.java /trunk/user/src/com/google/gwt/resources/rg/CssObfuscationStyle.java Modified: /trunk/user/src/com/google/gwt/resources/client/CssResource.java /trunk/user/src/com/google/gwt/resources/rg/CssResourceGenerator.java /trunk/user/test/com/google/gwt/resources/rg/CssTestCase.java === --- /dev/null +++ /trunk/user/src/com/google/gwt/resources/client/CssResourceBase.java Thu Apr 7 11:55:26 2011 @@ -0,0 +1,24 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.resources.client; + +/** + * Marker interface for all classes that should be obfuscated together in + * Css Resource generation. + * TODO(unnurg): Try to get rid of the global obfuscation scheme and delete + * this interface. + */ +public interface CssResourceBase extends ResourcePrototype { } === --- /dev/null +++ /trunk/user/src/com/google/gwt/resources/rg/CssObfuscationStyle.java Thu Apr 7 11:55:26 2011 @@ -0,0 +1,91 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.resources.rg; + +import com.google.gwt.core.ext.typeinfo.JClassType; + +/** + * Evaluates the obfuscation style the user selected and formats the obfuscated + * name accordingly. + */ +public enum CssObfuscationStyle { + VERBOSE (true, false, true, true), + STABLE_FULL_CLASSNAME (true, true, true, true), + STABLE_SHORT_CLASSNAME (true, true, true, false), + STABLE_NO_CLASSNAME (true, true, false, false), + OBFUSCATED (false, false, false, false); + + static CssObfuscationStyle getObfuscationStyle(String name) { +if (name.equalsIgnoreCase(pretty)) { + return VERBOSE; +} else if (name.equalsIgnoreCase(stable)) { + return STABLE_FULL_CLASSNAME; +} else if (name.equalsIgnoreCase(stable-shorttype)) { + return STABLE_SHORT_CLASSNAME; +} else if (name.equalsIgnoreCase(stable-notype)) { + return STABLE_NO_CLASSNAME; +} +return OBFUSCATED; + } + + private boolean isPretty; + private boolean isStable; + private boolean showClassName; + private boolean showPackageName; + + CssObfuscationStyle(boolean isPretty, boolean isStable, boolean showClassName, + boolean showPackageName) { +this.isPretty = isPretty; +this.isStable = isStable; +this.showClassName = showClassName; +this.showPackageName = showPackageName; + } + + public String getPrettyName(String method, JClassType type, String obfuscatedName) { +if (!isPretty()) { + return obfuscatedName; +} +String toReturn = method; + +/* + * Note that by dropping the type, or using it's short name, you are + * allowing name collisions in the css selector names. These options should + * only be used if you are sure that your GWT application is ensuring that + * there are no namespace collisions. + */ +if (showClassName) { + if (showPackageName) { +toReturn = type.getQualifiedSourceName().replaceAll([.$], -) + - + toReturn; + } else { +toReturn = type.getName() + - + toReturn; + } +} + +/* + * For stable styles the obfuscated class name is dropped from the pretty + * output. This results in class names that are constant, no matter how + * many other selectors are added. + */ +if (!isStable) { + toReturn = obfuscatedName += - + toReturn; +} +return toReturn; + } + + public boolean isPretty() { +return isPretty; + } +} === ---
[gwt-contrib] [google-web-toolkit] r9948 committed - Temporarily introduces configuration property UiBinder.useSafeHtmlTemp...
Revision: 9948 Author: rj...@google.com Date: Wed Apr 6 03:31:11 2011 Log: Temporarily introduces configuration property UiBinder.useSafeHtmlTemplates to allow UiBinder's SafeHtml integration to be disabled while the last couple of kinks are worked out. Review at http://gwt-code-reviews.appspot.com/1402801 Review by: sbruba...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9948 Modified: /trunk/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml /trunk/user/src/com/google/gwt/uibinder/elementparsers/AttributeMessageInterpreter.java /trunk/user/src/com/google/gwt/uibinder/elementparsers/WidgetInterpreter.java /trunk/user/src/com/google/gwt/uibinder/elementparsers/WidgetPlaceholderInterpreter.java /trunk/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java /trunk/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java /trunk/user/test/com/google/gwt/uibinder/elementparsers/MockUiBinderWriter.java === --- /trunk/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml Wed Feb 9 13:31:48 2011 +++ /trunk/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml Wed Apr 6 03:31:11 2011 @@ -18,9 +18,19 @@ source path=client/ source path=resources/ + !-- Pluggable factory for creating field types for HTML elements -- - define-configuration-property name=uibinder.html.elementfactory is-multi-valued=false/ + define-configuration-property name=uibinder.html.elementfactory is-multi-valued=false/ set-configuration-property name=uibinder.html.elementfactory value=com.google.gwt.uibinder.rebind.GwtDomHtmlElementFactory/ + + !-- By default UiBinder implementations are generated to use SafeHtmlTemplates +to help protect against the introduction of cross-site scripting (XSS) attacks. +This deprecated property can be used to disable that integration while the +kinks are worked out. Its use is strongly discouraged, and the property will +be removed in the near future. -- + define-configuration-property name=UiBinder.useSafeHtmlTemplates is-multi-valued=false/ + set-configuration-property name=UiBinder.useSafeHtmlTemplates value=true/ + generate-with class=com.google.gwt.uibinder.rebind.UiBinderGenerator when-type-assignable class=com.google.gwt.uibinder.client.UiBinder/ /generate-with === --- /trunk/user/src/com/google/gwt/uibinder/elementparsers/AttributeMessageInterpreter.java Wed Mar 9 09:01:28 2011 +++ /trunk/user/src/com/google/gwt/uibinder/elementparsers/AttributeMessageInterpreter.java Wed Apr 6 03:31:11 2011 @@ -46,8 +46,16 @@ throws UnableToCompleteException { MessagesWriter messages = writer.getMessages(); for (AttributeMessage am : messages.consumeAttributeMessages(elem)) { + String message = am.getMessageUnescaped(); + if (!writer.useSafeHtmlTemplates()) { +/* + * We have to do our own simple escaping to if the SafeHtml integration + * is off + */ +message += .replaceAll(\\, \amp;\).replaceAll(\'\, \#39;\); + } elem.setAttribute(am.getAttribute(), -writer.tokenForStringExpression(am.getMessageUnescaped())); +writer.tokenForStringExpression(message)); } /* === --- /trunk/user/src/com/google/gwt/uibinder/elementparsers/WidgetInterpreter.java Wed Mar 9 09:01:28 2011 +++ /trunk/user/src/com/google/gwt/uibinder/elementparsers/WidgetInterpreter.java Wed Apr 6 03:31:11 2011 @@ -91,8 +91,12 @@ // Create an element to hold the widget. String tag = getLegalPlaceholderTag(elem); - return + tag + id=' + uiWriter.tokenForStringExpression(idHolder) - + '/ + tag + ; + if (uiWriter.useSafeHtmlTemplates()) { +idHolder = uiWriter.tokenForStringExpression(idHolder); + } else { +idHolder = \ + + idHolder + + \; + } + return + tag + id=' + idHolder + '/ + tag + ; } return null; } === --- /trunk/user/src/com/google/gwt/uibinder/elementparsers/WidgetPlaceholderInterpreter.java Wed Mar 9 09:01:28 2011 +++ /trunk/user/src/com/google/gwt/uibinder/elementparsers/WidgetPlaceholderInterpreter.java Wed Apr 6 03:31:11 2011 @@ -55,8 +55,10 @@ * message. */ class WidgetPlaceholderInterpreter extends HtmlPlaceholderInterpreter { - // Could break this up into three further classes, for HasText, HasHTML - // and Other, but that seems more trouble than it's worth. + /* + * Could break this up into three further classes, for HasText, HasHTML and + * Other, but that seems more trouble than it's worth. + */ private int serial = 0; private final String ancestorExpression; @@ -132,8 +134,12 @@ } private String genOpenTag(String name, String idHolder) { -String openTag = String.format(span id='%s', -
[gwt-contrib] [google-web-toolkit] r9949 committed - Reformat autobeans package to cut down on diff churn for lazy reificat...
Revision: 9949 Author: b...@google.com Date: Wed Apr 6 04:44:12 2011 Log: Reformat autobeans package to cut down on diff churn for lazy reification patch. Patch by: bobv Review by: rice Review at http://gwt-code-reviews.appspot.com/1407801 http://code.google.com/p/google-web-toolkit/source/detail?r=9949 Modified: /trunk/user/src/com/google/gwt/autobean/client/impl/AbstractAutoBeanFactory.java /trunk/user/src/com/google/gwt/autobean/client/impl/ClientPropertyContext.java /trunk/user/src/com/google/gwt/autobean/client/impl/JsniCreatorMap.java /trunk/user/src/com/google/gwt/autobean/client/impl/JsoSplittable.java /trunk/user/src/com/google/gwt/autobean/rebind/AutoBeanFactoryGenerator.java /trunk/user/src/com/google/gwt/autobean/server/AutoBeanFactoryMagic.java /trunk/user/src/com/google/gwt/autobean/server/Configuration.java /trunk/user/src/com/google/gwt/autobean/shared/AutoBeanCodex.java /trunk/user/src/com/google/gwt/autobean/shared/AutoBeanUtils.java /trunk/user/src/com/google/gwt/autobean/shared/AutoBeanVisitor.java === --- /trunk/user/src/com/google/gwt/autobean/client/impl/AbstractAutoBeanFactory.java Thu Mar 3 07:14:17 2011 +++ /trunk/user/src/com/google/gwt/autobean/client/impl/AbstractAutoBeanFactory.java Wed Apr 6 04:44:12 2011 @@ -26,8 +26,7 @@ /** * Provides base implementations of AutoBeanFactory methods. */ -public abstract class AbstractAutoBeanFactory implements AutoBeanFactory, -EnumMap { +public abstract class AbstractAutoBeanFactory implements AutoBeanFactory, EnumMap { protected MapEnum?, String enumToStringMap; // This map is almost always one-to-one === --- /trunk/user/src/com/google/gwt/autobean/client/impl/ClientPropertyContext.java Mon Mar 21 12:22:19 2011 +++ /trunk/user/src/com/google/gwt/autobean/client/impl/ClientPropertyContext.java Wed Apr 6 04:44:12 2011 @@ -64,8 +64,7 @@ this.paramCounts = null; } - public ClientPropertyContext(Object instance, Setter setter, - Class?[] types, int[] paramCounts) { + public ClientPropertyContext(Object instance, Setter setter, Class?[] types, int[] paramCounts) { this.instance = instance; this.setter = setter; this.simpleType = null; @@ -77,14 +76,14 @@ * plus one for the root type, equals the total number of types passed in. */ if (ClientPropertyContext.class.desiredAssertionStatus()) { - assert types.length == paramCounts.length : Length mismatch - + types.length + != + paramCounts.length; + assert types.length == paramCounts.length : Length mismatch + types.length + != + + paramCounts.length; int count = 1; for (int i = 0, j = paramCounts.length; i j; i++) { count += paramCounts[i]; } - assert count == types.length : Mismatch in total parameter count - + count + != + types.length; + assert count == types.length : Mismatch in total parameter count + count + != + + types.length; } } === --- /trunk/user/src/com/google/gwt/autobean/client/impl/JsniCreatorMap.java Thu Mar 3 07:14:17 2011 +++ /trunk/user/src/com/google/gwt/autobean/client/impl/JsniCreatorMap.java Wed Apr 6 04:44:12 2011 @@ -48,8 +48,7 @@ return null; } - public T AutoBeanT create(ClassT clazz, - AbstractAutoBeanFactory factory, Object delegate) { + public T AutoBeanT create(ClassT clazz, AbstractAutoBeanFactory factory, Object delegate) { JsArrayJavaScriptObject arr = get(clazz.getName()); if (arr != null) { assert arr.get(1) != null : No delegate-based constructor; @@ -62,8 +61,7 @@ return this[key]; }-*/; - private native T AutoBeanT invoke(JavaScriptObject fn, Object arg1, - Object arg2)/*-{ + private native T AutoBeanT invoke(JavaScriptObject fn, Object arg1, Object arg2)/*-{ return fn(arg1, arg2); }-*/; === --- /trunk/user/src/com/google/gwt/autobean/client/impl/JsoSplittable.java Wed Nov 24 12:33:58 2010 +++ /trunk/user/src/com/google/gwt/autobean/client/impl/JsoSplittable.java Wed Apr 6 04:44:12 2011 @@ -109,8 +109,7 @@ } public String getPayload() { -throw new UnsupportedOperationException( -Cannot convert JsoSplittable to payload); +throw new UnsupportedOperationException(Cannot convert JsoSplittable to payload); } public ListString getPropertyKeys() { @@ -136,7 +135,7 @@ }-*/; public native boolean isString() /*-{ -return typeof(this) == 'string' || this instanceof String; +return typeof (this) == 'string' || this instanceof String; }-*/; public native int size() /*-{ === --- /trunk/user/src/com/google/gwt/autobean/rebind/AutoBeanFactoryGenerator.java Thu Mar 3 07:14:17 2011 +++
[gwt-contrib] [google-web-toolkit] r9950 committed - Adding an empty interface to prevent the Google Plugin for Eclipse fro...
Revision: 9950 Author: schen...@google.com Date: Wed Apr 6 07:57:12 2011 Log: Adding an empty interface to prevent the Google Plugin for Eclipse from marking XsrfProtectedService as missing an Async class. Review at http://gwt-code-reviews.appspot.com/1386805 http://code.google.com/p/google-web-toolkit/source/detail?r=9950 Added: /trunk/user/src/com/google/gwt/user/client/rpc/XsrfProtectedServiceAsync.java === --- /dev/null +++ /trunk/user/src/com/google/gwt/user/client/rpc/XsrfProtectedServiceAsync.java Wed Apr 6 07:57:12 2011 @@ -0,0 +1,22 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.user.client.rpc; + +/** + * Async peer of {@link XsrfProtectedService}. + */ +public interface XsrfProtectedServiceAsync { +} -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9951 committed - Cherry picking r9950 into releases/2.3m1. http://gwt-code-reviews.apps...
Revision: 9951 Author: schen...@google.com Date: Wed Apr 6 09:03:10 2011 Log: Cherry picking r9950 into releases/2.3m1. http://gwt-code-reviews.appspot.com/1386805/ http://code.google.com/p/google-web-toolkit/source/detail?r=9951 Added: /releases/2.3/user/src/com/google/gwt/user/client/rpc/XsrfProtectedServiceAsync.java === --- /dev/null +++ /releases/2.3/user/src/com/google/gwt/user/client/rpc/XsrfProtectedServiceAsync.java Wed Apr 6 09:03:10 2011 @@ -0,0 +1,22 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.user.client.rpc; + +/** + * Async peer of {@link XsrfProtectedService}. + */ +public interface XsrfProtectedServiceAsync { +} -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9952 committed - Change RequestFactoryMagic - RequestFactorySource in comment...
Revision: 9952 Author: r...@google.com Date: Wed Apr 6 10:54:18 2011 Log: Change RequestFactoryMagic - RequestFactorySource in comment Review at http://gwt-code-reviews.appspot.com/1406801 Review by: robertvaw...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9952 Modified: /trunk/user/src/com/google/web/bindery/requestfactory/server/testing/InProcessRequestTransport.java === --- /trunk/user/src/com/google/web/bindery/requestfactory/server/testing/InProcessRequestTransport.java Tue Apr 5 10:47:39 2011 +++ /trunk/user/src/com/google/web/bindery/requestfactory/server/testing/InProcessRequestTransport.java Wed Apr 6 10:54:18 2011 @@ -28,7 +28,7 @@ * ServiceLayer serviceLayer = ServiceLayer.create(); * SimpleRequestProcessor processor = new SimpleRequestProcessor(serviceLayer); * EventBus eventBus = new SimpleEventBus(); - * MyRequestFactory f = RequestFactoryMagic.create(MyRequestFactory.class); + * MyRequestFactory f = RequestFactorySource.create(MyRequestFactory.class); * f.initialize(eventBus, new InProcessRequestTransport(processor)); * /pre * -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Comment on CodeSplitting in google-web-toolkit
Comment by boj...@gmail.com: However philosophically we speak, the fact is software will be modular. GWT promotes building huge monolithic apps with no inherent plugability. If you don't realize and fix this sooner, GWT will be on its death bed. OSGi is getting so much focus that it would be childish to ignore these concerns. For more information: http://code.google.com/p/google-web-toolkit/wiki/CodeSplitting -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9940 committed - Supress errors when building the Type Oracle....
Revision: 9940 Author: gwt.mirror...@gmail.com Date: Tue Apr 5 06:11:45 2011 Log: Supress errors when building the Type Oracle. This patch supresses errors (turns them into TRACE and DEBUG level log messages) during the TypeOracle build. When building the AST, if an error is encountered, the CompilationState (or global CompilationStateBuilder cache) is consulted to find any errors in a type that has a problem, or any dependencies of that type. Review at http://gwt-code-reviews.appspot.com/1385810 http://code.google.com/p/google-web-toolkit/source/detail?r=9940 Added: /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java Modified: /trunk/dev/core/src/com/google/gwt/dev/DevModeBase.java /trunk/dev/core/src/com/google/gwt/dev/Precompile.java /trunk/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenTypeAssignableTo.java /trunk/dev/core/src/com/google/gwt/dev/cfg/DeferredBindingQuery.java /trunk/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java /trunk/dev/core/src/com/google/gwt/dev/cfg/Rule.java /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationUnitInvalidator.java /trunk/dev/core/src/com/google/gwt/dev/javac/Dependencies.java /trunk/dev/core/src/com/google/gwt/dev/javac/StandardGeneratorContext.java /trunk/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java /trunk/dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java /trunk/dev/core/src/com/google/gwt/dev/util/Util.java /trunk/dev/core/test/com/google/gwt/dev/cfg/ConditionTest.java /trunk/dev/core/test/com/google/gwt/dev/javac/CompilationStateTestBase.java /trunk/dev/core/test/com/google/gwt/dev/javac/MemoryUnitCacheTest.java /trunk/dev/core/test/com/google/gwt/dev/javac/MockCompilationUnit.java /trunk/dev/core/test/com/google/gwt/dev/javac/TypeOracleTestingUtils.java /trunk/dev/core/test/com/google/gwt/dev/jjs/impl/RunAsyncNameTest.java /trunk/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiContainer.java /trunk/user/src/com/google/gwt/junit/JUnitShell.java === --- /dev/null +++ /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java Tue Apr 5 06:11:45 2011 @@ -0,0 +1,302 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.dev.javac; + +import com.google.gwt.core.ext.TreeLogger; +import com.google.gwt.core.ext.TreeLogger.HelpInfo; +import com.google.gwt.core.ext.TreeLogger.Type; +import com.google.gwt.dev.util.Messages; +import com.google.gwt.dev.util.Util; + +import org.eclipse.jdt.core.compiler.CategorizedProblem; + +import java.io.File; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.Map; +import java.util.Queue; +import java.util.Set; + +/** + * Handles some details of reporting errors in {@link CompilationUnit}s to the + * console. + */ +public class CompilationProblemReporter { + + /** + * Used to lazily retrieve source if needed for reporting an error. + */ + public interface SourceFetcher { +String getSource(); + } + + /** + * Provides a meaningful error message when a type is missing from the {@link + * import com.google.gwt.core.ext.typeinfo.TypeOracle} or + * {@link com.google.gwt.dev.shell.CompilingClassLoader}. + * + * @param logger logger for logging errors to the console + * @param missingType The qualified source name of the type to report + * @param unitMap if available, pass + * {@link CompilationState#getCompilationUnitMap()}. + */ + public static void logMissingTypeErrorWithHints(TreeLogger logger, String missingType, + CompilationState compilationState) { +logDependentErrors(logger, missingType, compilationState); +logger = logger.branch(TreeLogger.ERROR, Unable to find type ' + missingType + ', null); + +ClassLoader cl = Thread.currentThread().getContextClassLoader(); + +URL sourceURL = Util.findSourceInClassPath(cl, missingType); +if (sourceURL != null) { + if (missingType.indexOf(.client.) != -1) { +Messages.HINT_PRIOR_COMPILER_ERRORS.log(logger, null); +Messages.HINT_CHECK_MODULE_INHERITANCE.log(logger, null); + } else { +// Give the best possible hint here. +// +
[gwt-contrib] [google-web-toolkit] r9941 committed - Cherry picking r1388803 into releases/2.3
Revision: 9941 Author: scheg...@google.com Date: Tue Apr 5 04:21:42 2011 Log: Cherry picking r1388803 into releases/2.3 http://code.google.com/p/google-web-toolkit/source/detail?r=9941 Modified: /releases/2.3/dev/core/src/com/google/gwt/dev/resource/impl/ResourceOracleImpl.java /releases/2.3/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileClassPathEntry.java /releases/2.3/dev/core/test/com/google/gwt/dev/resource/impl/AbstractResourceOrientedTestBase.java /releases/2.3/dev/core/test/com/google/gwt/dev/resource/impl/ResourceOracleImplTest.java === --- /releases/2.3/dev/core/src/com/google/gwt/dev/resource/impl/ResourceOracleImpl.java Thu Feb 10 07:58:19 2011 +++ /releases/2.3/dev/core/src/com/google/gwt/dev/resource/impl/ResourceOracleImpl.java Tue Apr 5 04:21:42 2011 @@ -156,14 +156,14 @@ if (f.isDirectory()) { return new DirectoryClassPathEntry(f); } else if (f.isFile() lowerCaseFileName.endsWith(.jar)) { -return new ZipFileClassPathEntry(f); +return ZipFileClassPathEntry.get(f); } else if (f.isFile() lowerCaseFileName.endsWith(.zip)) { -return new ZipFileClassPathEntry(f); +return ZipFileClassPathEntry.get(f); } else { // It's a file ending in neither jar nor zip, speculatively try to // open as jar/zip anyway. try { - return new ZipFileClassPathEntry(f); + return ZipFileClassPathEntry.get(f); } catch (Exception ignored) { } logger.log(TreeLogger.TRACE, Unexpected entry in classpath; + f === --- /releases/2.3/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileClassPathEntry.java Fri Apr 1 11:16:55 2011 +++ /releases/2.3/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileClassPathEntry.java Tue Apr 5 04:21:42 2011 @@ -22,6 +22,10 @@ import com.google.gwt.dev.util.collect.Sets; import com.google.gwt.dev.util.msg.Message1String; +import org.apache.commons.collections.map.AbstractReferenceMap; +import org.apache.commons.collections.map.ReferenceIdentityMap; +import org.apache.commons.collections.map.ReferenceMap; + import java.io.File; import java.io.IOException; import java.util.Enumeration; @@ -65,19 +69,47 @@ this.cachedAnswers = cachedAnswers; } } + + /** + * Memory-sensitive cache of indexed {@link ZipFileClassPathEntry}s. URI of file is most probably + * not referenced anywhere else, so we use hard reference, and soft reference on + * {@link ZipFileClassPathEntry} allows its clearing in response to memory demand. + */ + @SuppressWarnings(unchecked) + private static final MapString, ZipFileClassPathEntry entryCache = new ReferenceMap( + AbstractReferenceMap.HARD, AbstractReferenceMap.SOFT); + + /** + * @return the {@link ZipFileClassPathEntry} instance for given jar or zip + * file, may be shared with other users. + */ + public static synchronized ZipFileClassPathEntry get(File zipFile) throws IOException { +String location = zipFile.toURI().toString(); +ZipFileClassPathEntry entry = entryCache.get(location); +if (entry == null) { + entry = new ZipFileClassPathEntry(zipFile); + entryCache.put(location, entry); +} +return entry; + } private SetZipFileResource allZipFileResources; /** - * Currently gwt has just 2 ResourceOracles. + * The lifetime of the {@link PathPrefixSet} pins the life time of the associated + * {@link ZipFileSnapshot}; this is because the {@link PathPrefixSet} is referenced from module, + * and {@link ZipFileSnapshot} is not referenced anywhere outside of {@link ZipFileClassPathEntry} + * . When the module dies, the {@link ZipFileSnapshot} needs to die also. */ - private final MapPathPrefixSet, ZipFileSnapshot cachedSnapshots = new IdentityHashMapPathPrefixSet, ZipFileSnapshot(); + @SuppressWarnings(unchecked) + private final MapPathPrefixSet, ZipFileSnapshot cachedSnapshots = new ReferenceIdentityMap( + AbstractReferenceMap.WEAK, AbstractReferenceMap.HARD, true); private final String location; private final ZipFile zipFile; - public ZipFileClassPathEntry(File zipFile) throws IOException { + private ZipFileClassPathEntry(File zipFile) throws IOException { assert zipFile.isAbsolute(); this.zipFile = new ZipFile(zipFile); this.location = zipFile.toURI().toString(); @@ -87,7 +119,7 @@ * Indexes the zip file on-demand, and only once over the life of the process. */ @Override - public MapAbstractResource, PathPrefix findApplicableResources( + public synchronized MapAbstractResource, PathPrefix findApplicableResources( TreeLogger logger, PathPrefixSet pathPrefixSet) { index(logger); ZipFileSnapshot snapshot = cachedSnapshots.get(pathPrefixSet); === ---
[gwt-contrib] [google-web-toolkit] r9942 committed - cherry picking r9938 r9939 for release 2.3m1
Revision: 9942 Author: fabio...@google.com Date: Tue Apr 5 06:00:39 2011 Log: cherry picking r9938 r9939 for release 2.3m1 http://code.google.com/p/google-web-toolkit/source/detail?r=9942 Deleted: /releases/2.3/user/src/com/google/gwt/storage/client/StorageImplMozilla.java Modified: /releases/2.3/user/src/com/google/gwt/storage/Storage.gwt.xml /releases/2.3/user/src/com/google/gwt/storage/client/StorageImpl.java /releases/2.3/user/src/com/google/gwt/storage/client/StorageImplIE8.java /releases/2.3/user/test/com/google/gwt/user/client/WindowTest.java === --- /releases/2.3/user/src/com/google/gwt/storage/client/StorageImplMozilla.java Mon Mar 7 05:34:43 2011 +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the License); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.gwt.storage.client; - - -/** - * Mozilla-specific implementation of a Storage. - * - * p - * Implementation of StorageEvents is incomplete for Mozilla. This class amends - * the properties consistently with W3C's StorageEvent. - * /p - */ -class StorageImplMozilla extends StorageImplNonNativeEvents { - /* - * Firefox incorrectly handles indices outside the range of - * 0 to storage.length(). See bugzilla.mozilla.org/show_bug.cgi?id=50924 - */ - @Override - public native String key(String storage, int index) /*-{ -return (index = 0 index $wnd[storage].length) ? - $wnd[storage].key(index) : null; - }-*/; -} === --- /releases/2.3/user/src/com/google/gwt/storage/Storage.gwt.xml Fri Mar 11 09:47:37 2011 +++ /releases/2.3/user/src/com/google/gwt/storage/Storage.gwt.xml Tue Apr 5 06:00:39 2011 @@ -34,16 +34,12 @@ when-property-is name=storageSupport value=no / /replace-with - replace-with class=com.google.gwt.storage.client.StorageImplMozilla -when-type-is class=com.google.gwt.storage.client.StorageImpl / -when-property-is name=user.agent value=gecko1_8 / - /replace-with - replace-with class=com.google.gwt.storage.client.StorageImplNonNativeEvents when-type-is class=com.google.gwt.storage.client.StorageImpl / any when-property-is name=user.agent value=safari / when-property-is name=user.agent value=ie9 / + when-property-is name=user.agent value=gecko1_8 / /any /replace-with === --- /releases/2.3/user/src/com/google/gwt/storage/client/StorageImpl.java Mon Mar 7 05:34:43 2011 +++ /releases/2.3/user/src/com/google/gwt/storage/client/StorageImpl.java Tue Apr 5 06:00:39 2011 @@ -146,7 +146,13 @@ * Storage - Storage.key(n)/a */ public native String key(String storage, int index) /*-{ -return $wnd[storage].key(index); +// few browsers implement retrieval correctly when index is out of range. +// compensate to preserve API expectation. According to W3C Web Storage spec +// a href=http://www.w3.org/TR/webstorage/#dom-storage-key; +// If n is greater than or equal to the number of key/value pairs in the +// object, then this method must return null. +return (index = 0 index $wnd[storage].length) ? + $wnd[storage].key(index) : null; }-*/; /** === --- /releases/2.3/user/src/com/google/gwt/storage/client/StorageImplIE8.java Mon Mar 7 05:34:43 2011 +++ /releases/2.3/user/src/com/google/gwt/storage/client/StorageImplIE8.java Tue Apr 5 06:00:39 2011 @@ -24,17 +24,6 @@ * - Introduction to DOM Storage/a */ class StorageImplIE8 extends StorageImplNonNativeEvents { - /* - * IE8 will throw JavaScriptException: (Error): Invalid argument. for - * indices outside the range of 0 - storage.length(). In this impl method, we - * return null instead, in order to match the Storage spec. - */ - @Override - public native String key(String storage, int index) /*-{ -return (index = 0 index $wnd[storage].length) ? - $wnd[storage].key(index) : null; - }-*/; - /* * IE8 will throw Class doesn't support Automation error when comparing * $wnd[localStorage] === $wnd[localStorage]. In this impl method, we === --- /releases/2.3/user/test/com/google/gwt/user/client/WindowTest.java Tue Aug 10 10:18:55 2010 +++ /releases/2.3/user/test/com/google/gwt/user/client/WindowTest.java Tue Apr 5 06:00:39 2011 @@ -304,11 +304,16
[gwt-contrib] [google-web-toolkit] r9943 committed - Investigate test flakiness:...
Revision: 9943 Author: gaill...@google.com Date: Tue Apr 5 06:30:56 2011 Log: Investigate test flakiness: DevMode#doStartUpServer() fails from time to time (rarely) due to an unknown error. Adding some logging to pinpoint the problem Review at http://gwt-code-reviews.appspot.com/1401803 Review by: fabb...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9943 Modified: /trunk/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java === --- /trunk/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java Wed Jan 26 10:35:35 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java Tue Apr 5 06:30:56 2011 @@ -669,9 +669,21 @@ // Now that we're started, log to the top level logger. Log.setLog(new JettyTreeLogger(logger)); + +// DevMode#doStartUpServer() fails from time to time (rarely) due +// to an unknown error. Adding some logging to pinpoint the problem. +int connectorPort = connector.getLocalPort(); +if (connector.getLocalPort() 0) { + branch.log(TreeLogger.ERROR, String.format( + Failed to connect to open channel with port %d (return value %d), + port, connectorPort)); + if (connector.getConnection() == null ) { +branch.log(TreeLogger.TRACE, Connection is null); + } +} return createServletContainer(logger, appRootDir, server, wac, -connector.getLocalPort()); +connectorPort); } protected JettyServletContainer createServletContainer(TreeLogger logger, -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9944 committed - Add the beginnings of new HTML5 drag and drop events...
Revision: 9944 Author: gwt.mirror...@gmail.com Date: Tue Apr 5 08:03:17 2011 Log: Add the beginnings of new HTML5 drag and drop events Review at http://gwt-code-reviews.appspot.com/1398802 Review by: p...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9944 Added: /trunk/user/src/com/google/gwt/event/dom/client/DragEnterClickHandler.java /trunk/user/src/com/google/gwt/event/dom/client/DragEnterEvent.java /trunk/user/src/com/google/gwt/event/dom/client/DragEnterHandler.java /trunk/user/src/com/google/gwt/event/dom/client/DragExitEvent.java /trunk/user/src/com/google/gwt/event/dom/client/DragExitHandler.java /trunk/user/src/com/google/gwt/event/dom/client/DragOverEvent.java /trunk/user/src/com/google/gwt/event/dom/client/DragOverHandler.java /trunk/user/src/com/google/gwt/event/dom/client/DropEvent.java /trunk/user/src/com/google/gwt/event/dom/client/DropHandler.java /trunk/user/src/com/google/gwt/event/dom/client/HasAllDragAndDropHandlers.java /trunk/user/src/com/google/gwt/event/dom/client/HasDragEnterHandlers.java /trunk/user/src/com/google/gwt/event/dom/client/HasDragExitHandlers.java /trunk/user/src/com/google/gwt/event/dom/client/HasDragOverHandlers.java /trunk/user/src/com/google/gwt/event/dom/client/HasDropHandlers.java /trunk/user/test/com/google/gwt/user/client/DragAndDropEventsSinkTest.java Modified: /trunk/user/src/com/google/gwt/user/client/ui/FocusPanel.java /trunk/user/src/com/google/gwt/user/client/ui/FocusWidget.java /trunk/user/src/com/google/gwt/user/client/ui/HTMLTable.java /trunk/user/src/com/google/gwt/user/client/ui/Image.java /trunk/user/src/com/google/gwt/user/client/ui/Label.java /trunk/user/test/com/google/gwt/user/UISuite.java === --- /dev/null +++ /trunk/user/src/com/google/gwt/event/dom/client/DragEnterClickHandler.java Tue Apr 5 08:03:17 2011 @@ -0,0 +1,31 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.event.dom.client; + +import com.google.gwt.event.shared.EventHandler; + +/** + * Handler interface for {@link DragEnterEvent} events. + */ +public interface DragEnterClickHandler extends EventHandler { + + /** + * Called when a {@link DragEnterEvent} is fired. + * + * @param event the {@link DragEnterEvent} that was fired + */ + void onDoubleClick(DragEnterEvent event); +} === --- /dev/null +++ /trunk/user/src/com/google/gwt/event/dom/client/DragEnterEvent.java Tue Apr 5 08:03:17 2011 @@ -0,0 +1,57 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.event.dom.client; + +/** + * Represents a native drag enter event. + */ +public class DragEnterEvent extends DomEventDragEnterHandler { + + /** + * Event type for drag enter events. Represents the meta-data associated + * with this event. + */ + private static final TypeDragEnterHandler TYPE = new TypeDragEnterHandler( + dragenter, new DragEnterEvent()); + + /** + * Gets the event type associated with drag enter events. + * + * @return the handler type + */ + public static TypeDragEnterHandler getType() { +return TYPE; + } + + /** + * Protected constructor, use + * {@link DomEvent#fireNativeEvent(com.google.gwt.dom.client.NativeEvent, com.google.gwt.event.shared.HasHandlers)} + * to fire drag enter events. + */ + protected DragEnterEvent() { + } + + @Override + public final TypeDragEnterHandler getAssociatedType() { +return TYPE; + } + + @Override + protected void dispatch(DragEnterHandler handler) { +handler.onDragEnter(this); + } + +} === --- /dev/null +++ /trunk/user/src/com/google/gwt/event/dom/client/DragEnterHandler.java Tue Apr 5 08:03:17 2011 @@ -0,0 +1,31 @@ +/* + * Copyright 2011 Google Inc. + * + * Licensed under
[gwt-contrib] [google-web-toolkit] r9945 committed - Adds support for the URL_ATTRIBUTE_ENTIRE parse context to HtmlTemplat...
Revision: 9945 Author: x...@google.com Date: Tue Apr 5 09:01:35 2011 Log: Adds support for the URL_ATTRIBUTE_ENTIRE parse context to HtmlTemplateParser. Review at http://gwt-code-reviews.appspot.com/1396803 Review by: jlaba...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9945 Modified: /trunk/user/src/com/google/gwt/safehtml/rebind/HtmlTemplateParser.java /trunk/user/src/com/google/gwt/safehtml/rebind/ParsedHtmlTemplate.java /trunk/user/src/com/google/gwt/safehtml/rebind/SafeHtmlTemplatesImplMethodCreator.java /trunk/user/test/com/google/gwt/safehtml/rebind/HtmlTemplateParserTest.java /trunk/user/test/com/google/gwt/safehtml/rebind/ParsedHtmlTemplateTest.java === --- /trunk/user/src/com/google/gwt/safehtml/rebind/HtmlTemplateParser.java Tue Mar 29 12:27:56 2011 +++ /trunk/user/src/com/google/gwt/safehtml/rebind/HtmlTemplateParser.java Tue Apr 5 09:01:35 2011 @@ -32,7 +32,7 @@ * * p * This parser parses templates consisting of HTML markup, with template - * variables of the form {@code {n}}. For example, a template might look like, + * variables of the form {@code {n}}. For example, a template might look like, * * pre {@code * span style={0}a href={1}/{2}{3}/a/span @@ -70,10 +70,13 @@ * dt{@link HtmlContext.Type#TEXT} * ddThis context corresponds to basic inner text. In the above example, * parameter #3 would be tagged with this context. - * dt{@link HtmlContext.Type#URL_START} + * dt{@link HtmlContext.Type#URL_ATTRIBUTE_START} * ddThis context corresponds to a parameter that appears at the very start of * a URL-valued HTML attribute's value; in the above example this applies to * parameter #1. + * dt{@link HtmlContext.Type#URL_ATTRIBUTE_ENTIRE} + * ddThis context corresponds to a parameter that comprises an entire + * URL-valued attribute, for example in {@code img src='{0}'/}. * dt{@link HtmlContext.Type#CSS_ATTRIBUTE_START} * ddThis context corresponds to a parameter that appears at the very * beginning of a {@code style} attribute's value; in the above example this @@ -134,6 +137,18 @@ */ private int parsePosition; + /** + * The character preceding a template parameter, at the time a template + * parameter is being parsed. + */ + private char lookBehind; + + /** + * The character succeeding a template parameter, at the time a template + * parameter is being parsed. + */ + private char lookAhead; + /** * Creates a {@link HtmlTemplateParser}. * @@ -163,7 +178,9 @@ // @VisibleForTesting void parseTemplate(String template) throws UnableToCompleteException { this.template = template; -this.parsePosition = 0; +parsePosition = 0; +lookBehind = 0; +lookAhead = 0; Matcher match = TEMPLATE_PARAM_PATTERN.matcher(template); int endOfPreviousMatch = 0; @@ -174,10 +191,16 @@ parseAndAppendTemplateSegment( template.substring(endOfPreviousMatch, match.start())); parsePosition = match.start(); +lookBehind = template.charAt(parsePosition - 1); } int paramIndex = Integer.parseInt(match.group(1)); parsePosition = match.end(); + if (parsePosition template.length()) { +lookAhead = template.charAt(parsePosition); + } else { +lookAhead = 0; + } parsedTemplate.addParameter( new ParameterChunk(getHtmlContextFromParseState(), paramIndex)); @@ -255,8 +278,29 @@ + getTemplateParsedSoFar()); throw new UnableToCompleteException(); } + if (meta.equals(tag) content.equals(attribute)) { +logger.log(TreeLogger.ERROR, +Template variables in content attribute of meta tag are not supported: ++ getTemplateParsedSoFar()); +throw new UnableToCompleteException(); + } if (streamHtmlParser.isUrlStart()) { -return new HtmlContext(HtmlContext.Type.URL_START, tag, attribute); +// Note that we have established above that the attribute is quoted. +// Furthermore, we have ruled out template variables in the content +// attribute of a meta tag, which is the only case where isUrlStart() +// is true and the URL does not appear at the very beginning of the +// attribute. +Preconditions.checkState(lookBehind == '' || lookBehind == '\'', +At the start of a quoted attribute, lookBehind should be a quote character; at %s, +getTemplateParsedSoFar()); +// If the the character immediately succeeding the template parameter is +// a quote that matches the one that started the attribute, we know +// that the parameter comprises the entire attribute. +if (lookAhead == lookBehind) { + return new HtmlContext(HtmlContext.Type.URL_ATTRIBUTE_ENTIRE, tag, attribute); +} else { + return new
[gwt-contrib] [google-web-toolkit] r9947 committed - Fix build break...
Revision: 9947 Author: r...@google.com Date: Tue Apr 5 11:50:28 2011 Log: Fix build break Review at http://gwt-code-reviews.appspot.com/1404802 http://code.google.com/p/google-web-toolkit/source/detail?r=9947 Modified: /trunk/requestfactory/build.xml /trunk/user/src/com/google/web/bindery/requestfactory/RequestFactory.gwt.xml === --- /trunk/requestfactory/build.xml Tue Apr 5 10:47:39 2011 +++ /trunk/requestfactory/build.xml Tue Apr 5 11:50:28 2011 @@ -85,7 +85,7 @@ -- target name=test depends=requestfactory-test+src description=Run RequestFactoryJreSuite java failonerror=true fork=true - classname=com.google.web.bindery.requestfactory.RequestFactoryJreSuite + classname=com.google.web.bindery.requestfactory.vm.RequestFactoryJreSuite jvmarg value=-Xss8m / classpath fileset dir=${gwt.tools.lib} includes=tomcat/servlet-api-2.5.jar / === --- /trunk/user/src/com/google/web/bindery/requestfactory/RequestFactory.gwt.xml Tue Apr 5 10:47:39 2011 +++ /trunk/user/src/com/google/web/bindery/requestfactory/RequestFactory.gwt.xml Tue Apr 5 11:50:28 2011 @@ -22,9 +22,9 @@ inherits name='com.google.gwt.http.HTTP'/ inherits name='com.google.gwt.logging.LoggingDisabled'/ - source path=client/ + source path=gwt/client/ + source path=gwt/ui/client/ source path=shared/ - source path=ui/client/ super-source path=super / generate-with class=com.google.web.bindery.requestfactory.gwt.rebind.RequestFactoryEditorDriverGenerator -- http://groups.google.com/group/Google-Web-Toolkit-Contributors