[gwt-contrib] [google-web-toolkit] r9924 committed - tweaked Showcase to make it more testable...
Revision: 9924 Author: skybr...@google.com Date: Thu Mar 31 18:07:02 2011 Log: tweaked Showcase to make it more testable Review by: rj...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9924 Modified: /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.java === --- /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.java Fri Jan 7 10:19:06 2011 +++ /trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.java Thu Mar 31 18:07:02 2011 @@ -16,10 +16,10 @@ package com.google.gwt.sample.showcase.client; import com.google.gwt.core.client.GWT; +import com.google.gwt.dom.client.Style.Display; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.dom.client.TableCellElement; import com.google.gwt.dom.client.TableElement; -import com.google.gwt.dom.client.Style.Display; import com.google.gwt.event.dom.client.ChangeEvent; import com.google.gwt.event.dom.client.ChangeHandler; import com.google.gwt.event.dom.client.ClickEvent; @@ -28,8 +28,8 @@ import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.http.client.UrlBuilder; -import com.google.gwt.i18n.client.LocaleInfo; import com.google.gwt.i18n.client.HasDirection.Direction; +import com.google.gwt.i18n.client.LocaleInfo; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.cellview.client.CellTree; @@ -182,6 +182,7 @@ mainMenu = new CellTree(treeModel, null); mainMenu.setAnimationEnabled(true); mainMenu.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED); +mainMenu.ensureDebugId("mainMenu"); // Initialize the ui binder. initWidget(uiBinder.createAndBindUi(this)); @@ -222,6 +223,7 @@ }); // Default to no content. +contentPanel.ensureDebugId("contentPanel"); setContent(null); } @@ -306,6 +308,13 @@ // Show the widget. showExample(); } + + /** + * Returns the currently displayed content. (Used by tests.) + */ + public ContentWidget getContent() { +return content; + } /** * Initialize the {@link ListBox} used for locale selection. -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9923 committed - Add support for {#} to mean the right-most plural argument. Some...
Revision: 9923 Author: j...@google.com Date: Thu Mar 31 14:56:42 2011 Log: Add support for {#} to mean the right-most plural argument. Some translation systems, such as those which represent plural messages using ICU's plural syntax, lose the argument number and depending on the processing pipeline it may be hard to add it back. Providing {#} provides a way to use those messages for GWT translations without having to do a lot of extra work to use them. Public review at http://gwt-code-reviews.appspot.com/1385809/ Patch by: jat Review by: rjrjr http://code.google.com/p/google-web-toolkit/source/detail?r=9923 Added: /trunk/user/test/com/google/gwt/i18n/client/I18N_en_US_Test.java /trunk/user/test/com/google/gwt/i18n/client/TestAnnotatedMessages_en_US.properties Modified: /trunk/user/src/com/google/gwt/i18n/rebind/MessageFormatParser.java /trunk/user/src/com/google/gwt/i18n/rebind/MessagesMethodCreator.java /trunk/user/src/com/google/gwt/i18n/server/MessageFormatUtils.java /trunk/user/test/com/google/gwt/i18n/I18NSuite.java /trunk/user/test/com/google/gwt/i18n/client/TestAnnotatedMessages.java /trunk/user/test/com/google/gwt/i18n/server/MessageFormatParserTest.java === --- /dev/null +++ /trunk/user/test/com/google/gwt/i18n/client/I18N_en_US_Test.java Thu Mar 31 14:56:42 2011 @@ -0,0 +1,309 @@ +/* + * 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.i18n.client; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.i18n.client.TestAnnotatedMessages.Gender; +import com.google.gwt.junit.client.GWTTestCase; +import com.google.gwt.safehtml.shared.SafeHtml; +import com.google.gwt.safehtml.shared.SafeHtmlBuilder; + +import java.util.ArrayList; +import java.util.List; + +/** + * Test the same things as I18NTest but with a different module which + * uses different locales. + */ +public class I18N_en_US_Test extends GWTTestCase { + + @Override + public String getModuleName() { +return "com.google.gwt.i18n.I18NTest_en"; + } + + /** + * Verifies correct output for multiple, nested selectors, using an enum + * for gender selection (and SafeHtml output). + */ + public void testMultiSelectEnum() { +TestAnnotatedMessages m = GWT.create(TestAnnotatedMessages.class); +List names = new ArrayList(); + +// empty list of names +assertEquals("test: Nobody liked his message", +m.multiSelectEnum(names, names.size() > 0 ? names.get(0) : null, +names.size() > 1 ? names.get(1) : null, 1, Gender.MALE).asString()); +assertEquals("test: Nobody liked his 2 messages", +m.multiSelectEnum(names, names.size() > 0 ? names.get(0) : null, +names.size() > 1 ? names.get(1) : null, 2, Gender.MALE).asString()); +assertEquals("test: Nobody liked her message", +m.multiSelectEnum(names, names.size() > 0 ? names.get(0) : null, +names.size() > 1 ? names.get(1) : null, 1, Gender.FEMALE).asString()); +assertEquals("test: Nobody liked her 3 messages", +m.multiSelectEnum(names, names.size() > 0 ? names.get(0) : null, +names.size() > 1 ? names.get(1) : null, 3, Gender.FEMALE).asString()); +assertEquals("test: Nobody liked their message", +m.multiSelectEnum(names, names.size() > 0 ? names.get(0) : null, +names.size() > 1 ? names.get(1) : null, 1, null).asString()); +assertEquals("test: Nobody liked their 4 messages", +m.multiSelectEnum(names, names.size() > 0 ? names.get(0) : null, +names.size() > 1 ? names.get(1) : null, 4, Gender.UNKNOWN).asString()); + +// one name +names.add("John"); +assertEquals("test: John liked his message", +m.multiSelectEnum(names, names.size() > 0 ? names.get(0) : null, +names.size() > 1 ? names.get(1) : null, 1, Gender.MALE).asString()); +assertEquals("test: John liked his 2 messages", +m.multiSelectEnum(names, names.size() > 0 ? names.get(0) : null, +names.size() > 1 ? names.get(1) : null, 2, Gender.MALE).asString()); +assertEquals("test: John liked her message", +m.multiSelectEnum(names, names.size() > 0 ? names.get(0) : null, +names.size() > 1 ? names.get(1) : null, 1, Gender.FEMALE).asString()); +assertEquals("test: John liked her 3 messages", +m.multiSelectEnum(names, names.size() > 0 ? names.get(0) : null, +names.size()
Re: [gwt-contrib] What do you think of adding bidi support to LayoutPanel
Huh, I must be doing something wrong then in my test implementations because layouts etc aren't being switched even though images are being swapped when picking the ar locale. I'll have to investigate deeper into showcase. Thanks. On Thu, Mar 31, 2011 at 4:49 PM, Ray Ryan wrote: > The LayoutPanels' already swap properly in RTL locales, don't they? > > http://gwt.google.com/samples/Showcase/Showcase.html?locale=ar_YE > http://gwt.google.com/samples/Showcase/Showcase.html?locale=en > > On Thu, Mar 31, 2011 at 2:33 PM, Jeff Larsen wrote: > >> In some instances, it would be nice to have LayoutPanel swap left and >> right. I was thinking of something like adding a >> >> private boolean bidi = false; >> >> public void setWidgetLeftWidth(Widget child, double left, Unit leftUnit, >> double width, >> Unit widthUnit) { >> assertIsChild(child); >> if (bidi && isRtl()) { >> getLayer(child).setRightWidth(left, leftUnit, width, widthUnit); >> } else { >> getLayer(child).setLeftWidth(left, leftUnit, width, widthUnit); >> } >> animate(0); >> } >> >> >> public void setBidiEnabled(boolean enable){ >>bidi = enable; >> } >> >> etc etc etc. >> >> What do you guys think? This would allow for future enhancements like >> making TabLayoutPanel bidi enabled, where the tabs appear on the right side >> and work their way left instead of on the starting on the left and being >> added to the left. >> >> -- >> http://groups.google.com/group/Google-Web-Toolkit-Contributors > > > -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Supress errors when building the Type Oracle. (issue1385810)
On Thu, Mar 31, 2011 at 7:42 PM, Scott Blum wrote: > On Thu, Mar 31, 2011 at 7:38 PM, Eric Ayers wrote: >> >> It was kind of disruptive to pass the suppressErrors setting around >> through method parameters. I assume that's what you're talking about. > > Yeah. > >> >> The good thing about logging inside of CompilationStateBuilder is that >> there is a concious decision about what to do with errors when you >> build the CompliationState. > > Yeah, but this sort of flips it around and says, "If you want errors, log > them." I was more concerned with, "this build failed silently. waah!" I'll sleep on it >> >> Another small >> wrinkle is that in JavaToJavaScript compiler we've ditched the >> CompilationState to save memory before the time we want to report >> errors (but we could always just keep it or some subset of the data >> and log them at a TRACE/DEBUG level like this patch does.) > > The new translator stuff I'm working on is going to get rid of that code > path, however. It will work a lot more like CompilingClassLoader, and > explicitly log errors one unit at a time as you need to reference a unit > that had errors. The compilation state will have to be around until after > we have the AST built out. > Scott > -- Eric Z. Ayers Google Web Toolkit, Atlanta, GA USA -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Supress errors when building the Type Oracle. (issue1385810)
On Thu, Mar 31, 2011 at 7:38 PM, Eric Ayers wrote: > It was kind of disruptive to pass the suppressErrors setting around > through method parameters. I assume that's what you're talking about. > Yeah. > The good thing about logging inside of CompilationStateBuilder is that > there is a concious decision about what to do with errors when you > build the CompliationState. Yeah, but this sort of flips it around and says, "If you want errors, log them." > Another small > wrinkle is that in JavaToJavaScript compiler we've ditched the > CompilationState to save memory before the time we want to report > errors (but we could always just keep it or some subset of the data > and log them at a TRACE/DEBUG level like this patch does.) The new translator stuff I'm working on is going to get rid of that code path, however. It will work a lot more like CompilingClassLoader, and explicitly log errors one unit at a time as you need to reference a unit that had errors. The compilation state will have to be around until after we have the AST built out. Scott -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Supress errors when building the Type Oracle. (issue1385810)
On Thu, Mar 31, 2011 at 6:35 PM, wrote: > > http://gwt-code-reviews.appspot.com/1385810/diff/13011/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java > File dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java (right): > > http://gwt-code-reviews.appspot.com/1385810/diff/13011/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java#newcode323 > dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java:323: public > synchronized CompilationState getCompilationState(TreeLogger logger, > boolean suppressErrors) > Ouch... this is a far-reaching change. :( One that makes me begin to > wonder if the compilation state build should directly log errors at all. > > A different way to refactor, one I've thought about in the past, would > be to never have errors get logged from the comp state build, and always > have the caller log errors if desired, either by exposing a method on > CompState or else making CompUnit.getErrors public. This would remove > the whole burden of error reporting from CompState and remove the need > for the crazy threading of option strict all the way through the system. > > Thoughts, before I look at this in more detail? > > http://gwt-code-reviews.appspot.com/1385810/ > It was kind of disruptive to pass the suppressErrors setting around through method parameters. I assume that's what you're talking about. The good thing about logging inside of CompilationStateBuilder is that there is a concious decision about what to do with errors when you build the CompliationState. If you're going to move the burden outside of CSB, I think the patch might look just as disruptive if you were to log errors every place I passed 'false'. Another small wrinkle is that in JavaToJavaScript compiler we've ditched the CompilationState to save memory before the time we want to report errors (but we could always just keep it or some subset of the data and log them at a TRACE/DEBUG level like this patch does.) -- Eric Z. Ayers Google Web Toolkit, Atlanta, GA USA -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Adding table rendering tests to micro benchmarks. Table rendering tests are multiple orders of m... (issue1394802)
LGTM On Thu, Mar 31, 2011 at 3:40 PM, wrote: > http://gwt-code-reviews.appspot.com/1394802/ > -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Adding table rendering tests to micro benchmarks. Table rendering tests are multiple orders of m... (issue1394802)
http://gwt-code-reviews.appspot.com/1394802/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Adding table rendering tests to micro benchmarks. Table rendering tests are multiple orders of m... (issue1394802)
http://gwt-code-reviews.appspot.com/1394802/diff/1/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableInnerHtml.java File reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableInnerHtml.java (right): http://gwt-code-reviews.appspot.com/1394802/diff/1/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableInnerHtml.java#newcode28 reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableInnerHtml.java:28: + " table via innerHTML, no widgets"); On 2011/03/31 21:45:18, rjrjr wrote: might make it clearer that this is using a string builder on the client (like the current cell widget), not a big static string like the other one. done I also wonder if you should add another benchmark like this one that uses SafeHtmlBuilder rather than StringBuilder. Good chance to see if we're paying an additional tax for that. I'll be running more benchmarks. Can I add that benchmark after submitting this change? http://gwt-code-reviews.appspot.com/1394802/diff/1/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/WidgetCreation.java File reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/WidgetCreation.java (right): http://gwt-code-reviews.appspot.com/1394802/diff/1/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/WidgetCreation.java#newcode141 reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/WidgetCreation.java:141: FlowPanel largeWidget = new FlowPanel(); On 2011/03/31 21:45:18, rjrjr wrote: why create it if includeLargeWidget is false? done And the reason was so I could remove it later without checking whether the checkbox was checked. http://gwt-code-reviews.appspot.com/1394802/diff/1/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/WidgetCreation.java#newcode198 reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/WidgetCreation.java:198: root.remove(largeWidget); On 2011/03/31 21:45:18, rjrjr wrote: you don't always add it, but you always remove it. done But it was safe because we always created it, and #remove() exits early if the root isn't the parent of largeWidget. http://gwt-code-reviews.appspot.com/1394802/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Supress errors when building the Type Oracle. (issue1385810)
http://gwt-code-reviews.appspot.com/1385810/diff/13011/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java File dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java (right): http://gwt-code-reviews.appspot.com/1385810/diff/13011/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java#newcode323 dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java:323: public synchronized CompilationState getCompilationState(TreeLogger logger, boolean suppressErrors) Ouch... this is a far-reaching change. :( One that makes me begin to wonder if the compilation state build should directly log errors at all. A different way to refactor, one I've thought about in the past, would be to never have errors get logged from the comp state build, and always have the caller log errors if desired, either by exposing a method on CompState or else making CompUnit.getErrors public. This would remove the whole burden of error reporting from CompState and remove the need for the crazy threading of option strict all the way through the system. Thoughts, before I look at this in more detail? http://gwt-code-reviews.appspot.com/1385810/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9922 committed - Adding Bart Guijt to CLA Signers list. Manual CLA signed and on file.
Revision: 9922 Author: jlaba...@google.com Date: Thu Mar 31 15:17:46 2011 Log: Adding Bart Guijt to CLA Signers list. Manual CLA signed and on file. http://code.google.com/p/google-web-toolkit/source/detail?r=9922 Modified: /CLA-SIGNERS === --- /CLA-SIGNERSThu Mar 24 10:59:59 2011 +++ /CLA-SIGNERSThu Mar 31 15:17:46 2011 @@ -3,6 +3,7 @@ alexander.epsht...@gmail.com (Alexander Epshteyn) alex.tkachman (Alexander Tkachman) +bgu...@gmail.com (Bart Guijt) btay...@rackspace.com (Bryan Taylor) dannydaemo...@gmail.com (Daniel Valenzuela) david.no...@gmail.com (David Nouls) -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Supress errors when building the Type Oracle. (issue1385810)
I found some add'l problems while addressing a couple of Scott's nits. I wasn't handling writing errors in -strict mode and found that when running JUnit dev mode tests, one of my changes added even more spam than before! JavaToJavaScriptCompiler error reporting is now going through CompilationProblemReporter too. http://gwt-code-reviews.appspot.com/1385810/diff/8012/dev/core/src/com/google/gwt/dev/cfg/DeferredBindingQuery.java File dev/core/src/com/google/gwt/dev/cfg/DeferredBindingQuery.java (right): http://gwt-code-reviews.appspot.com/1385810/diff/8012/dev/core/src/com/google/gwt/dev/cfg/DeferredBindingQuery.java#newcode49 dev/core/src/com/google/gwt/dev/cfg/DeferredBindingQuery.java:49: TypeOracle typeOracle, String testType, CompilationState compilationState) { On 2011/03/29 23:08:06, scottb wrote: Nit, could remove the typeOracle param and field, since it's just compState.getTypeOracle(). Done. http://gwt-code-reviews.appspot.com/1385810/diff/8012/dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java File dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java (right): http://gwt-code-reviews.appspot.com/1385810/diff/8012/dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java#newcode46 dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java:46: private static class UnitDependencyTraverser { this inner class seemed smart when there were 2 different sources of units, but it just obscures things when there is only one kind of map, so I unrolled it back into a single method. http://gwt-code-reviews.appspot.com/1385810/diff/8012/dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java#newcode74 dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java:74: while (toVisit.peek() != null) { On 2011/03/29 23:08:06, scottb wrote: !toVisit.isEmpty() I was avoiding it because I thought it was a new in 1.6, but turns out it isn't. http://gwt-code-reviews.appspot.com/1385810/diff/8012/dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java#newcode107 dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java:107: final Map unitMap) { On 2011/03/29 23:08:06, scottb wrote: Since this method and logMissingTypeErrorWithHints() are both public, they should probably either both take a CompilationState or both take the unit map. for consistentcy. I'm not sure we need this version at all. Getting rid of it caused me to find some additional issues and refactor a bit. http://gwt-code-reviews.appspot.com/1385810/diff/8012/dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java#newcode163 dev/core/src/com/google/gwt/dev/javac/CompilationProblemReporter.java:163: String typeName) { On 2011/03/29 23:08:06, scottb wrote: private? Done. http://gwt-code-reviews.appspot.com/1385810/diff/8012/dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java File dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java (right): http://gwt-code-reviews.appspot.com/1385810/diff/8012/dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java#newcode1238 dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java:1238: CompilationProblemReporter.logErrorsRelatedToMissingType(logger, className, compilationState this was too chatty. The classloader calls findClass() multiple times in different ways for the same class, so a failure of this method isn't necessarily fatal. CompilationStateBuilder eventually catches this case. http://gwt-code-reviews.appspot.com/1385810/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] What do you think of adding bidi support to LayoutPanel
The LayoutPanels' already swap properly in RTL locales, don't they? http://gwt.google.com/samples/Showcase/Showcase.html?locale=ar_YE http://gwt.google.com/samples/Showcase/Showcase.html?locale=en On Thu, Mar 31, 2011 at 2:33 PM, Jeff Larsen wrote: > In some instances, it would be nice to have LayoutPanel swap left and > right. I was thinking of something like adding a > > private boolean bidi = false; > > public void setWidgetLeftWidth(Widget child, double left, Unit leftUnit, > double width, > Unit widthUnit) { > assertIsChild(child); > if (bidi && isRtl()) { > getLayer(child).setRightWidth(left, leftUnit, width, widthUnit); > } else { > getLayer(child).setLeftWidth(left, leftUnit, width, widthUnit); > } > animate(0); > } > > > public void setBidiEnabled(boolean enable){ >bidi = enable; > } > > etc etc etc. > > What do you guys think? This would allow for future enhancements like > making TabLayoutPanel bidi enabled, where the tabs appear on the right side > and work their way left instead of on the starting on the left and being > added to the left. > > -- > http://groups.google.com/group/Google-Web-Toolkit-Contributors -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Adding table rendering tests to micro benchmarks. Table rendering tests are multiple orders of m... (issue1394802)
http://gwt-code-reviews.appspot.com/1394802/diff/1/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableInnerHtml.java File reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableInnerHtml.java (right): http://gwt-code-reviews.appspot.com/1394802/diff/1/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableInnerHtml.java#newcode28 reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableInnerHtml.java:28: + " table via innerHTML, no widgets"); might make it clearer that this is using a string builder on the client (like the current cell widget), not a big static string like the other one. I also wonder if you should add another benchmark like this one that uses SafeHtmlBuilder rather than StringBuilder. Good chance to see if we're paying an additional tax for that. http://gwt-code-reviews.appspot.com/1394802/diff/1/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/WidgetCreation.java File reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/WidgetCreation.java (right): http://gwt-code-reviews.appspot.com/1394802/diff/1/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/WidgetCreation.java#newcode141 reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/WidgetCreation.java:141: FlowPanel largeWidget = new FlowPanel(); why create it if includeLargeWidget is false? http://gwt-code-reviews.appspot.com/1394802/diff/1/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/WidgetCreation.java#newcode198 reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/WidgetCreation.java:198: root.remove(largeWidget); you don't always add it, but you always remove it. http://gwt-code-reviews.appspot.com/1394802/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] What do you think of adding bidi support to LayoutPanel
In some instances, it would be nice to have LayoutPanel swap left and right. I was thinking of something like adding a private boolean bidi = false; public void setWidgetLeftWidth(Widget child, double left, Unit leftUnit, double width, Unit widthUnit) { assertIsChild(child); if (bidi && isRtl()) { getLayer(child).setRightWidth(left, leftUnit, width, widthUnit); } else { getLayer(child).setLeftWidth(left, leftUnit, width, widthUnit); } animate(0); } public void setBidiEnabled(boolean enable){ bidi = enable; } etc etc etc. What do you guys think? This would allow for future enhancements like making TabLayoutPanel bidi enabled, where the tabs appear on the right side and work their way left instead of on the starting on the left and being added to the left. -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Add support for {#} to mean the inner-most plural argument. Some (issue1385809)
As we discussed, looks good if you can document just what "#" resolves to, why one would use it, and avoid the "inner-most" term. http://gwt-code-reviews.appspot.com/1385809/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Adds support for the URL_ATTRIBUTE_ENTIRE parse context to HtmlTemplateParser. (issue1396803)
LGTM http://gwt-code-reviews.appspot.com/1396803/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Adds a no-op emulation of TestSuite, to prevent error spam (or outright (issue1399803)
Reviewers: fabbott, Description: Adds a no-op emulation of TestSuite, to prevent error spam (or outright failure under -strict mode) in web mode tests that accidentally pick the things up in their class path. Please review this at http://gwt-code-reviews.appspot.com/1399803/ Affected files: A user/super/com/google/gwt/junit/translatable/junit/framework/TestSuite.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Adding table rendering tests to micro benchmarks. Table rendering tests are multiple orders of m... (issue1394802)
Or do I mean that the stack is long? So many metaphors to muddle, so little time. On Thu, Mar 31, 2011 at 12:57 PM, Ray Ryan wrote: > pong. The queue is deep… > > > On Thu, Mar 31, 2011 at 11:42 AM, wrote: > >> ping >> >> >> http://gwt-code-reviews.appspot.com/1394802/ >> > > -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Adding table rendering tests to micro benchmarks. Table rendering tests are multiple orders of m... (issue1394802)
pong. The queue is deep… On Thu, Mar 31, 2011 at 11:42 AM, wrote: > ping > > > http://gwt-code-reviews.appspot.com/1394802/ > -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Comment on IssueReportSample in google-web-toolkit
Comment by ms.fus...@gmail.com: Vollara Wants You Come and Join in Too For more information: http://code.google.com/p/google-web-toolkit/wiki/IssueReportSample -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Adding table rendering tests to micro benchmarks. Table rendering tests are multiple orders of m... (issue1394802)
ping http://gwt-code-reviews.appspot.com/1394802/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9921 committed - Remove newly-output PersistentUnitCache file if nothing was written to...
Revision: 9921 Author: sco...@google.com Date: Thu Mar 31 08:40:20 2011 Log: Remove newly-output PersistentUnitCache file if nothing was written to it. In the case where you re-run a compile/startup without changing any code, we produce an empty cache file each time. This change removes the file on exit if we never wrote anything to it. http://gwt-code-reviews.appspot.com/1396804/ Review by: zun...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9921 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 Tue Mar 29 11:29:33 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java Thu Mar 31 08:40:20 2011 @@ -184,7 +184,8 @@ logger.log(TreeLogger.ERROR, "Error creating cache " + currentCacheFile + ". Disabling cache.", ex); } - int unitsWritten = 0; + int recentUnitsWritten = 0; + int totalUnitsWritten = 0; try { while (true) { UnitWriteMessage msg = null; @@ -202,9 +203,9 @@ try { if (msg != null) { if (msg == UnitWriteMessage.DELETE_OLD_CACHE_FILES) { -logger.log(TreeLogger.TRACE, "Wrote " + unitsWritten +logger.log(TreeLogger.TRACE, "Wrote " + recentUnitsWritten + " units to persistent cache."); -unitsWritten = 0; +recentUnitsWritten = 0; deleteOldCacheFiles(logger, currentCacheFile); } else if (msg == UnitWriteMessage.SHUTDOWN_THREAD) { stream.flush(); @@ -214,7 +215,8 @@ CompilationUnit unit = msg.unitCacheEntry.getUnit(); assert unit != null; stream.writeObject(unit); -unitsWritten++; +recentUnitsWritten++; +totalUnitsWritten++; } } @@ -234,6 +236,10 @@ // Paranoia - close all streams Utility.close(bstream); Utility.close(fstream); +if (totalUnitsWritten == 0) { + // Remove useless empty output. + currentCacheFile.delete(); +} shutDownLatch.countDown(); logger.log(TreeLogger.TRACE, "Shutting down PersistentUnitCache thread"); } === --- /trunk/dev/core/test/com/google/gwt/dev/javac/PersistentUnitCacheTest.java Wed Mar 30 06:55:27 2011 +++ /trunk/dev/core/test/com/google/gwt/dev/javac/PersistentUnitCacheTest.java Thu Mar 31 08:40:20 2011 @@ -153,14 +153,14 @@ assertEquals(foo2.getContentId(), result.getContentId()); cache.cleanup(logger); -// Now there should be 2 files. +// We didn't write anything, still 1 file. cache.shutdown(); -assertNumCacheFiles(unitCacheDir, 2); +assertNumCacheFiles(unitCacheDir, 1); // keep making more files MockCompilationUnit lastUnit = null; assertTrue(PersistentUnitCache.CACHE_FILE_THRESHOLD > 3); -for (int i = 3; i < PersistentUnitCache.CACHE_FILE_THRESHOLD; ++i) { +for (int i = 2; i < PersistentUnitCache.CACHE_FILE_THRESHOLD; ++i) { cache = new PersistentUnitCache(logger, cacheDir); lastUnit = new MockCompilationUnit("com.example.Foo", "Foo Source" + i); cache.add(lastUnit); -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Adding a SuppressWarnings to prevent the Google Plugin for Eclipse from marking this class as error. (issue1386805)
On 2011/03/31 18:35:21, schenney wrote: LGTM http://gwt-code-reviews.appspot.com/1386805/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Adding a SuppressWarnings to prevent the Google Plugin for Eclipse from marking this class as error. (issue1386805)
http://gwt-code-reviews.appspot.com/1386805/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Remove cache file if nothing was written to it. (issue1396804)
LGTM I see how this will defer the cleanup process longer which would be a good thing if files aren't really changing. http://gwt-code-reviews.appspot.com/1396804/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Remove cache file if nothing was written to it. (issue1396804)
Reviewers: zundel, Message: In the case where you re-run a compile/startup without changing any code, we produce an empty cache file each time. This change removes the file on exit if we never wrote anything to it. Please review this at http://gwt-code-reviews.appspot.com/1396804/ Affected files: M dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java Index: dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java diff --git a/dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java b/dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java index 8d2a926cbf4b10e91aea12edda8d847db09a1082..dcff5e299139e87395ce5073a3074560bb28dbe4 100644 --- a/dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java +++ b/dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java @@ -184,7 +184,8 @@ class PersistentUnitCache extends MemoryUnitCache { logger.log(TreeLogger.ERROR, "Error creating cache " + currentCacheFile + ". Disabling cache.", ex); } - int unitsWritten = 0; + int recentUnitsWritten = 0; + int totalUnitsWritten = 0; try { while (true) { UnitWriteMessage msg = null; @@ -202,9 +203,9 @@ class PersistentUnitCache extends MemoryUnitCache { try { if (msg != null) { if (msg == UnitWriteMessage.DELETE_OLD_CACHE_FILES) { -logger.log(TreeLogger.TRACE, "Wrote " + unitsWritten +logger.log(TreeLogger.TRACE, "Wrote " + recentUnitsWritten + " units to persistent cache."); -unitsWritten = 0; +recentUnitsWritten = 0; deleteOldCacheFiles(logger, currentCacheFile); } else if (msg == UnitWriteMessage.SHUTDOWN_THREAD) { stream.flush(); @@ -214,7 +215,8 @@ class PersistentUnitCache extends MemoryUnitCache { CompilationUnit unit = msg.unitCacheEntry.getUnit(); assert unit != null; stream.writeObject(unit); -unitsWritten++; +recentUnitsWritten++; +totalUnitsWritten++; } } @@ -234,6 +236,10 @@ class PersistentUnitCache extends MemoryUnitCache { // Paranoia - close all streams Utility.close(bstream); Utility.close(fstream); +if (totalUnitsWritten == 0) { + // Remove useless empty output. + currentCacheFile.delete(); +} shutDownLatch.countDown(); logger.log(TreeLogger.TRACE, "Shutting down PersistentUnitCache thread"); } -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Add the beginnings of new HTML5 drag and drop events (issue1398802)
Reviewers: pdr, Description: Add the beginnings of new HTML5 drag and drop events Please review this at http://gwt-code-reviews.appspot.com/1398802/ Affected files: A user/src/com/google/gwt/event/dom/client/DragEnterClickHandler.java A user/src/com/google/gwt/event/dom/client/DragEnterEvent.java A user/src/com/google/gwt/event/dom/client/DragEnterHandler.java A user/src/com/google/gwt/event/dom/client/DragExitEvent.java A user/src/com/google/gwt/event/dom/client/DragExitHandler.java A user/src/com/google/gwt/event/dom/client/DragOverEvent.java A user/src/com/google/gwt/event/dom/client/DragOverHandler.java A user/src/com/google/gwt/event/dom/client/DropEvent.java A user/src/com/google/gwt/event/dom/client/DropHandler.java A user/src/com/google/gwt/event/dom/client/HasAllDragAndDropHandlers.java A user/src/com/google/gwt/event/dom/client/HasDragEnterHandlers.java A user/src/com/google/gwt/event/dom/client/HasDragExitHandlers.java A user/src/com/google/gwt/event/dom/client/HasDragOverHandlers.java A user/src/com/google/gwt/event/dom/client/HasDropHandlers.java M user/src/com/google/gwt/user/client/ui/FocusPanel.java M user/src/com/google/gwt/user/client/ui/FocusWidget.java M user/src/com/google/gwt/user/client/ui/HTMLTable.java M user/src/com/google/gwt/user/client/ui/Image.java M user/src/com/google/gwt/user/client/ui/Label.java M user/test/com/google/gwt/user/UISuite.java A user/test/com/google/gwt/user/client/DragAndDropEventsSinkTest.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9920 committed - Cherry picking r9919 into releases/2.3 for public issue 6189
Revision: 9920 Author: rchan...@google.com Date: Thu Mar 31 07:44:28 2011 Log: Cherry picking r9919 into releases/2.3 for public issue 6189 http://code.google.com/p/google-web-toolkit/source/detail?r=9920 Modified: /releases/2.3/user/src/com/google/gwt/user/tools/WebAppCreator.java /releases/2.3/user/test/com/google/gwt/user/tools/WebAppCreatorTest.java === --- /releases/2.3/user/src/com/google/gwt/user/tools/WebAppCreator.java Mon Mar 7 08:21:08 2011 +++ /releases/2.3/user/src/com/google/gwt/user/tools/WebAppCreator.java Thu Mar 31 07:44:28 2011 @@ -542,7 +542,7 @@ replacements.put("@copyServletDeps", copyServletDeps); // Collect the list of server libs to include on the eclipse classpath. -File libDirectory = new File(outDir + warFolder + "WEB-INF/lib"); +File libDirectory = new File(outDir + "/" + warFolder + "/WEB-INF/lib"); StringBuilder serverLibs = new StringBuilder(); if (libDirectory.exists()) { for (File file : libDirectory.listFiles()) { === --- /releases/2.3/user/test/com/google/gwt/user/tools/WebAppCreatorTest.java Mon Mar 7 08:21:08 2011 +++ /releases/2.3/user/test/com/google/gwt/user/tools/WebAppCreatorTest.java Thu Mar 31 07:44:28 2011 @@ -15,12 +15,14 @@ */ package com.google.gwt.user.tools; +import com.google.gwt.dev.util.Util; import com.google.gwt.user.tools.WebAppCreator.ArgProcessor; import junit.framework.TestCase; import java.io.File; import java.io.IOException; +import java.util.regex.Pattern; /** * Test Class for WebAppCreator. @@ -263,6 +265,34 @@ assertFileDoesNotExist("test/com/foo/HelloJUnit.gwt.xml"); assertFileDoesNotExist("test/com/foo/client/HelloTest.java"); } + + /** + * Generate a .classpath containing a .jar in war/WEB-INF/lib + */ + public void testCreatorOnlyEclipseWithJars() throws IOException, WebAppCreatorException { +runCreator("-out", projectFolder, "-XnoEclipse", "-junit", mockJar, +MY_PROJECT); + +String libDir = "war" + File.separatorChar ++ "WEB-INF" + File.separatorChar ++ "lib"; +assertTrue(new File(projectFolder + File.separatorChar + libDir).mkdirs()); + +String libJarName = libDir + File.separatorChar + "foo.jar"; +File libFile = new File(projectFolder + File.separatorChar + libJarName); +assertTrue(libFile.createNewFile()); + +runCreator("-out", projectFolder, "-XonlyEclipse", "-junit", mockJar, +MY_PROJECT); + +assertFileExists(".classpath"); +File classpathFile = new File(projectFolder + File.separatorChar + ".classpath"); +String classpathContents = Util.readURLAsString(classpathFile.toURI().toURL()); +String canonicalLibJarName = libJarName.replaceAll(Pattern.quote(File.separator), "/"); +assertTrue(".classpath does not contain " + canonicalLibJarName + ". .classpath contents:" ++ classpathContents, +classpathContents.contains(canonicalLibJarName)); + } /** * Test the main method. -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Reroll of r9908 (rolled back at r9911): Fixes issue 6189. (issue1399801)
Submitted at r9919 http://gwt-code-reviews.appspot.com/1399801/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9919 committed - Reroll of r9908 (rolled back at r9911): Fixes issue 6189....
Revision: 9919 Author: rchan...@google.com Date: Thu Mar 31 03:22:04 2011 Log: Reroll of r9908 (rolled back at r9911): Fixes issue 6189. WebAppCreator was not scanning war/WEB-INF/lib to fill up .classpath Added support for windows path separator to testCreatorOnlyEclipseWithJars() Review at http://gwt-code-reviews.appspot.com/1399801 Review by: jlaba...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9919 Modified: /trunk/user/src/com/google/gwt/user/tools/WebAppCreator.java /trunk/user/test/com/google/gwt/user/tools/WebAppCreatorTest.java === --- /trunk/user/src/com/google/gwt/user/tools/WebAppCreator.java Tue Mar 29 12:09:40 2011 +++ /trunk/user/src/com/google/gwt/user/tools/WebAppCreator.java Thu Mar 31 03:22:04 2011 @@ -542,7 +542,7 @@ replacements.put("@copyServletDeps", copyServletDeps); // Collect the list of server libs to include on the eclipse classpath. -File libDirectory = new File(outDir + warFolder + "WEB-INF/lib"); +File libDirectory = new File(outDir + "/" + warFolder + "/WEB-INF/lib"); StringBuilder serverLibs = new StringBuilder(); if (libDirectory.exists()) { for (File file : libDirectory.listFiles()) { === --- /trunk/user/test/com/google/gwt/user/tools/WebAppCreatorTest.java Tue Mar 29 12:09:40 2011 +++ /trunk/user/test/com/google/gwt/user/tools/WebAppCreatorTest.java Thu Mar 31 03:22:04 2011 @@ -15,12 +15,14 @@ */ package com.google.gwt.user.tools; +import com.google.gwt.dev.util.Util; import com.google.gwt.user.tools.WebAppCreator.ArgProcessor; import junit.framework.TestCase; import java.io.File; import java.io.IOException; +import java.util.regex.Pattern; /** * Test Class for WebAppCreator. @@ -263,6 +265,34 @@ assertFileDoesNotExist("test/com/foo/HelloJUnit.gwt.xml"); assertFileDoesNotExist("test/com/foo/client/HelloTest.java"); } + + /** + * Generate a .classpath containing a .jar in war/WEB-INF/lib + */ + public void testCreatorOnlyEclipseWithJars() throws IOException, WebAppCreatorException { +runCreator("-out", projectFolder, "-XnoEclipse", "-junit", mockJar, +MY_PROJECT); + +String libDir = "war" + File.separatorChar ++ "WEB-INF" + File.separatorChar ++ "lib"; +assertTrue(new File(projectFolder + File.separatorChar + libDir).mkdirs()); + +String libJarName = libDir + File.separatorChar + "foo.jar"; +File libFile = new File(projectFolder + File.separatorChar + libJarName); +assertTrue(libFile.createNewFile()); + +runCreator("-out", projectFolder, "-XonlyEclipse", "-junit", mockJar, +MY_PROJECT); + +assertFileExists(".classpath"); +File classpathFile = new File(projectFolder + File.separatorChar + ".classpath"); +String classpathContents = Util.readURLAsString(classpathFile.toURI().toURL()); +String canonicalLibJarName = libJarName.replaceAll(Pattern.quote(File.separator), "/"); +assertTrue(".classpath does not contain " + canonicalLibJarName + ". .classpath contents:" ++ classpathContents, +classpathContents.contains(canonicalLibJarName)); + } /** * Test the main method. -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Makes EventBus available outside of the gwt package, in (issue1394803)
Why bindery package is nested in a web package? Are these APIs not available for non web applications? Regards. - Andrés On 31 mar, 01:19, rj...@google.com wrote: > Ready for review. John, can you keep me honest on the treatment of > com.google.gwt.event.shared, and the choices made in the new event > package? > > Bob, does this fit what you have in mind for the bindery organization? > > Note that I've updated Activity and Place to use the new classes, but > not RequestFactory. I won't submit this until Dan has his big patch in > place, and I'll make the RF changes before I do. > > http://gwt-code-reviews.appspot.com/1394803/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors