Re: Enums in overlay types
According to this
and this
you need to do something like this:
public final class DefaultLevelBean extends JavaScriptObject
implements LevelBean {
public static final LevelBean create() {
final DefaultLevelBean level = (DefaultLevelBean)
JavaScriptObject.createObject();
return level;
}
Level level;
DefaultLevelBean() {}
native Level getLevel() /*-{return
this.@com.foo.bar.level.DefaultLevelBean::level;}-*/;
native void setLevel(final Level level) /*-
{this.@com.foo.bar.level.DefaultLevelBean::level = level;}-*/;
}
On Oct 13, 12:55 pm, Hilco Wijbenga <hilco.wijbe...@gmail.com> wrote:
> On 13 October 2010 05:30, Nathan Wells <nwwe...@gmail.com> wrote:
>
> > This is just a idea, but you may need to do the following (note that I
> > skip error checking for brevity here):
>
> > public Level getLevel() {
> > return Level.valueOf(getNativeLevel());
> > }
>
> > public void setLevel(Level level) {
> > setNativeLevel(level.name());
> > }
>
> > private native String getNativeLevel() /*-{return this.level;}-*/;
> > private native void setNativeLevel(final String level) /*-
> > {this.level = level;}-*/;
>
> Yeah, I'd been thinking along those lines too. It doesn't seem to make
> any difference. :-(
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home