[gwt-contrib] Change in gwt[master]: Allow @UIHandler annotated methods to be private.
Brian Slesinsky has posted comments on this change. Change subject: Allow @UIHandler annotated methods to be private. .. Patch Set 2: I agree that we should indirect through JSNI only if the method is actually private. This could be a performance issue in devmode because it adds a round trip between the browser and the JVM. (Is there some way to avoid the round trip?) I think it's simpler to not change the spec but I will defer to people who use UiBinder more. -- To view, visit https://gwt-review.googlesource.com/2450 To unsubscribe, visit https://gwt-review.googlesource.com/settings Gerrit-MessageType: comment Gerrit-Change-Id: I03c7787ced5a339a74d49ec917d48edebd5dbb8f Gerrit-PatchSet: 2 Gerrit-Project: gwt Gerrit-Branch: master Gerrit-Owner: Roberto Lublinerman Gerrit-Reviewer: Brian Slesinsky Gerrit-Reviewer: Goktug Gokdogan Gerrit-Reviewer: Matthew Dempsky Gerrit-Reviewer: Roberto Lublinerman Gerrit-Reviewer: Thomas Broyer Gerrit-HasComments: No -- -- http://groups.google.com/group/Google-Web-Toolkit-Contributors --- You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[gwt-contrib] Change in gwt[master]: Allow @UIHandler annotated methods to be private.
Goktug Gokdogan has posted comments on this change. Change subject: Allow @UIHandler annotated methods to be private. .. Patch Set 2: Actually we discussed this internally and we have an agreement on our side to add the support as a feature. I'm keeping the thread up to date and would like to hear if you still have any concerns: 1. In UiBinder, the xml is more like a part of the view class itself that is extracted out to make it more declarative and it can be considered as internal. From that point of view, we are not really violating the semantics of the private (at least as not much as in @inject case.) 2. UiFields are nearly always only used in the class itself. When we don't declare them private, then it is difficult to discover if they are used or not as the IDE will not point that out. 3. Tools are already aware of the fact that methods with annotations are usually used by magic and provides easy ways to configure as this is kind of a common practice in java. -- To view, visit https://gwt-review.googlesource.com/2450 To unsubscribe, visit https://gwt-review.googlesource.com/settings Gerrit-MessageType: comment Gerrit-Change-Id: I03c7787ced5a339a74d49ec917d48edebd5dbb8f Gerrit-PatchSet: 2 Gerrit-Project: gwt Gerrit-Branch: master Gerrit-Owner: Roberto Lublinerman Gerrit-Reviewer: Brian Slesinsky Gerrit-Reviewer: Goktug Gokdogan Gerrit-Reviewer: Matthew Dempsky Gerrit-Reviewer: Roberto Lublinerman Gerrit-Reviewer: Thomas Broyer Gerrit-HasComments: No -- -- http://groups.google.com/group/Google-Web-Toolkit-Contributors --- You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[gwt-contrib] Change in gwt[master]: Allow @UIHandler annotated methods to be private.
Roberto Lublinerman has posted comments on this change. Change subject: Allow @UIHandler annotated methods to be private. .. Patch Set 2: The existing code is already fixed. The question remains whether we want to allow private @UiHandlers and @UiFields as a feature or not. I am neutral in that respect. Should we take a vote? -- To view, visit https://gwt-review.googlesource.com/2450 To unsubscribe, visit https://gwt-review.googlesource.com/settings Gerrit-MessageType: comment Gerrit-Change-Id: I03c7787ced5a339a74d49ec917d48edebd5dbb8f Gerrit-PatchSet: 2 Gerrit-Project: gwt Gerrit-Branch: master Gerrit-Owner: Roberto Lublinerman Gerrit-Reviewer: Brian Slesinsky Gerrit-Reviewer: Goktug Gokdogan Gerrit-Reviewer: Matthew Dempsky Gerrit-Reviewer: Roberto Lublinerman Gerrit-Reviewer: Thomas Broyer Gerrit-HasComments: No -- -- http://groups.google.com/group/Google-Web-Toolkit-Contributors --- You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[gwt-contrib] Change in gwt[master]: Allow @UIHandler annotated methods to be private.
Thomas Broyer has posted comments on this change. Change subject: Allow @UIHandler annotated methods to be private. .. Patch Set 2: A simple "fix" is to only use the JSNI method if the method is private. And in that case, also emit a warning that we only support this scenario for backwards compatibility (see Brian and Matthew comments; though there are already cases which violates the least-surprise principle Brian points out: JSR303 –not stripped-down profile that Dagger implements, despite being more sensible IMO– does allow @Inject-ing private classes/ctors/fields/methods) and will remove it in a future release. BTW, have you tried updating the existing code that uses privates using a script/whatever? -- To view, visit https://gwt-review.googlesource.com/2450 To unsubscribe, visit https://gwt-review.googlesource.com/settings Gerrit-MessageType: comment Gerrit-Change-Id: I03c7787ced5a339a74d49ec917d48edebd5dbb8f Gerrit-PatchSet: 2 Gerrit-Project: gwt Gerrit-Branch: master Gerrit-Owner: Roberto Lublinerman Gerrit-Reviewer: Brian Slesinsky Gerrit-Reviewer: Goktug Gokdogan Gerrit-Reviewer: Matthew Dempsky Gerrit-Reviewer: Roberto Lublinerman Gerrit-Reviewer: Thomas Broyer Gerrit-HasComments: No -- -- http://groups.google.com/group/Google-Web-Toolkit-Contributors --- You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[gwt-contrib] Change in gwt[master]: Allow @UIHandler annotated methods to be private.
Roberto Lublinerman has posted comments on this change. Change subject: Allow @UIHandler annotated methods to be private. .. Patch Set 2: The JsInliner should take care of this case. Methods that are called in only one place (like the *__native one in this case) are inlined. The only drawback is that this happens quite late. I'll have a look and make sure it is properly inlined and see if we it makes us miss some optimization opportunities. -- To view, visit https://gwt-review.googlesource.com/2450 To unsubscribe, visit https://gwt-review.googlesource.com/settings Gerrit-MessageType: comment Gerrit-Change-Id: I03c7787ced5a339a74d49ec917d48edebd5dbb8f Gerrit-PatchSet: 2 Gerrit-Project: gwt Gerrit-Branch: master Gerrit-Owner: Roberto Lublinerman Gerrit-Reviewer: Brian Slesinsky Gerrit-Reviewer: Goktug Gokdogan Gerrit-Reviewer: Matthew Dempsky Gerrit-Reviewer: Roberto Lublinerman Gerrit-Reviewer: Thomas Broyer Gerrit-HasComments: No -- -- http://groups.google.com/group/Google-Web-Toolkit-Contributors --- You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[gwt-contrib] Change in gwt[master]: Allow @UIHandler annotated methods to be private.
Goktug Gokdogan has posted comments on this change. Change subject: Allow @UIHandler annotated methods to be private. .. Patch Set 2: I think there are optimization steps in JS which can reduce the code bloat. Roberto, can you take a look and see if this ends up causing any significant amount increase in the final output? -- To view, visit https://gwt-review.googlesource.com/2450 To unsubscribe, visit https://gwt-review.googlesource.com/settings Gerrit-MessageType: comment Gerrit-Change-Id: I03c7787ced5a339a74d49ec917d48edebd5dbb8f Gerrit-PatchSet: 2 Gerrit-Project: gwt Gerrit-Branch: master Gerrit-Owner: Roberto Lublinerman Gerrit-Reviewer: Brian Slesinsky Gerrit-Reviewer: Goktug Gokdogan Gerrit-Reviewer: Matthew Dempsky Gerrit-Reviewer: Thomas Broyer Gerrit-HasComments: No -- -- http://groups.google.com/group/Google-Web-Toolkit-Contributors --- You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[gwt-contrib] Change in gwt[master]: Allow @UIHandler annotated methods to be private.
Thomas Broyer has posted comments on this change. Change subject: Allow @UIHandler annotated methods to be private. .. Patch Set 2: IIRC, this new behavior is also consistent with @Inject in google-gin which again makes sense to me. But this causes code-bloats because the compiler cannot optimize the same as with non-JSNI methods; at least that was the case some time ago, maybe it has changed): https://code.google.com/p/google-gin/issues/detail?id=35 -- To view, visit https://gwt-review.googlesource.com/2450 To unsubscribe, visit https://gwt-review.googlesource.com/settings Gerrit-MessageType: comment Gerrit-Change-Id: I03c7787ced5a339a74d49ec917d48edebd5dbb8f Gerrit-PatchSet: 2 Gerrit-Project: gwt Gerrit-Branch: master Gerrit-Owner: Roberto Lublinerman Gerrit-Reviewer: Brian Slesinsky Gerrit-Reviewer: Goktug Gokdogan Gerrit-Reviewer: Matthew Dempsky Gerrit-Reviewer: Thomas Broyer Gerrit-HasComments: No -- -- http://groups.google.com/group/Google-Web-Toolkit-Contributors --- You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[gwt-contrib] Change in gwt[master]: Allow @UIHandler annotated methods to be private.
Brian Slesinsky has posted comments on this change. Change subject: Allow @UIHandler annotated methods to be private. .. Patch Set 2: The surprise comes from violating expectations. I would expect all callers to a private method to be in the same file. And tools assume this too; for example IDEA will mark a method as unused if it private and there are no uses in the same file. So, I might delete the method, then recompile and discover that it is used after all. And I wonder if other tools might be fooled, for example someday there might be a tool to automatically remove all private unused methods in your code, and such tools would need to be modified to look for the UIHandler annotation. This isn't a big deal today since there is no such tool and there is an annotation, which seems like a sufficient warning to the reader. But I do think it's slightly simpler and more future-proof if "private" means what the Java specification says, not "private except for these special cases that you have to remember." -- To view, visit https://gwt-review.googlesource.com/2450 To unsubscribe, visit https://gwt-review.googlesource.com/settings Gerrit-MessageType: comment Gerrit-Change-Id: I03c7787ced5a339a74d49ec917d48edebd5dbb8f Gerrit-PatchSet: 2 Gerrit-Project: gwt Gerrit-Branch: master Gerrit-Owner: Roberto Lublinerman Gerrit-Reviewer: Brian Slesinsky Gerrit-Reviewer: Goktug Gokdogan Gerrit-Reviewer: Matthew Dempsky Gerrit-Reviewer: Thomas Broyer Gerrit-HasComments: No -- -- http://groups.google.com/group/Google-Web-Toolkit-Contributors --- You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[gwt-contrib] Change in gwt[master]: Allow @UIHandler annotated methods to be private.
Goktug Gokdogan has posted comments on this change. Change subject: Allow @UIHandler annotated methods to be private. .. Patch Set 2: If somebody thinks that a field/method needs to be package visible for uibinder then they will do that and it will work as expected without a surprise. Things usually cause surprises when they don't work, not when they do work =) About common practice; javax.inject says it should work with privates and traditional java (Spring, Guice) all work with privates. Also note that Dagger is trying minimize reflection for performance reasons and it might be the only reason for the exclusion. Putting everything aside, most importantly from a practical perspective, exposing your fields in your class is pretty annoying to make UiBinder work =) -- To view, visit https://gwt-review.googlesource.com/2450 To unsubscribe, visit https://gwt-review.googlesource.com/settings Gerrit-MessageType: comment Gerrit-Change-Id: I03c7787ced5a339a74d49ec917d48edebd5dbb8f Gerrit-PatchSet: 2 Gerrit-Project: gwt Gerrit-Branch: master Gerrit-Owner: Roberto Lublinerman Gerrit-Reviewer: Brian Slesinsky Gerrit-Reviewer: Goktug Gokdogan Gerrit-Reviewer: Matthew Dempsky Gerrit-Reviewer: Thomas Broyer Gerrit-HasComments: No -- -- http://groups.google.com/group/Google-Web-Toolkit-Contributors --- You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[gwt-contrib] Change in gwt[master]: Allow @UIHandler annotated methods to be private.
Matthew Dempsky has posted comments on this change. Change subject: Allow @UIHandler annotated methods to be private. .. Patch Set 2: Current behavior (forcing it to be package-visible) I think is just an incident of how generators usually work. It's also the behavior for how annotation processing generated code works; e.g., if you use Dagger, your @Provides methods need to be package-visible too. I think it's least surprising to require the methods to package-visible, because it'll be consistent with requirements that Java programmers will/may already be familiar with. -- To view, visit https://gwt-review.googlesource.com/2450 To unsubscribe, visit https://gwt-review.googlesource.com/settings Gerrit-MessageType: comment Gerrit-Change-Id: I03c7787ced5a339a74d49ec917d48edebd5dbb8f Gerrit-PatchSet: 2 Gerrit-Project: gwt Gerrit-Branch: master Gerrit-Owner: Roberto Lublinerman Gerrit-Reviewer: Brian Slesinsky Gerrit-Reviewer: Goktug Gokdogan Gerrit-Reviewer: Matthew Dempsky Gerrit-Reviewer: Thomas Broyer Gerrit-HasComments: No -- -- http://groups.google.com/group/Google-Web-Toolkit-Contributors --- You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[gwt-contrib] Change in gwt[master]: Allow @UIHandler annotated methods to be private.
Brian Slesinsky has posted comments on this change. Change subject: Allow @UIHandler annotated methods to be private. .. Patch Set 2: I think we need to test this in dev mode with the JDT upgrade. If we're using the bytecode in dev mode (I am not sure) then I can imagine that calls to private methods would stop working after the JDT upgrade. -- To view, visit https://gwt-review.googlesource.com/2450 To unsubscribe, visit https://gwt-review.googlesource.com/settings Gerrit-MessageType: comment Gerrit-Change-Id: I03c7787ced5a339a74d49ec917d48edebd5dbb8f Gerrit-PatchSet: 2 Gerrit-Project: gwt Gerrit-Branch: master Gerrit-Owner: Roberto Lublinerman Gerrit-Reviewer: Brian Slesinsky Gerrit-Reviewer: Goktug Gokdogan Gerrit-Reviewer: Matthew Dempsky Gerrit-Reviewer: Thomas Broyer Gerrit-HasComments: No -- -- http://groups.google.com/group/Google-Web-Toolkit-Contributors --- You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[gwt-contrib] Change in gwt[master]: Allow @UIHandler annotated methods to be private.
Goktug Gokdogan has posted comments on this change. Change subject: Allow @UIHandler annotated methods to be private. .. Patch Set 2: Actually, I encouraged this solution so I will try to answer. I think enabling private methods with @UiHandler (and later with UiField) is a reasonable feature not just a workaround. While using UiBinder, many times I hoped that was how it was behaving originally - especially with UiFields. If there were no UiHandler magic then we would have created an anonymous class to delegate to a private handler method instead of exposing the handler method outside. Current behavior (forcing it to be package-visible) I think is just an incident of how generators usually work. IIRC, this new behavior is also consistent with @Inject in google-gin which again makes sense to me. -- To view, visit https://gwt-review.googlesource.com/2450 To unsubscribe, visit https://gwt-review.googlesource.com/settings Gerrit-MessageType: comment Gerrit-Change-Id: I03c7787ced5a339a74d49ec917d48edebd5dbb8f Gerrit-PatchSet: 2 Gerrit-Project: gwt Gerrit-Branch: master Gerrit-Owner: Roberto Lublinerman Gerrit-Reviewer: Goktug Gokdogan Gerrit-Reviewer: Matthew Dempsky Gerrit-Reviewer: Thomas Broyer Gerrit-HasComments: No -- -- http://groups.google.com/group/Google-Web-Toolkit-Contributors --- You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[gwt-contrib] Change in gwt[master]: Allow @UIHandler annotated methods to be private.
Thomas Broyer has posted comments on this change. Change subject: Allow @UIHandler annotated methods to be private. .. Patch Set 2: As tedious as it can be, I'd rather ask people to fix the projects. If there are really too many classes to fix, or you'd like to fix them after the switch to JDT 3.8 (i.e. this is a temporary change), then at least print a warning. But honestly, you can probably fix 95% of the files with a recursive 'sed'. Something like (untested): sed 'N;/@UiHandler\s*\([^)]\)\n.*\bprivate /s/\bprivate //;P;D' file.java (inspired from http://stackoverflow.com/a/4511290/116472; assumes the @UiHandler is on the line just before the method) -- To view, visit https://gwt-review.googlesource.com/2450 To unsubscribe, visit https://gwt-review.googlesource.com/settings Gerrit-MessageType: comment Gerrit-Change-Id: I03c7787ced5a339a74d49ec917d48edebd5dbb8f Gerrit-PatchSet: 2 Gerrit-Project: gwt Gerrit-Branch: master Gerrit-Owner: Roberto Lublinerman Gerrit-Reviewer: Goktug Gokdogan Gerrit-Reviewer: Thomas Broyer Gerrit-HasComments: No -- -- http://groups.google.com/group/Google-Web-Toolkit-Contributors --- You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[gwt-contrib] Change in gwt[master]: Allow @UIHandler annotated methods to be private.
Roberto Lublinerman has uploaded a new patch set (#2). Change subject: Allow @UIHandler annotated methods to be private. .. Allow @UIHandler annotated methods to be private. Even though @UIHandler annotated methods were not allowed to be private, a bug in JDT 3.4 was dropping the private modifier from methods that have annotations in parameters and this was causing UIHandler to work with private methods. For example it was allowing: @UiHandler("event") private void event(@Nullable Event event) { ...} The JDT bug is fixed in JDT 3.8, thus migrating to JDT 3.8 causes breakage in many projects that unknowingly depend on the bug being present. Change-Id: I03c7787ced5a339a74d49ec917d48edebd5dbb8f Review-Link: https://gwt-review.googlesource.com/#/c/2450/ --- M user/src/com/google/gwt/uibinder/rebind/HandlerEvaluator.java M user/test/com/google/gwt/uibinder/test/client/HandlerDemo.java 2 files changed, 13 insertions(+), 11 deletions(-) -- To view, visit https://gwt-review.googlesource.com/2450 To unsubscribe, visit https://gwt-review.googlesource.com/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I03c7787ced5a339a74d49ec917d48edebd5dbb8f Gerrit-PatchSet: 2 Gerrit-Project: gwt Gerrit-Branch: master Gerrit-Owner: Roberto Lublinerman Gerrit-Reviewer: Goktug Gokdogan Gerrit-Reviewer: Thomas Broyer -- -- http://groups.google.com/group/Google-Web-Toolkit-Contributors --- You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[gwt-contrib] Change in gwt[master]: Allow @UIHandler annotated methods to be private.
Roberto Lublinerman has uploaded a new change for review. https://gwt-review.googlesource.com/2450 Change subject: Allow @UIHandler annotated methods to be private. .. Allow @UIHandler annotated methods to be private. Even though @UIHandler annotated methods were not allowed to be private, a bug in JDT 3.4 was dropping the private modifier from methods that has annotations in parameters and this was causing UIHandler to work with private methods. The JDT bug is fixed in JDT 3.8, thus migrating to JDT 3.8 causes breakage in many projects that unknowingly depend on the bug being present. Change-Id: I03c7787ced5a339a74d49ec917d48edebd5dbb8f --- M user/src/com/google/gwt/uibinder/rebind/HandlerEvaluator.java M user/test/com/google/gwt/uibinder/test/client/HandlerDemo.java 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/user/src/com/google/gwt/uibinder/rebind/HandlerEvaluator.java b/user/src/com/google/gwt/uibinder/rebind/HandlerEvaluator.java index afbecbd..7420c8c 100644 --- a/user/src/com/google/gwt/uibinder/rebind/HandlerEvaluator.java +++ b/user/src/com/google/gwt/uibinder/rebind/HandlerEvaluator.java @@ -115,17 +115,12 @@ // Iterate through all methods defined in the class. for (JMethod method : ownerClass.getUiHandlers()) { - // Evaluate the method. - String boundMethod = method.getName(); - if (method.isPrivate()) { -logger.die("Method '%s' cannot be private.", boundMethod); - } // Retrieves both event and handler types. JParameter[] parameters = method.getParameters(); if (parameters.length != 1) { logger.die("Method '%s' must have a single event parameter defined.", -boundMethod); + method.getName()); } JClassType eventType = parameters[0].getType().isClass(); if (eventType == null) { @@ -141,7 +136,7 @@ // Cool to add the handler in the output. String handlerVarName = HANDLER_BASE_NAME + (++varCounter); writeHandler(writer, uiOwner, handlerVarName, handlerType, eventType, - boundMethod); + method); // Adds the handler created above. UiHandler annotation = method.getAnnotation(UiHandler.class); @@ -151,7 +146,7 @@ if (fieldWriter == null) { logger.die( ("Method '%s' can not be bound. You probably missed ui:field='%s' " - + "in the template."), boundMethod, objectName); + + "in the template."), method.getName(), objectName); } // Retrieves the "add handler" method in the object. @@ -181,7 +176,7 @@ */ protected void writeHandler(IndentedWriter writer, String uiOwner, String handlerVarName, JClassType handlerType, JClassType eventType, - String boundMethod) throws UnableToCompleteException { + JMethod boundMethod) throws UnableToCompleteException { // Retrieves the single method (usually 'onSomething') related to all // handlers. Ex: onClick in ClickHandler, onBlur in BlurHandler ... @@ -206,9 +201,15 @@ writer.write("public void %1$s(%2$s event) {", methods[0].getName(), eventType.getParameterizedQualifiedSourceName()); writer.indent(); -writer.write("%1$s.%2$s(event);", uiOwner, boundMethod); +writer.write("_%1$s__native(%2$s, event);", methods[0].getName(), uiOwner); writer.outdent(); writer.write("}"); +writer.write("private native void _%1$s__native(Object owner, %2$s event) /*-{", +methods[0].getName(), eventType.getParameterizedQualifiedSourceName()); +writer.indent(); +writer.write("owner.%1$s(event);", boundMethod.getJsniSignature()); +writer.outdent(); +writer.write("}-*/;"); writer.outdent(); writer.write("};"); } diff --git a/user/test/com/google/gwt/uibinder/test/client/HandlerDemo.java b/user/test/com/google/gwt/uibinder/test/client/HandlerDemo.java index 4416a5a..f0eaacf 100644 --- a/user/test/com/google/gwt/uibinder/test/client/HandlerDemo.java +++ b/user/test/com/google/gwt/uibinder/test/client/HandlerDemo.java @@ -65,8 +65,9 @@ eventMessage(event); } + // private event handler should work. @UiHandler({"buttonClick", "labelClick"}) - void doClick(ClickEvent event) { + private void doClick(ClickEvent event) { eventMessage(event); } -- To view, visit https://gwt-review.googlesource.com/2450 To unsubscribe, visit https://gwt-review.googlesource.com/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I03c7787ced5a339a74d49ec917d48edebd5dbb8f Gerrit-PatchSet: 1 Gerrit-Project: gwt Gerrit-Branch: master Gerrit-Owner: Roberto Lublinerman -- -- http://groups.google.com/group/Google-Web-Toolkit-Contributors --- You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group. To unsubscribe from this group and stop receiving emails from