[gwt-contrib] Re: factory methods
I agree, but there are not much places where this becomes a real overhead, especially not if one avoid a spaghetticode. for instance, I have to customize the LocalizableGenerator, here an excerpt String generatedClass = AbstractLocalizableImplCreator.generateConstantOrMessageClass( logger, context, locale, targetClass); if (generatedClass != null) { return generatedClass; } here it would make life easier to obtain a creator from a method, otherwise I have to copypaste the whole generate() method, this also applies to static methods :( On 13 Okt., 16:51, Joel Webber wrote: > Specific examples might be helpful here. I can see how this might be useful > in some specific cases, but wrapping every new in a template method sounds > like a horribly contorting way to have to write all one's code. > > Le 13 octobre 2010 05:19, cokol a écrit : > > > many other developers, including me, would appreciate if you'd use > > protected factory methods in non-final classes (even if the class is > > not abstract), like: > > > a no-go: > > > > void func() { > > A = new A(); > > A.doSomething(); > > } > > > instead, a better pattern: > > --- > > protected A createA() { > > return new A(); > > } > > > void func() { > > A = createA(); > > A.doSomething(); > > } > > - > > > because in some situations the integration of GWT into existing > > environment becomes a little nightmare, and it would be great pay more > > attention to DI > > > thank you!! > > > -- > >http://groups.google.com/group/Google-Web-Toolkit-Contributors -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Public (stephen.haber...@gmail.com): (issue998801)
LGTM++ http://gwt-code-reviews.appspot.com/998801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Resolve GWT issue 5364. (issue992801)
On Wed, Oct 13, 2010 at 6:46 PM, Ray Ryan wrote: > Do we know what happens to the rest of the chain if someone actually tries > to call such a method? The server explodes because there's no analogous code to compute the base type for TypeVariable method parameters. I'm going to submit the client-side fixes and see if I can bodge together a fix for the server code in a separate CL. -- Bob Vawter Google Web Toolkit Team -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] CellTable headersStale
The fix was committed at r9042 and will be included in the GWT 2.1 final release. Thanks for point out this bug. Thanks, John LaBanca jlaba...@google.com On Thu, Oct 7, 2010 at 10:55 AM, Stephen Haberman wrote: > > > That sounds reasonable. We should either have a boolean to refresh the > > headers, or just refresh them all the time. Please open an issue in > > jira and assign it to me. > > Awesome. I opened the issue, though it looks like I don't have rights to > assign it over to you: > > https://jira.springsource.org/browse/ROO-1519 > > Thanks! > > - Stephen > > -- > http://groups.google.com/group/Google-Web-Toolkit-Contributors > -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Adding a constructor override to SplitLayoutPanel so users can specify the width of the splitter. (issue1001801)
Reviewers: jgw, Description: Adding a constructor override to SplitLayoutPanel so users can specify the width of the splitter. Please review this at http://gwt-code-reviews.appspot.com/1001801/show Affected files: M user/src/com/google/gwt/user/client/ui/SplitLayoutPanel.java M user/test/com/google/gwt/user/client/ui/SplitLayoutPanelTest.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fixing IE6 CellTree bugs. Child nodes disappear after the open animation completes, and images ... (issue997801)
LGTM with 2 comments http://gwt-code-reviews.appspot.com/997801/diff/1/3 File user/src/com/google/gwt/user/cellview/client/CellTree.java (right): http://gwt-code-reviews.appspot.com/997801/diff/1/3#newcode479 user/src/com/google/gwt/user/cellview/client/CellTree.java:479: if (isIe6()) { Aren't we guaranteed to be on IE6 if we are in this class? http://gwt-code-reviews.appspot.com/997801/diff/1/3#newcode485 user/src/com/google/gwt/user/cellview/client/CellTree.java:485: private native boolean isIe6() /*-{ Ditto -- can this be removed? http://gwt-code-reviews.appspot.com/997801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fixing IE6 CellTree bugs. Child nodes disappear after the open animation completes, and images ... (issue997801)
http://gwt-code-reviews.appspot.com/997801/diff/1/3 File user/src/com/google/gwt/user/cellview/client/CellTree.java (right): http://gwt-code-reviews.appspot.com/997801/diff/1/3#newcode479 user/src/com/google/gwt/user/cellview/client/CellTree.java:479: if (isIe6()) { The IE6 user agent maps to IE6 or IE7, but the fix is only needed (and only works) in IE6. IE7 renders correctly. http://gwt-code-reviews.appspot.com/997801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fixing IE6 CellTree bugs. Child nodes disappear after the open animation completes, and images ... (issue997801)
LGTM Can you add a comment to that effect On Thu, Oct 14, 2010 at 10:09 AM, wrote: > > http://gwt-code-reviews.appspot.com/997801/diff/1/3 > File user/src/com/google/gwt/user/cellview/client/CellTree.java (right): > > http://gwt-code-reviews.appspot.com/997801/diff/1/3#newcode479 > user/src/com/google/gwt/user/cellview/client/CellTree.java:479: if > (isIe6()) { > The IE6 user agent maps to IE6 or IE7, but the fix is only needed (and > only works) in IE6. IE7 renders correctly. > > http://gwt-code-reviews.appspot.com/997801/show > -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fixing IE6 CellTree bugs. Child nodes disappear after the open animation completes, and images ... (issue997801)
Will do. Thanks, John LaBanca jlaba...@google.com On Thu, Oct 14, 2010 at 10:27 AM, Daniel Rice (דניאל רייס) wrote: > LGTM > > Can you add a comment to that effect > > On Thu, Oct 14, 2010 at 10:09 AM, wrote: > > > > http://gwt-code-reviews.appspot.com/997801/diff/1/3 > > File user/src/com/google/gwt/user/cellview/client/CellTree.java (right): > > > > http://gwt-code-reviews.appspot.com/997801/diff/1/3#newcode479 > > user/src/com/google/gwt/user/cellview/client/CellTree.java:479: if > > (isIe6()) { > > The IE6 user agent maps to IE6 or IE7, but the fix is only needed (and > > only works) in IE6. IE7 renders correctly. > > > > http://gwt-code-reviews.appspot.com/997801/show > > > -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Adding a constructor override to SplitLayoutPanel so users can specify the width of the splitter. (issue1001801)
On 2010/10/14 14:01:05, jlabanca wrote: LGTM http://gwt-code-reviews.appspot.com/1001801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Fixing a bug in DatePickerCell where selecting a new date does not update the cell. (issue996801)
LGTM http://gwt-code-reviews.appspot.com/996801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9059 committed - Fixing IE6 CellTree bugs. Child nodes disappear after the open animat...
Revision: 9059 Author: jlaba...@google.com Date: Thu Oct 14 04:39:51 2010 Log: Fixing IE6 CellTree bugs. Child nodes disappear after the open animation completes, and images are not located correctly. Review at http://gwt-code-reviews.appspot.com/997801 Review by: r...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9059 Modified: /trunk/user/src/com/google/gwt/user/cellview/CellView.gwt.xml /trunk/user/src/com/google/gwt/user/cellview/client/CellTree.java /trunk/user/src/com/google/gwt/user/cellview/client/CellTreeNodeView.java === --- /trunk/user/src/com/google/gwt/user/cellview/CellView.gwt.xml Wed Oct 13 12:59:56 2010 +++ /trunk/user/src/com/google/gwt/user/cellview/CellView.gwt.xml Thu Oct 14 04:39:51 2010 @@ -55,4 +55,12 @@ + + + class="com.google.gwt.user.cellview.client.CellTree.ImplIE6"> +class="com.google.gwt.user.cellview.client.CellTree.Impl"/> + + + + === --- /trunk/user/src/com/google/gwt/user/cellview/client/CellTree.java Wed Oct 13 12:59:56 2010 +++ /trunk/user/src/com/google/gwt/user/cellview/client/CellTree.java Thu Oct 14 04:39:51 2010 @@ -21,6 +21,7 @@ import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.Style.Display; +import com.google.gwt.dom.client.Style.Overflow; import com.google.gwt.dom.client.Style.Position; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.event.dom.client.KeyCodes; @@ -226,6 +227,7 @@ protected void onStart() { if (opening) { animFrame.getStyle().setHeight(1.0, Unit.PX); +animFrame.getStyle().setPosition(Position.RELATIVE); animFrame.getStyle().clearDisplay(); height = contentContainer.getScrollHeight(); } else { @@ -242,6 +244,10 @@ double curHeight = (1.0 - progress) * height; animFrame.getStyle().setHeight(curHeight, Unit.PX); } + + // Remind IE6 that we want the overflow to be hidden. + animFrame.getStyle().setOverflow(Overflow.HIDDEN); + animFrame.getStyle().setPosition(Position.RELATIVE); } /** @@ -288,6 +294,7 @@ childContainer.setInnerHTML(""); } animFrame.getStyle().clearHeight(); + animFrame.getStyle().clearPosition(); this.contentContainer = null; this.childContainer = null; this.animFrame = null; @@ -437,6 +444,48 @@ + "width:{2}px;height:{3}px;\">{4}") SafeHtml imageWrapper(String classes, String direction, int width, int height, SafeHtml image); + +@Template("{4}") +SafeHtml imageWrapperIE6(String classes, String direction, int width, +int height, SafeHtml image); + } + + /** + * Implementation of {...@link CellTree}. + */ + private static class Impl { +/** + * Create an image wrapper. + */ +public SafeHtml imageWrapper(String classes, String direction, int width, +int height, SafeHtml image) { + return template.imageWrapper(classes, direction, width, height, image); +} + } + + /** + * Implementation of {...@link CellTable} used by IE6. + */ + @SuppressWarnings("unused") + private static class ImplIE6 extends Impl { +@Override +public SafeHtml imageWrapper(String classes, String direction, int width, +int height, SafeHtml image) { + /* + * In IE6, left/right positions are relative to the inside of the padding + * instead of the outside of the padding. The bug does not happen on IE7, + * which maps to the IE6 user agent, so we need a runtime check for IE6. + */ + if (isIe6()) { +return template.imageWrapperIE6(classes, direction, width, height, image); + } + return super.imageWrapper(classes, direction, width, height, image); +} + +private native boolean isIe6() /*-{ + return @com.google.gwt.dom.client.DOMImplIE6::isIE6()(); +}-*/; } /** @@ -446,6 +495,7 @@ private static Resources DEFAULT_RESOURCES; + private static Impl TREE_IMPL; private static Template template; private static Resources getDefaultResources() { @@ -565,6 +615,9 @@ if (template == null) { template = GWT.create(Template.class); } +if (TREE_IMPL == null) { + TREE_IMPL = GWT.create(Impl.class); +} this.style = resources.cellTreeStyle(); this.style.ensureInjected(); initWidget(new SimplePanel()); @@ -959,7 +1012,7 @@ AbstractImagePrototype proto = AbstractImagePrototype.create(res); SafeHtml image = SafeHtmlUtils.fromTrustedString(proto.getHTML()); -return template.imageWrapper(classesBuilder.toString(), direction, +return TREE_IMPL.imageWrapper(classesBuilder.toString(), direction, res.getWidth(), res.getHeight(), image); } === --- /trunk/user/src/
[gwt-contrib] [google-web-toolkit] r9058 committed - Resolve GWT issue 5364....
Revision: 9058 Author: gwt.mirror...@gmail.com Date: Thu Oct 14 08:51:02 2010 Log: Resolve GWT issue 5364. Enable RequestFactoryPolymorphicTest. Consolidate base-type code in ModelUtils. Patch by: bobv Review by: rjrjr Review at http://gwt-code-reviews.appspot.com/992801 http://code.google.com/p/google-web-toolkit/source/detail?r=9058 Modified: /trunk/user/src/com/google/gwt/editor/rebind/AutoBeanFactoryGenerator.java /trunk/user/src/com/google/gwt/editor/rebind/model/AutoBeanFactoryModel.java /trunk/user/src/com/google/gwt/editor/rebind/model/ModelUtils.java /trunk/user/src/com/google/gwt/requestfactory/rebind/RequestFactoryGenerator.java /trunk/user/src/com/google/gwt/requestfactory/rebind/model/EntityProxyModel.java /trunk/user/src/com/google/gwt/requestfactory/rebind/model/RequestFactoryModel.java /trunk/user/test/com/google/gwt/requestfactory/RequestFactorySuite.java === --- /trunk/user/src/com/google/gwt/editor/rebind/AutoBeanFactoryGenerator.java Fri Oct 1 18:15:55 2010 +++ /trunk/user/src/com/google/gwt/editor/rebind/AutoBeanFactoryGenerator.java Thu Oct 14 08:51:02 2010 @@ -31,13 +31,14 @@ import com.google.gwt.editor.client.AutoBeanVisitor; import com.google.gwt.editor.client.AutoBeanVisitor.PropertyContext; import com.google.gwt.editor.client.impl.AbstractAutoBean; -import com.google.gwt.editor.client.impl.AbstractAutoBeanFactory; import com.google.gwt.editor.client.impl.AbstractAutoBean.OneShotContext; +import com.google.gwt.editor.client.impl.AbstractAutoBeanFactory; import com.google.gwt.editor.rebind.model.AutoBeanFactoryMethod; import com.google.gwt.editor.rebind.model.AutoBeanFactoryModel; import com.google.gwt.editor.rebind.model.AutoBeanMethod; -import com.google.gwt.editor.rebind.model.AutoBeanType; import com.google.gwt.editor.rebind.model.AutoBeanMethod.Action; +import com.google.gwt.editor.rebind.model.AutoBeanType; +import com.google.gwt.editor.rebind.model.ModelUtils; import com.google.gwt.user.rebind.ClassSourceFileComposerFactory; import com.google.gwt.user.rebind.SourceWriter; @@ -91,8 +92,8 @@ StringBuilder parameters = new StringBuilder(); for (JParameter param : jmethod.getParameters()) { parameters.append(",").append( - AutoBeanFactoryModel.ensureBaseType(param.getType()).getQualifiedSourceName()).append( - " ").append(param.getName()); + ModelUtils.getQualifiedBaseName(param.getType())).append(" ").append( + param.getName()); } if (parameters.length() > 0) { parameters = parameters.deleteCharAt(0); @@ -102,13 +103,12 @@ if (jmethod.getThrows().length > 0) { for (JType thrown : jmethod.getThrows()) { throwsDeclaration.append(". ").append( - AutoBeanFactoryModel.ensureBaseType(thrown).getQualifiedSourceName()); +ModelUtils.getQualifiedBaseName(thrown)); } throwsDeclaration.deleteCharAt(0); throwsDeclaration.insert(0, "throws "); } -String returnName = AutoBeanFactoryModel.ensureBaseType( -jmethod.getReturnType()).getQualifiedSourceName(); +String returnName = ModelUtils.getQualifiedBaseName(jmethod.getReturnType()); assert !returnName.contains("extends"); return String.format("%s %s(%s) %s", returnName, jmethod.getName(), parameters, throwsDeclaration); @@ -225,9 +225,8 @@ sw.println("}"); } else { // return (ReturnType) values.get(\"foo\"); -sw.println( -"return (%s) values.get(\"%s\");", - AutoBeanFactoryModel.ensureBaseType(jmethod.getReturnType()).getQualifiedSourceName(), +sw.println("return (%s) values.get(\"%s\");", +ModelUtils.getQualifiedBaseName(jmethod.getReturnType()), method.getPropertyName()); } } @@ -411,7 +410,7 @@ // Foo toReturn=FooAutoBean.this.get("getFoo", getWrapped().getFoo()); sw.println( "%s toReturn = %3$s.this.get(\"%2$s\", getWrapped().%2$s());", - AutoBeanFactoryModel.ensureBaseType(jmethod.getReturnType()).getQualifiedSourceName(), + ModelUtils.getQualifiedBaseName(jmethod.getReturnType()), methodName, type.getSimpleSourceName()); // Non-value types might need to be wrapped @@ -442,7 +441,7 @@ // Type toReturn = getWrapped().doFoo(params); sw.println( "%s toReturn = %s.this.getWrapped().%s(%s);", - AutoBeanFactoryModel.ensureBaseType(jmethod.getReturnType()).getQualifiedSourceName(), + ModelUtils.ensureBaseType(jmethod.getReturnType()).getQualifiedSourceName(), type.getSimpleSourceName(), methodName, arguments); // Non-value types might need to be wrapped writeReturnWrapper(sw, type, method); =
[gwt-contrib] Re: Fixing IE6 CellTree bugs. Child nodes disappear after the open animation completes, and images ... (issue997801)
committed as r9059 http://gwt-code-reviews.appspot.com/997801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Add missing javadoc for Editor framework (issue1002801)
Reviewers: robertvawter, Description: Add missing javadoc for Editor framework Please review this at http://gwt-code-reviews.appspot.com/1002801/show Affected files: M user/src/com/google/gwt/editor/client/AutoBean.java M user/src/com/google/gwt/editor/client/AutoBeanFactory.java M user/src/com/google/gwt/editor/client/AutoBeanUtils.java M user/src/com/google/gwt/editor/client/AutoBeanVisitor.java M user/src/com/google/gwt/editor/client/CompositeEditor.java M user/src/com/google/gwt/editor/client/EditorDelegate.java M user/src/com/google/gwt/editor/client/EditorError.java M user/src/com/google/gwt/editor/client/HasEditorDelegate.java M user/src/com/google/gwt/editor/client/IsEditor.java M user/src/com/google/gwt/editor/client/SimpleBeanEditorDriver.java M user/src/com/google/gwt/editor/client/ValueAwareEditor.java M user/src/com/google/gwt/editor/client/adapters/EditorSource.java M user/src/com/google/gwt/editor/client/adapters/ListEditor.java M user/src/com/google/gwt/editor/client/adapters/OptionalFieldEditor.java M user/src/com/google/gwt/editor/client/adapters/SimpleEditor.java M user/src/com/google/gwt/editor/client/adapters/TakesValueEditor.java A user/src/com/google/gwt/editor/client/adapters/package.html A user/src/com/google/gwt/editor/client/package.html M user/src/com/google/gwt/editor/ui/client/ValueBoxEditorDecorator.java M user/src/com/google/gwt/editor/ui/client/adapters/HasTextEditor.java M user/src/com/google/gwt/editor/ui/client/adapters/ValueBoxEditor.java A user/src/com/google/gwt/editor/ui/client/adapters/package.html A user/src/com/google/gwt/editor/ui/client/package.html M user/src/com/google/gwt/user/client/TakesValue.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Removed stale information in the Expenses Sample App README-MAVEN.txt (issue1003801)
Reviewers: rdayal, drfibonacci, Description: Removed stale information in the Expenses Sample App README-MAVEN.txt Please review this at http://gwt-code-reviews.appspot.com/1003801/show Affected files: M samples/expenses/README-MAVEN.txt Index: samples/expenses/README-MAVEN.txt === --- samples/expenses/README-MAVEN.txt (revision 9029) +++ samples/expenses/README-MAVEN.txt (working copy) @@ -1,22 +1,12 @@ Generated by GWT WebAppCreator --- - -Congratulations, you've successfully generated a starter project! What next? - -- Option A: Import your project into Eclipse (recommended) -- -If you use Eclipse, you can simply import the generated project into Eclipse. -We've tested against Eclipse 3.4 and 3.5. Later versions will likely also -work, earlier versions may not. +If you use Eclipse, you can simply import the generated project into +Eclipse. We've tested against Eclipse 3.5. Later versions will likely +also work, earlier versions may not. -If the directory containing this file does not have a .classpath or .project -file, generate them by running 'ant eclipse.generate' - -Eclipse users will need to have the m2eclipse, or equivalent, pluigin installed. -Instructions for how to install the m2eclipse plugin can be found here: -http://m2eclipse.sonatype.org/installing-m2eclipse.html - -Eclipse users will also want to run "mvn package" before importing into Eclipse. -This will unpack the App Engine SDK to the local repository. +Eclipse users will need to have the m2eclipse, or equivalent, pluigin +installed. Instructions for how to install the m2eclipse plugin can +be found here: http://m2eclipse.sonatype.org/installing-m2eclipse.html In Eclipse, go to the File menu and choose: @@ -24,33 +14,19 @@ Browse to the directory containing this file, select "Expenses". - + Click Finish. - + You can now browse the project in Eclipse. -To launch your web app in GWT development mode, go to the Project -> Properties -and expand the Google menu item. From there: - - Navigate to App Engine item, select "Use App Engine", and specify which App Engine - SDK to use. - - Navigate to the Web Appliation item, select "This project has a WAR directory", - speicigy src/main/webapp, and uncheck "Launch and deploy...". - - Navigate to Web Toolkit, select "use Google Web Toolkit", and specify which - GWT SDK you want to use. +To launch your web app in GWT development mode Go to the Run menu item and select Run -> Debug as -> Web Application. - + When prompted for which directory to run from, simply select the directory that Eclipse defaults to. You can now use the built-in debugger to debug your web app in development mode. - -If you supplied the junit path when invoking webAppCreator, you should see -launch configurations for running your tests in development and production -mode. -- Option B: Build from the command line with Maven -- @@ -60,10 +36,9 @@ to work against Maven 2.2.1 The following assumes 'mvn' is on your command line path. -To run development mode, just type 'mvn gae:run'. +To run development mode, just type 'mvn gwt:run'. To compile your project for deployment, just type 'mvn package'. For a full listing of other goals, visit: http://mojo.codehaus.org/gwt-maven-plugin/plugin-info.html - -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Add missing Javadoc (issue1004801)
Reviewers: rchandia, Description: Add missing Javadoc Please review this at http://gwt-code-reviews.appspot.com/1004801/show Affected files: M user/src/com/google/gwt/benchmarks/BenchmarkReport.java M user/src/com/google/gwt/benchmarks/BenchmarkShell.java M user/src/com/google/gwt/benchmarks/client/Benchmark.java M user/src/com/google/gwt/benchmarks/client/IntRange.java A user/src/com/google/gwt/benchmarks/package.html M user/src/com/google/gwt/benchmarks/rebind/BenchmarkGenerator.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9060 committed - Fixing a bug in DatePickerCell where selecting a new date does not upd...
Revision: 9060 Author: jlaba...@google.com Date: Thu Oct 14 06:02:05 2010 Log: Fixing a bug in DatePickerCell where selecting a new date does not update the cell. http://gwt-code-reviews.appspot.com/996801/show Review by: rchan...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9060 Modified: /trunk/user/src/com/google/gwt/cell/client/DatePickerCell.java === --- /trunk/user/src/com/google/gwt/cell/client/DatePickerCell.java Tue Oct 12 07:55:56 2010 +++ /trunk/user/src/com/google/gwt/cell/client/DatePickerCell.java Thu Oct 14 06:02:05 2010 @@ -137,10 +137,16 @@ // Hide the panel and call valueUpdater.update when a date is selected datePicker.addValueChangeHandler(new ValueChangeHandler() { public void onValueChange(ValueChangeEvent event) { +// Remember the values before hiding the popup. +Element cellParent = lastParent; +Date oldValue = lastValue; +Object key = lastKey; panel.hide(); + +// Update the cell and value updater. Date date = event.getValue(); -setViewData(lastKey, date); -setValue(lastParent, lastValue, lastKey); +setViewData(key, date); +setValue(cellParent, oldValue, key); if (valueUpdater != null) { valueUpdater.update(date); } -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9061 committed - Adding a constructor override to SplitLayoutPanel so users can specify...
Revision: 9061 Author: jlaba...@google.com Date: Thu Oct 14 06:08:56 2010 Log: Adding a constructor override to SplitLayoutPanel so users can specify the width of the splitter. Review at http://gwt-code-reviews.appspot.com/1001801 Review by: j...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9061 Modified: /trunk/user/src/com/google/gwt/user/client/ui/SplitLayoutPanel.java /trunk/user/test/com/google/gwt/user/client/ui/SplitLayoutPanelTest.java === --- /trunk/user/src/com/google/gwt/user/client/ui/SplitLayoutPanel.java Fri Sep 3 06:47:32 2010 +++ /trunk/user/src/com/google/gwt/user/client/ui/SplitLayoutPanel.java Thu Oct 14 06:08:56 2010 @@ -15,10 +15,11 @@ */ package com.google.gwt.user.client.ui; +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.Style.Unit; import com.google.gwt.user.client.Command; -import com.google.gwt.user.client.DeferredCommand; import com.google.gwt.user.client.Event; /** @@ -56,7 +57,7 @@ class HSplitter extends Splitter { public HSplitter(Widget target, boolean reverse) { super(target, reverse); - getElement().getStyle().setPropertyPx("width", SPLITTER_SIZE); + getElement().getStyle().setPropertyPx("width", splitterSize); setStyleName("gwt-SplitLayoutPanel-HDragger"); } @@ -86,7 +87,7 @@ private int offset; private boolean mouseDown; -private Command layoutCommand; +private ScheduledCommand layoutCommand; private final boolean reverse; private int minSize; @@ -170,7 +171,7 @@ forceLayout(); } }; -DeferredCommand.addCommand(layoutCommand); +Scheduler.get().scheduleDeferred(layoutCommand); } } } @@ -178,7 +179,7 @@ class VSplitter extends Splitter { public VSplitter(Widget target, boolean reverse) { super(target, reverse); - getElement().getStyle().setPropertyPx("height", SPLITTER_SIZE); + getElement().getStyle().setPropertyPx("height", splitterSize); setStyleName("gwt-SplitLayoutPanel-VDragger"); } @@ -203,12 +204,38 @@ } } - private static final int SPLITTER_SIZE = 8; - + private static final int DEFAULT_SPLITTER_SIZE = 8; + + private final int splitterSize; + + /** + * Construct a new {...@link SplitLayoutPanel} with the default splitter size of + * 8px. + */ public SplitLayoutPanel() { +this(DEFAULT_SPLITTER_SIZE); + } + + /** + * Construct a new {...@link SplitLayoutPanel} with the specified splitter size + * in pixels. + * + * @param splitterSize the size of the splitter in pixels + */ + public SplitLayoutPanel(int splitterSize) { super(Unit.PX); +this.splitterSize = splitterSize; setStyleName("gwt-SplitLayoutPanel"); } + + /** + * Return the size of the splitter in pixels. + * + * @return the splitter size + */ + public int getSplitterSize() { +return splitterSize; + } @Override public void insert(Widget child, Direction direction, double size, Widget before) { @@ -291,6 +318,6 @@ assert false : "Unexpected direction"; } -super.insert(splitter, layout.direction, SPLITTER_SIZE, before); +super.insert(splitter, layout.direction, splitterSize, before); } } === --- /trunk/user/test/com/google/gwt/user/client/ui/SplitLayoutPanelTest.java Fri Sep 3 06:47:32 2010 +++ /trunk/user/test/com/google/gwt/user/client/ui/SplitLayoutPanelTest.java Thu Oct 14 06:08:56 2010 @@ -88,6 +88,16 @@ p.add(l4); assertEquals(l4, children.get(8)); } + + public void testSplitterSize() { +SplitLayoutPanel p = new SplitLayoutPanel(5); +assertEquals(5, p.getSplitterSize()); +WidgetCollection children = p.getChildren(); + +p.addWest(new Label("foo"), 64); +assertEquals("5px", +children.get(1).getElement().getStyle().getWidth().toLowerCase()); + } public void testRemoveInsert() { SplitLayoutPanel p = new SplitLayoutPanel(); -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Cleanups for the DynaTabelRf sample. (issue975801)
http://gwt-code-reviews.appspot.com/975801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Cleanups for the DynaTabelRf sample. (issue975801)
http://gwt-code-reviews.appspot.com/975801/diff/1/2 File samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/DynaTableRf.java (right): http://gwt-code-reviews.appspot.com/975801/diff/1/2#newcode67 samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/DynaTableRf.java:67: mole.show("Error: " + e.getMessage()); On 2010/10/13 05:33:42, rjrjr wrote: How does it go away again? Really should be using the logging handlers for this anyway. http://gwt-code-reviews.appspot.com/975801/diff/1/12 File samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/ZipPlusFourBox.java (right): http://gwt-code-reviews.appspot.com/975801/diff/1/12#newcode28 samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/ZipPlusFourBox.java:28: * A simple implementation of a US zip code input field. Changed the Zip type to string. http://gwt-code-reviews.appspot.com/975801/diff/1/16 File samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/server/PersonSource.java (right): http://gwt-code-reviews.appspot.com/975801/diff/1/16#newcode63 samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/server/PersonSource.java:63: while (toReturn.size() < maxCount && it.hasNext()) { On 2010/10/13 05:33:42, rjrjr wrote: Are you sure this is any more efficient than subList? Seems unlikely. It's necessary for filtering responses. I have added a faster path for all-on or all-off filters. http://gwt-code-reviews.appspot.com/975801/diff/1/20 File user/src/com/google/gwt/editor/client/IsEditor.java (right): http://gwt-code-reviews.appspot.com/975801/diff/1/20#newcode45 user/src/com/google/gwt/editor/client/IsEditor.java:45: * IsEditor instance. On 2010/10/13 05:33:42, rjrjr wrote: What does that mean, "co-editor"? Multiple editors can be attached to the same domain object. The ValueBoxEditorDecorator uses this to intercept error messages. http://gwt-code-reviews.appspot.com/975801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Add missing Javadoc for Cell packages (issue1005801)
Reviewers: jlabanca, Description: Add missing Javadoc for Cell packages Please review this at http://gwt-code-reviews.appspot.com/1005801/show Affected files: M user/src/com/google/gwt/cell/client/AbstractEditableCell.java M user/src/com/google/gwt/cell/client/AbstractSafeHtmlCell.java M user/src/com/google/gwt/cell/client/ActionCell.java M user/src/com/google/gwt/cell/client/ButtonCell.java M user/src/com/google/gwt/cell/client/Cell.java M user/src/com/google/gwt/cell/client/ClickableTextCell.java M user/src/com/google/gwt/cell/client/DatePickerCell.java M user/src/com/google/gwt/cell/client/EditTextCell.java M user/src/com/google/gwt/cell/client/ImageLoadingCell.java M user/src/com/google/gwt/cell/client/TextCell.java M user/src/com/google/gwt/cell/client/TextInputCell.java M user/src/com/google/gwt/cell/client/package.html -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Adding a constructor override to SplitLayoutPanel so users can specify the width of the splitter. (issue1001801)
committed as r9061 http://gwt-code-reviews.appspot.com/1001801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fixing a bug in DatePickerCell where selecting a new date does not update the cell. (issue996801)
Reviewers: rchandia, Message: committed as r9060 Description: Fixing a bug in DatePickerCell where selecting a new date does not update the cell. Please review this at http://gwt-code-reviews.appspot.com/996801/show Affected files: M user/src/com/google/gwt/cell/client/DatePickerCell.java Index: user/src/com/google/gwt/cell/client/DatePickerCell.java === --- user/src/com/google/gwt/cell/client/DatePickerCell.java (revision 9050) +++ user/src/com/google/gwt/cell/client/DatePickerCell.java (working copy) @@ -137,10 +137,16 @@ // Hide the panel and call valueUpdater.update when a date is selected datePicker.addValueChangeHandler(new ValueChangeHandler() { public void onValueChange(ValueChangeEvent event) { +// Remember the values before hiding the popup. +Element cellParent = lastParent; +Date oldValue = lastValue; +Object key = lastKey; panel.hide(); + +// Update the cell and value updater. Date date = event.getValue(); -setViewData(lastKey, date); -setValue(lastParent, lastValue, lastKey); +setViewData(key, date); +setValue(cellParent, oldValue, key); if (valueUpdater != null) { valueUpdater.update(date); } -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9062 committed - Public (stephen.haber...@gmail.com):...
Revision: 9062 Author: gwt.mirror...@gmail.com Date: Thu Oct 14 09:44:33 2010 Log: Public (stephen.haber...@gmail.com): Fixes GWT issue 5419, Panels do not emit AttachEvent http://code.google.com/p/google-web-toolkit/issues/detail?id=5419 Review by: rj...@google.com Review at http://gwt-code-reviews.appspot.com/998801 http://code.google.com/p/google-web-toolkit/source/detail?r=9062 Modified: /trunk/user/src/com/google/gwt/user/client/ui/Composite.java /trunk/user/src/com/google/gwt/user/client/ui/Panel.java /trunk/user/src/com/google/gwt/user/client/ui/Widget.java /trunk/user/test/com/google/gwt/user/client/ui/CompositeTest.java /trunk/user/test/com/google/gwt/user/client/ui/WidgetOnLoadTest.java === --- /trunk/user/src/com/google/gwt/user/client/ui/Composite.java Wed Mar 4 10:40:25 2009 +++ /trunk/user/src/com/google/gwt/user/client/ui/Composite.java Thu Oct 14 06:34:39 2010 @@ -15,6 +15,7 @@ */ package com.google.gwt.user.client.ui; +import com.google.gwt.event.logical.shared.AttachEvent; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Event; @@ -109,12 +110,14 @@ // Call onLoad() directly, because we're not calling super.onAttach(). onLoad(); +AttachEvent.fire(this, true); } @Override protected void onDetach() { try { onUnload(); + AttachEvent.fire(this, false); } finally { // We don't want an exception in user code to keep us from calling the // super implementation (or event listeners won't get cleaned up and === --- /trunk/user/src/com/google/gwt/user/client/ui/Panel.java Mon Sep 13 10:28:49 2010 +++ /trunk/user/src/com/google/gwt/user/client/ui/Panel.java Thu Oct 14 06:34:39 2010 @@ -174,26 +174,6 @@ protected void doDetachChildren() { AttachDetachException.tryCommand(this, AttachDetachException.detachCommand); } - - /** - * A Panel's onLoad method will be called after all of its children are - * attached. - * - * @see Widget#onLoad() - */ - @Override - protected void onLoad() { - } - - /** - * A Panel's onUnload method will be called before its children become - * detached themselves. - * - * @see Widget#onLoad() - */ - @Override - protected void onUnload() { - } /** * === --- /trunk/user/src/com/google/gwt/user/client/ui/Widget.java Tue Oct 5 11:03:13 2010 +++ /trunk/user/src/com/google/gwt/user/client/ui/Widget.java Thu Oct 14 06:34:39 2010 @@ -290,7 +290,7 @@ * * This method is called when a widget is attached to the browser's document. * To receive notification after a Widget has been added to the document, - * override the {...@link #onLoad} method. + * override the {...@link #onLoad} method or use {...@link #addAttachHandler}. * * * It is strongly recommended that you override {...@link #onLoad()} or @@ -328,13 +328,14 @@ // the attached flag is set. This allows widgets to be notified when they // are fully attached, and panels when all of their children are attached. onLoad(); +AttachEvent.fire(this, true); } /** * * This method is called when a widget is detached from the browser's * document. To receive notification before a Widget is removed from the - * document, override the {...@link #onUnload} method. + * document, override the {...@link #onUnload} method or use {...@link #addAttachHandler}. * * * It is strongly recommended that you override {...@link #onUnload()} or @@ -363,6 +364,7 @@ // onUnload() gets called *before* everything else (the opposite of // onLoad()). onUnload(); + AttachEvent.fire(this, false); } finally { // Put this in a finally, just in case onUnload throws an exception. try { @@ -377,22 +379,16 @@ /** * This method is called immediately after a widget becomes attached to the - * browser's document. This default implementation notifies the widgets - * {...@link com.google.gwt.event.logical.shared.AttachEvent.Handler - * AttachEvent.Handler}s. + * browser's document. */ protected void onLoad() { -AttachEvent.fire(this, true); } /** * This method is called immediately before a widget will be detached from the - * browser's document. This default implementation notifies the widget's - * {...@link com.google.gwt.event.logical.shared.AttachEvent.Handler - * AttachEvent.Handler}s. + * browser's document. */ protected void onUnload() { -AttachEvent.fire(this, false); } /** === --- /trunk/user/test/com/google/gwt/user/client/ui/CompositeTest.java Tue Aug 10 10:18:55 2010 +++ /trunk/user/test/com/google/gwt/user/client/ui/CompositeTest.java Thu Oct 14 06:34:39 2010 @@ -19,6 +19,7 @@ import com.google.gwt.event.dom.client.BlurHandler; import c
[gwt-contrib] Re: Add missing javadoc for Editor framework (issue1002801)
Thanks for doing this. LGTM, with nits. http://gwt-code-reviews.appspot.com/1002801/diff/1/2 File user/src/com/google/gwt/editor/client/AutoBean.java (right): http://gwt-code-reviews.appspot.com/1002801/diff/1/2#newcode57 user/src/com/google/gwt/editor/client/AutoBean.java:57: * @return the tage value tage http://gwt-code-reviews.appspot.com/1002801/diff/1/2#newcode66 user/src/com/google/gwt/editor/client/AutoBean.java:66: * @return true if this instance is frozen {...@code true}, here and elsewhere http://gwt-code-reviews.appspot.com/1002801/diff/1/2#newcode97 user/src/com/google/gwt/editor/client/AutoBean.java:97: * If the AutoBean wraps an object, return the underlying object. Add "The AutoBean will no longer function once unwrapped." http://gwt-code-reviews.appspot.com/1002801/diff/1/2#newcode99 user/src/com/google/gwt/editor/client/AutoBean.java:99: * @return the wrapped object the previously-wrapped object http://gwt-code-reviews.appspot.com/1002801/diff/1/3 File user/src/com/google/gwt/editor/client/AutoBeanFactory.java (right): http://gwt-code-reviews.appspot.com/1002801/diff/1/3#newcode18 user/src/com/google/gwt/editor/client/AutoBeanFactory.java:18: import sun.security.jca.GetInstance.Instance; Bad import. http://gwt-code-reviews.appspot.com/1002801/diff/1/3#newcode99 user/src/com/google/gwt/editor/client/AutoBeanFactory.java:99: * @param the type of the created {...@link AutoBean} the parameterization of the the created {...@link AutoBean}. http://gwt-code-reviews.appspot.com/1002801/diff/1/3#newcode101 user/src/com/google/gwt/editor/client/AutoBeanFactory.java:101: * @return an {...@link AutoBean} of type T Here and below: "... or {...@code null} if the interface type is unknown to the factory" http://gwt-code-reviews.appspot.com/1002801/diff/1/3#newcode111 user/src/com/google/gwt/editor/client/AutoBeanFactory.java:111: * @param clazz the Class of type T of the new {...@link Instance} {...@link Instance} looks unintentional. http://gwt-code-reviews.appspot.com/1002801/diff/1/4 File user/src/com/google/gwt/editor/client/AutoBeanUtils.java (right): http://gwt-code-reviews.appspot.com/1002801/diff/1/4#newcode131 user/src/com/google/gwt/editor/client/AutoBeanUtils.java:131: * @param delegate a delegate object, or null Here and below: {...@code null} http://gwt-code-reviews.appspot.com/1002801/diff/1/5 File user/src/com/google/gwt/editor/client/AutoBeanVisitor.java (right): http://gwt-code-reviews.appspot.com/1002801/diff/1/5#newcode35 user/src/com/google/gwt/editor/client/AutoBeanVisitor.java:35: * @return true if the property can be set {...@code true} http://gwt-code-reviews.appspot.com/1002801/diff/1/5#newcode43 user/src/com/google/gwt/editor/client/AutoBeanVisitor.java:43: * @return a Class object representing the element type or {...@code null} if the property is not a collection type http://gwt-code-reviews.appspot.com/1002801/diff/1/5#newcode72 user/src/com/google/gwt/editor/client/AutoBeanVisitor.java:72: * TODO: document. Called after visiting a reference property. http://gwt-code-reviews.appspot.com/1002801/diff/1/5#newcode83 user/src/com/google/gwt/editor/client/AutoBeanVisitor.java:83: * TODO: document. Called after visiting a value property. http://gwt-code-reviews.appspot.com/1002801/diff/1/6 File user/src/com/google/gwt/editor/client/CompositeEditor.java (right): http://gwt-code-reviews.appspot.com/1002801/diff/1/6#newcode93 user/src/com/google/gwt/editor/client/CompositeEditor.java:93: * Used to implement {...@link EditorDelegate#getPath()}. ... for the component Editors. http://gwt-code-reviews.appspot.com/1002801/diff/1/6#newcode95 user/src/com/google/gwt/editor/client/CompositeEditor.java:95: * @param subEditor an instance of the Editor type ... previously passed into {...@link EditorChain#attach()} http://gwt-code-reviews.appspot.com/1002801/diff/1/6#newcode101 user/src/com/google/gwt/editor/client/CompositeEditor.java:101: * Sets the {...@link EditorChain}. Called by the Editor framework to provide the {...@link EditorChain}. http://gwt-code-reviews.appspot.com/1002801/diff/1/8 File user/src/com/google/gwt/editor/client/EditorError.java (right): http://gwt-code-reviews.appspot.com/1002801/diff/1/8#newcode75 user/src/com/google/gwt/editor/client/EditorError.java:75: * @return true if the error will not be propagated {...@code true} http://gwt-code-reviews.appspot.com/1002801/diff/1/11 File user/src/com/google/gwt/editor/client/SimpleBeanEditorDriver.java (right): http://gwt-code-reviews.appspot.com/1002801/diff/1/11#newcode70 user/src/com/google/gwt/editor/client/SimpleBeanEditorDriver.java:70: * @return true if errors are present {...@code true} http://gwt-code-reviews.appspot.com/1002801/diff/1/14 File user/src/com/google/gwt/editor/client/adapters/ListEditor.java (right): http://gwt-code-reviews.appspot.com/1002801/diff/1/14#newcode60 user/src/com/google/gwt/editor/client/adapters/ListEditor.java:60: // TODO - document Creates a temporary sub-E
[gwt-contrib] Re: Cleanups for the DynaTabelRf sample. (issue975801)
LGTM Only reservation is the finality of the error dialog. Given it's demo-ware, your call on fixing it. http://gwt-code-reviews.appspot.com/975801/diff/8001/9002 File samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/DynaTableRf.java (right): http://gwt-code-reviews.appspot.com/975801/diff/8001/9002#newcode78 samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/DynaTableRf.java:78: Logger.getLogger("").addHandler(new ErrorDialog().getHandler()); Nice! http://gwt-code-reviews.appspot.com/975801/diff/8001/9003 File samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/ErrorDialog.java (right): http://gwt-code-reviews.appspot.com/975801/diff/8001/9003#newcode29 samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/ErrorDialog.java:29: * A simple glasspanel popup that terminates interaction with the application. Terminates is pretty severe. Maybe change the text to "An unexpected error has occurred. You may want to reload the application," and add [ Reload ] [ Dismiss ] buttons? http://gwt-code-reviews.appspot.com/975801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: The proposed fix will disambiguate setter overloads by ranking them according (issue993801)
http://gwt-code-reviews.appspot.com/993801/diff/1/2 File user/src/com/google/gwt/uibinder/rebind/model/OwnerFieldClass.java (right): http://gwt-code-reviews.appspot.com/993801/diff/1/2#newcode46 user/src/com/google/gwt/uibinder/rebind/model/OwnerFieldClass.java:46: private static HashMap typeRank; On 2010/10/13 20:50:11, rjrjr wrote: Make this final. You can build it in another map in your static initializer, and fill in typeRank via Collections.unmodifiableMap() Done. http://gwt-code-reviews.appspot.com/993801/diff/1/2#newcode46 user/src/com/google/gwt/uibinder/rebind/model/OwnerFieldClass.java:46: private static HashMap typeRank; On 2010/10/13 20:50:11, rjrjr wrote: Make this final. You can build it in another map in your static initializer, and fill in typeRank via Collections.unmodifiableMap() Done. http://gwt-code-reviews.appspot.com/993801/diff/1/2#newcode51 user/src/com/google/gwt/uibinder/rebind/model/OwnerFieldClass.java:51: typeRank.put("java.lang.Boolean", 2); On 2010/10/13 20:50:11, rjrjr wrote: Seems like you could rank the java.lang types as 3, so that you prefer setBaz(boolean) to setBaz(Boolean). (Remember to add that test if you make this change, and to set your default cost to 4. And you might want to put that default cost in a constant next to this map.) I will take your suggestion, though it is not entirely clear to me the benefits of this approach. the original thinking was that a type would be either in the primitive type family or in the reference type family. the current approach was to choose the autoboxed primitive types as reference types the same way java treats boxed primitive types. anyhow, I think you are right. http://gwt-code-reviews.appspot.com/993801/diff/1/2#newcode186 user/src/com/google/gwt/uibinder/rebind/model/OwnerFieldClass.java:186: !sameParameterTypes(preferredMethod, method)) { On 2010/10/13 20:50:11, rjrjr wrote: The sameParameterTypes call is required to distinguish overrides from super methods, right? yes. when you say 'mention that', I am assuming you mean comment that. (done). Should mention that, and be sure unit test covers it. 2) Will add a specific unit test for this case. just to be clear on what to expect in terms of behavior, an overridden method with the same formal signature will *not* be considered ambiguous. http://gwt-code-reviews.appspot.com/993801/diff/1/2#newcode334 user/src/com/google/gwt/uibinder/rebind/model/OwnerFieldClass.java:334: * Ranks given method based on parameter conversion cost. On 2010/10/13 20:50:11, rjrjr wrote: Please document the ranking here, like you did in the patch description Done. http://gwt-code-reviews.appspot.com/993801/diff/1/2#newcode362 user/src/com/google/gwt/uibinder/rebind/model/OwnerFieldClass.java:362: private boolean sameParameterTypes(final JMethod m1, final JMethod m2) { On 2010/10/13 20:50:11, rjrjr wrote: why? Done. http://gwt-code-reviews.appspot.com/993801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Add missing Javadoc for Cell packages (issue1005801)
LGTM http://gwt-code-reviews.appspot.com/1005801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: The proposed fix will disambiguate setter overloads by ranking them according (issue993801)
http://gwt-code-reviews.appspot.com/993801/diff/1/3 File user/test/com/google/gwt/uibinder/rebind/model/OwnerFieldClassTest.java (right): http://gwt-code-reviews.appspot.com/993801/diff/1/3#newcode146 user/test/com/google/gwt/uibinder/rebind/model/OwnerFieldClassTest.java:146: public void testCheckBoxValueSetters() throws Exception { On 2010/10/13 20:50:11, rjrjr wrote: Thanks for the test, but you need more to cover your various ranking scenarios. Done. http://gwt-code-reviews.appspot.com/993801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Add missing javadoc for Editor framework (issue1002801)
http://gwt-code-reviews.appspot.com/1002801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Add missing javadoc for Editor framework (issue1002801)
Made changes and re-uploaded to rietveld On Thu, Oct 14, 2010 at 12:58 PM, wrote: > Thanks for doing this. > > LGTM, with nits. > > > http://gwt-code-reviews.appspot.com/1002801/diff/1/2 > File user/src/com/google/gwt/editor/client/AutoBean.java (right): > > http://gwt-code-reviews.appspot.com/1002801/diff/1/2#newcode57 > user/src/com/google/gwt/editor/client/AutoBean.java:57: * @return the > tage value > tage > > http://gwt-code-reviews.appspot.com/1002801/diff/1/2#newcode66 > user/src/com/google/gwt/editor/client/AutoBean.java:66: * @return true > if this instance is frozen > {...@code true}, here and elsewhere > > http://gwt-code-reviews.appspot.com/1002801/diff/1/2#newcode97 > user/src/com/google/gwt/editor/client/AutoBean.java:97: * If the > AutoBean wraps an object, return the underlying object. > Add "The AutoBean will no longer function once unwrapped." > > http://gwt-code-reviews.appspot.com/1002801/diff/1/2#newcode99 > user/src/com/google/gwt/editor/client/AutoBean.java:99: * @return the > wrapped object > the previously-wrapped object > > http://gwt-code-reviews.appspot.com/1002801/diff/1/3 > File user/src/com/google/gwt/editor/client/AutoBeanFactory.java (right): > > http://gwt-code-reviews.appspot.com/1002801/diff/1/3#newcode18 > user/src/com/google/gwt/editor/client/AutoBeanFactory.java:18: import > sun.security.jca.GetInstance.Instance; > Bad import. > > http://gwt-code-reviews.appspot.com/1002801/diff/1/3#newcode99 > user/src/com/google/gwt/editor/client/AutoBeanFactory.java:99: * @param > the type of the created {...@link AutoBean} > the parameterization of the the created {...@link AutoBean}. > > http://gwt-code-reviews.appspot.com/1002801/diff/1/3#newcode101 > user/src/com/google/gwt/editor/client/AutoBeanFactory.java:101: * > @return an {...@link AutoBean} of type T > Here and below: "... or {...@code null} if the interface type is unknown > to the factory" > > http://gwt-code-reviews.appspot.com/1002801/diff/1/3#newcode111 > user/src/com/google/gwt/editor/client/AutoBeanFactory.java:111: * @param > clazz the Class of type T of the new {...@link Instance} > {...@link Instance} looks unintentional. > > http://gwt-code-reviews.appspot.com/1002801/diff/1/4 > File user/src/com/google/gwt/editor/client/AutoBeanUtils.java (right): > > http://gwt-code-reviews.appspot.com/1002801/diff/1/4#newcode131 > user/src/com/google/gwt/editor/client/AutoBeanUtils.java:131: * @param > delegate a delegate object, or null > Here and below: {...@code null} > > http://gwt-code-reviews.appspot.com/1002801/diff/1/5 > File user/src/com/google/gwt/editor/client/AutoBeanVisitor.java (right): > > http://gwt-code-reviews.appspot.com/1002801/diff/1/5#newcode35 > user/src/com/google/gwt/editor/client/AutoBeanVisitor.java:35: * @return > true if the property can be set > {...@code true} > > http://gwt-code-reviews.appspot.com/1002801/diff/1/5#newcode43 > user/src/com/google/gwt/editor/client/AutoBeanVisitor.java:43: * @return > a Class object representing the element type > or {...@code null} if the property is not a collection type > > http://gwt-code-reviews.appspot.com/1002801/diff/1/5#newcode72 > user/src/com/google/gwt/editor/client/AutoBeanVisitor.java:72: * TODO: > document. > Called after visiting a reference property. > > http://gwt-code-reviews.appspot.com/1002801/diff/1/5#newcode83 > user/src/com/google/gwt/editor/client/AutoBeanVisitor.java:83: * TODO: > document. > Called after visiting a value property. > > http://gwt-code-reviews.appspot.com/1002801/diff/1/6 > File user/src/com/google/gwt/editor/client/CompositeEditor.java (right): > > http://gwt-code-reviews.appspot.com/1002801/diff/1/6#newcode93 > user/src/com/google/gwt/editor/client/CompositeEditor.java:93: * Used to > implement {...@link EditorDelegate#getPath()}. > ... for the component Editors. > > http://gwt-code-reviews.appspot.com/1002801/diff/1/6#newcode95 > user/src/com/google/gwt/editor/client/CompositeEditor.java:95: * @param > subEditor an instance of the Editor type > ... previously passed into {...@link EditorChain#attach()} > > http://gwt-code-reviews.appspot.com/1002801/diff/1/6#newcode101 > user/src/com/google/gwt/editor/client/CompositeEditor.java:101: * Sets > the {...@link EditorChain}. > Called by the Editor framework to provide the {...@link EditorChain}. > > http://gwt-code-reviews.appspot.com/1002801/diff/1/8 > File user/src/com/google/gwt/editor/client/EditorError.java (right): > > http://gwt-code-reviews.appspot.com/1002801/diff/1/8#newcode75 > user/src/com/google/gwt/editor/client/EditorError.java:75: * @return > true if the error will not be propagated > {...@code true} > > http://gwt-code-reviews.appspot.com/1002801/diff/1/11 > File user/src/com/google/gwt/editor/client/SimpleBeanEditorDriver.java > (right): > > http://gwt-code-reviews.appspot.com/1002801/diff/1/11#newcode70 > user/src/com/google/gwt/editor/client/SimpleBeanEditorDriver.java:70: * > @return true if errors are present > {...@code true} > > http://gwt-co
[gwt-contrib] Re: The proposed fix will disambiguate setter overloads by ranking them according (issue993801)
http://gwt-code-reviews.appspot.com/993801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9063 committed - Edited wiki page Editors through web user interface.
Revision: 9063 Author: b...@google.com Date: Thu Oct 14 11:10:19 2010 Log: Edited wiki page Editors through web user interface. http://code.google.com/p/google-web-toolkit/source/detail?r=9063 Modified: /wiki/Editors.wiki === --- /wiki/Editors.wiki Mon Oct 11 12:49:32 2010 +++ /wiki/Editors.wiki Thu Oct 14 11:10:19 2010 @@ -1,6 +1,6 @@ #summary Data binding for bean-like objects -= GWT Editor Framework (DRAFT) = += GWT Editor Framework = The GWT Editor framework allows data stored in an object graph to be mapped onto a graph of Editors. The typical scenario is wiring objects returned from an RPC mechanism into a UI. @@ -152,7 +152,7 @@ 1 `setEditorDelegate()` is called, per `HasEditorDelegate` super-interface. 1 `setValue()` is called with the value that the Editor is responsible for editing. If the value will affect with sub-editors are or are not provided to the framework, they should be initialized or nullified at this time. 1 If `EditorDelegate.subscribe()` has been called, the Editor may receive subsequent calls to `onPropertyChange()` or `setValue()` at any point in time. -1 `flush()` is called in a depth-first manner by the driver, so Editors generally do not flush their sub-Editors. +1 `flush()` is called in a depth-first manner by the driver, so Editors generally do not flush their sub-Editors. Editors that directly mutate their peer object should do so only when `flush()` is called in order to allow an edit workflow to be canceled. === !CompositeEditor === `CompositeEditor` allows an unknown number of homogenous sub-Editors to be added to the Editor hierarchy at runtime. In addition to the behavior described for `ValueAwareEditor`, `CompositeEditor` has the following additional APIs: @@ -209,7 +209,38 @@ public LeafValueEditor asEditor() { return wrapped.asEditor(); - ` + } } }}} Similarly a `WorkgroupMembershipEditor` might implement `IsEditor>`. + +=== Read-only Editors === +*Q:* Can I use Editors to view read-only data? + +*A:* Yes, just don't call the `flush()` method on the driver type. `RequestFactoryEditorDriver` has a convenience `display()` method as well. + +=== Very large objects === +*Q:* How can I edit objects with a large number of properties? + +*A:* An Editor doesn't have to edit all of the properties of its peer domain object. If you had a `BagOfState` type with many properties, it might make sense to write several Editor types that edit conceptually-related subsets of the properties: +{{{ +class BagOfStateBiographicalEditor implements Editor { + AddressEditor address; + Label name; +} + +class BagOfStateUserPreferencesEditor implements Editor { + CheckBox likesCats; + CheckBox likesDogs; +} +}}} +Whether or not these editors are displayed all at the same time or sequentially is a user experience issue. The Editor framework allows multiple Editors to edit the same object: +{{{ +class HasBagOfStateEditor implements Editor { + @Editor.Path("state") + BagOfStateBiographicalEditor bio; + + @Editor.Path("state") + BagOfStateUserPreferencesEditor prefs; +} +}}} -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Not using dvsDataMap on child entities
Simple test case: User Office hours I will get back entity proxies that are represent this information on the client. If I call edit. The entire tree is now mutable thanks to the latest fixes. However, if I update a sub-entity, when I fire this request back to the server, I have the following: 1. Client side, office hours has the right value 2. The json request has the right value in JsonRequestProcessor 3. OfficeHours.findOfficeHours is called with the right id 4. The right setter method is called with the right value on the object, again all good. 5. The newly modified entity is stored in dvsDataMap. Since this is a delta, this is again good. 6. The user object that is passed to the service method is the right one, again all good However, 7. The office hours object passed in with the user object in step #6 is a pristine db copy. It's not the one from dvsDataMap, it's the one that was collected when the user was first grabbed. So when I commit the object graph, I commit without any modifications so we have public static void persist(sessionId, userAccount) { userAccount is the right one, modifications and all but userAccount.List and its contents are the one from returned from UserAccount.findUserAccount instead of what's in dvsDataMap -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Removed stale information in the Expenses Sample App README-MAVEN.txt (issue1003801)
http://gwt-code-reviews.appspot.com/1003801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Not using dvsDataMap on child entities
and forgot to mention, adding is fine. So if I add a new office hour to an existing user, I get a new entity as a child of the user. Also somewhat related and that I forgot to mention, the user itself, if modified, is also the right value, and is coming in from dvsDataMap On Thu, Oct 14, 2010 at 2:15 PM, Patrick Julien wrote: > Simple test case: > > User > Office hours > > I will get back entity proxies that are represent this information on > the client. If I call edit. The entire tree is now mutable thanks to > the latest fixes. > > However, if I update a sub-entity, when I fire this request back to > the server, I have the following: > > 1. Client side, office hours has the right value > 2. The json request has the right value in JsonRequestProcessor > 3. OfficeHours.findOfficeHours is called with the right id > 4. The right setter method is called with the right value on the > object, again all good. > 5. The newly modified entity is stored in dvsDataMap. Since this is a > delta, this is again good. > 6. The user object that is passed to the service method is the right > one, again all good > > However, > > 7. The office hours object passed in with the user object in step #6 > is a pristine db copy. It's not the one from dvsDataMap, it's the one > that was collected when the user was first grabbed. So when I commit > the object graph, I commit without any modifications > > so we have > public static void persist(sessionId, userAccount) { > userAccount is the right one, modifications and all > but userAccount.List and its contents are the one from > returned from UserAccount.findUserAccount instead of what's in > dvsDataMap > -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: The proposed fix will disambiguate setter overloads by ranking them according (issue993801)
How does the user override the heuristic if it chooses incorrectly? http://gwt-code-reviews.appspot.com/993801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: The proposed fix will disambiguate setter overloads by ranking them according (issue993801)
By providing a setter with a different name, I guess. An alternative would be to provide a new annotation, but that still presumes that they control the widget source, not much of a win. On Thu, Oct 14, 2010 at 12:11 PM, wrote: > How does the user override the heuristic if it chooses incorrectly? > > > http://gwt-code-reviews.appspot.com/993801/show > -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9065 committed - Cleanups for the DynaTableRf sample....
Revision: 9065 Author: gwt.mirror...@gmail.com Date: Thu Oct 14 12:29:49 2010 Log: Cleanups for the DynaTableRf sample. Resolves GWT issue 5413. Patch by: bobv Review by: rjrjr Review at http://gwt-code-reviews.appspot.com/975801 http://code.google.com/p/google-web-toolkit/source/detail?r=9065 Added: /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/ErrorDialog.java /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/ErrorDialog.ui.xml /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/ZipPlusFourBox.java Modified: /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/DynaTableRf.gwt.xml /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/DynaTableRf.java /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/FavoritesManager.java /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/PersonEditorWorkflow.java /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/events/MarkFavoriteEvent.java /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/AddressEditor.java /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/AddressEditor.ui.xml /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/DayFilterWidget.ui.xml /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/FavoritesWidget.java /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/MentorSelector.java /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/NameLabel.java /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.java /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/domain/Address.java /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/domain/Person.java /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/domain/Schedule.java /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/server/AddressFuzzer.java /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/server/PersonSource.java /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/server/SchoolCalendarService.java /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/AddressProxy.java /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/shared/DynaTableRequestFactory.java /trunk/user/src/com/google/gwt/editor/client/IsEditor.java /trunk/user/test/com/google/gwt/editor/client/SimpleBeanEditorTest.java === --- /dev/null +++ /trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/ErrorDialog.java Thu Oct 14 12:29:49 2010 @@ -0,0 +1,84 @@ +/* + * 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.sample.dynatablerf.client; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.uibinder.client.UiBinder; +import com.google.gwt.uibinder.client.UiField; +import com.google.gwt.uibinder.client.UiHandler; +import com.google.gwt.user.client.Window; +import com.google.gwt.user.client.ui.DialogBox; +import com.google.gwt.user.client.ui.TextArea; + +import java.util.logging.Handler; +import java.util.logging.Level; +import java.util.logging.LogRecord; + +/** + * A simple glasspanel popup that terminates interaction with the application. + */ +class ErrorDialog { + interface Binder extends UiBinder { + } + + @UiField + DialogBox errorDialog; + + @UiField + TextArea errorMessage; + + public ErrorDialog() { +GWT. create(Binder.class).createAndBindUi(this); + } + + /** + * @return + */ + public Handler getHandler() { +return new Handler() { + { +setLevel(Level.SEVERE); + } + + @Override + public void close() { + } + + @Override + public void flush() { + } + + @Override + public void publish(LogRecord record) { +if (isLoggable(record)) { + errorMessage.setText(record.getMessage()); + errorDialog.center(); +} + } +}; + } + + @UiHandler("dismiss") + void onDismiss(ClickEvent event) { +errorDialog.hide(); + } + + @UiHandler("reload") + void onReload(ClickEvent eve
[gwt-contrib] Document limitations of current SafeHtmlTemplates code generator. (issue1006801)
Reviewers: rice, pdr, Description: Document limitations of current SafeHtmlTemplates code generator. Please review this at http://gwt-code-reviews.appspot.com/1006801/show Affected files: M user/src/com/google/gwt/safehtml/client/SafeHtmlTemplates.java Index: user/src/com/google/gwt/safehtml/client/SafeHtmlTemplates.java === --- user/src/com/google/gwt/safehtml/client/SafeHtmlTemplates.java (revision 9045) +++ user/src/com/google/gwt/safehtml/client/SafeHtmlTemplates.java (working copy) @@ -24,7 +24,7 @@ /** * A tag interface that facilitates compile-time binding of HTML templates to * generate SafeHtml strings. - * + * * Example usage: * * public interface MyTemplate extends SafeHtmlTemplates { @@ -45,13 +45,24 @@ * TEMPLATE.messageWithLink(message, url, linkText, style); * } * - * - * Instantiating a SafeHtmlTemplates interface with {...@code GWT.create()} returns - * an instance of an implementation that is generated at compile time. The code - * generator parses the value of each template method's {...@code @Template} - * annotation as a (X)HTML template, with template variables denoted by - * curly-brace placeholders that refer by index to the corresponding template - * method parameter. + * + * + * Instantiating a {...@code SafeHtmlTemplates} interface with {...@code GWT.create()} + * returns an instance of an implementation that is generated at compile time. + * The code generator parses the value of each template method's + * {...@code @Template} annotation as a (X)HTML template, with template variables + * denoted by curly-brace placeholders that refer by index to the corresponding + * template method parameter. + * + * + * Note: The current implementation of the code generator cannot + * guarantee the {...@code SafeHtml} contract for templates with template variables + * in a CSS or JavaScript context (that is, within a {...@code style} attribute or + * tag; or within {...@code