I would be interested in continuing this.
I stopped midstream last time because the build was failing (I don't exactly remember context, but my commit message says) "build breaks due to internal scala compiler on nested enum."It is probably not an issue anymore, hopefully =).
On 7 April 2012 20:13, Nate Bauernfeind <nate.bau...@gmail.com> wrote:I would be interested in continuing this.Cool! I'll work on other part then.
As long as you're excited about it ;).This may be useful to you if/when you run into problems with UIBinder:
I have not yet had the chance to write additional tests that go along with GWT's move to use the AbstractFieldWriter. FWIW, this worked about a month ago.
As long as you're excited about it ;).This may be useful to you if/when you run into problems with UIBinder:https://github.com/nbauernfeind/scalagwt-gwt/tree/UiBinderSupport
I have not yet had the chance to write additional tests that go along with GWT's move to use the AbstractFieldWriter. FWIW, this worked about a month ago.
[java] Validating units:[java] Errors in 'generated://2DC862AEF141A5CF6B2762371A620676/com/google/gwt/sample/showcase/client/ShowcaseShell_ShowcaseShellUiBinderImpl.java'[java] Line 451: The field ShowcaseShell.mainMenu is not visible[java] See snapshot: /var/folders/bj/m3zw8wpx1jvcdcqlfd5hyl340000gn/T/com.google.gwt.sample.showcase.client.ShowcaseShell_ShowcaseShellUiBinderImpl6513177951694488806.java[java] Removing invalidated units
I added provided field support as well via getters. A method is
considered a getter if:
1) it is a zero arg function
2) it returns the proper type as the ui field
and 3) contains the name of the field (non-case-sensitive).
This supports the bean naming scheme (getMainMenu) and the scala one
(mainMenu). For setters I wrote to cause it to be an error if there is
more than one method that looks like a setter. Originally, I added
that in for the getters but in your sample it fails. There's the scala
getter (package private) and then the getter you expose (getMainMenu)
to the showcase class. Not sure how we should handle that (i.e. tell
me what semantics you want). For now, I'm allowing more than one and
breaking ties by choosing the one with the fewest letters in the name.
Writing full tests for these is my next top scala-gwt related priority
(and removing my changes to UiBinderWriter class which might be in the
process of being deprecated in favor of AbstractFieldWriter).
I've updated my current UiBinderSupport branch that you can merge.
https://github.com/nbauernfeind/scalagwt-gwt/commits/UiBinderSupport
BTW, it compiles but does not run. It gives this error:
Uncaught TypeError: Cannot read property 'listWrapper' of null
(anonymous function) FBFD560377482D0691310860178B6C65.cache.html:1431
gwtOnLoad FBFD560377482D0691310860178B6C65.cache.html:41654
maybeStartModule showcase.nocache.js:39
showcase.onScriptLoad showcase.nocache.js:356
(anonymous function)
That's interesting. So it sounds like scala implements package private
by making the field completely private and applying the package
private to the accessor method (you probably already knew that).
I added provided field support as well via getters. A method is
considered a getter if:
1) it is a zero arg function
2) it returns the proper type as the ui field
and 3) contains the name of the field (non-case-sensitive).
This supports the bean naming scheme (getMainMenu) and the scala one
(mainMenu). For setters I wrote to cause it to be an error if there is
more than one method that looks like a setter. Originally, I added
that in for the getters but in your sample it fails. There's the scala
getter (package private) and then the getter you expose (getMainMenu)
to the showcase class. Not sure how we should handle that (i.e. tell
me what semantics you want). For now, I'm allowing more than one and
breaking ties by choosing the one with the fewest letters in the name.
Writing full tests for these is my next top scala-gwt related priority
(and removing my changes to UiBinderWriter class which might be in the
process of being deprecated in favor of AbstractFieldWriter).
I've updated my current UiBinderSupport branch that you can merge.
https://github.com/nbauernfeind/scalagwt-gwt/commits/UiBinderSupport
BTW, it compiles but does not run. It gives this error:
Uncaught TypeError: Cannot read property 'listWrapper' of null
(anonymous function) FBFD560377482D0691310860178B6C65.cache.html:1431
gwtOnLoad FBFD560377482D0691310860178B6C65.cache.html:41654
maybeStartModule showcase.nocache.js:39
showcase.onScriptLoad showcase.nocache.js:356
(anonymous function)
Is there value in being able to hide the setter to some scope and yet
create a public getter in general? I realize you'll probably want to
use a val in this particular case and construct it at the declaration
site.