Thomas Broyer has posted comments on this change.
Change subject: Move arrow key functions from Tree to KeyCodes
......................................................................
Patch Set 2:
(1 comment)
....................................................
File user/src/com/google/gwt/event/dom/client/KeyCodes.java
Line 460: public static int maybeSwapArrowKeysBasedOnLocale(boolean
isRtl, int code) {
Well, I like how straightforward it is to just:
switch (fixupThisRtlMadnessForTheLazyMe(keycode, currentLocale.isRtl())) {
case KEY_LEFT:
// line start
break;
case KEY_RIGHT:
// line end
break;
}
Compared to:
// Fixup this RTL madness; gosh I'm lazy I wish it'd be a one-liner
if (currentLocale.isRtl()) {
keycode = rtl2ltr(keycode);
}
// now we're normalized to LTR
switch (keycode) {
case KEY_LEFT:
// line start
break;
case KEY_RIGHT:
// line end
break;
}
In the widgets changed to use this method, I wouldn't have used an
intermediate isRtl variable (having isRtl as the last argument makes it
more readable with the inlined isRtl(), see above)
--
To view, visit https://gwt-review.googlesource.com/3662
To unsubscribe, visit https://gwt-review.googlesource.com/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I811520d330c181958dd67cbfbe30c46becebbe43
Gerrit-PatchSet: 2
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Daniel Kurka <[email protected]>
Gerrit-Reviewer: Daniel Kurka <[email protected]>
Gerrit-Reviewer: Leeroy Jenkins <[email protected]>
Gerrit-Reviewer: Matthew Dempsky <[email protected]>
Gerrit-Reviewer: Thomas Broyer <[email protected]>
Gerrit-HasComments: Yes
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
---
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.