Author: fabb...@google.com Date: Tue Jun 16 10:17:46 2009 New Revision: 5565
Modified: wiki/DefaultLocaleBinding.wiki Log: Edited wiki page through web user interface. Modified: wiki/DefaultLocaleBinding.wiki ============================================================================== --- wiki/DefaultLocaleBinding.wiki (original) +++ wiki/DefaultLocaleBinding.wiki Tue Jun 16 10:17:46 2009 @@ -32,7 +32,7 @@ = Implementation Requirements = -The fallback value would be stored in a new filed of `BindingProperty`, with a public getter, default setter, and default value of "". The interesting changes happen in the property provider, which would use a template syntax in the property provider !JavaScript and `getPropertyProvider()` would do template substitution, so that a property provider of +The fallback value would be stored in a new filed of `BindingProperty`, with a public getter, default setter, and default value of "". The interesting changes happen in the two `SelectionProperty` classes, particularly `com.google.gwt.core.ext.linker.SelectionProperty`, which would use a template syntax in the property provider !JavaScript and `getPropertyProvider()` would do template substitution, so that a property provider of {{{ while (!__gwt_isKnownPropertyValue("locale", locale)) { @@ -63,4 +63,8 @@ Also note that the substitution token is, if somehow seen by naive !JavaScript, merely a comment (much as JSNI is for Java code). In this particular example, moreover, the token is inside a string literal, so a naive interpreter would merely see a very odd-looking (and in fact invalid) locale string. -Other uses might include setting a "default" logging configuration, which user modules could modify. Not allowed by this scheme would be having a fallback that depended on any other input. The fallback value _could_ be arbitrary !JavaScript, if the property provider were written to execute the extracted value (whether as a string or as non-quoted code). I see few uses for that, but perhaps the "default" logging might depend on the client's subnet, or on a combination of query inputs for different logging areas. \ No newline at end of file +Other uses might include setting a "default" logging configuration, which user modules could modify. Not allowed by this scheme would be having a fallback that depended on any other input. The fallback value _could_ be arbitrary !JavaScript, if the property provider were written to execute the extracted value (whether as a string or as non-quoted code). I see few uses for that, but perhaps the "default" logging might depend on the client's subnet, or on a combination of query inputs for different logging areas. + +I also propose to make the fallback value visible to generators, via `com.google.gwt.core.SelectionProperty.getFallback()`. This is so that the `AbstractResourceImplCreator` can recognize which actual permutation is the "default" one, as some generators might run only in the default locale but users might sensibly use `<set-property/>` to eliminate the literal value "default". + +(_Note_: why do we have two such similar classes? It seems one is for access by linkers, the other by generators, to respective subsets of `BindingProperty` data; is there enough distinction, and should we at least have more differentiated names?) \ No newline at end of file --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---