[gwt-contrib] Re: Allow detached JDO objects to be transferred via RPC
Hi Bod and Dan, Very happy to see that this issue is on its way to be solved :) Nevertheless, I think it would be useful if JDO management code and RPC serialization can be separated : instead of having for (Class iface : interfaces) { if (javax.jdo.spi.Detachable.equals(iface.getName())) { // JDO specific code } } a code like this would be better : for (Class iface : interfaces) { if (this.serializationTransformer.isTransformable(iface)) { serializationTransformer.transform(instanceClass); } } where JDO specific code is encapsulated in a specific code. As another side benefit, this mechanism could be used to enhance GWT serialization process for any other persistence library. HTH Bruno On 29 juin, 19:16, b...@google.com wrote: http://gwt-code-reviews.appspot.com/47807/diff/1/9 File user/src/com/google/gwt/user/client/rpc/WeakMapping.java (right): http://gwt-code-reviews.appspot.com/47807/diff/1/9#newcode31 Line 31: public static Object get(Object instance, String key) { On 2009/06/29 15:34:02, Dan Rice wrote: I'm not sure what can be said about the namespace. What do you have in mind? Note that the key space is module-wide, so some care should be taken to choose sufficiently unique identifiers. http://gwt-code-reviews.appspot.com/47807 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Misc JS problem cleanup
On 2009/06/19 17:30:23, jgw wrote: On 2009/06/19 01:37:23, scottb wrote: LGTM. Good catches, all. BTW, Scott -- could you please go ahead and commit this when you have a moment? I'd like to get these into the 1.6 maintenance release. http://gwt-code-reviews.appspot.com/42802 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Fix for Firefox 3.5 relatedTarget bug (https://bugzilla.mozilla.org/show_bug.cgi?id=497780)
Reviewers: jlabanca, Please review this at http://gwt-code-reviews.appspot.com/49803 Affected files: M user/src/com/google/gwt/dom/client/DOMImplMozilla.java M user/src/com/google/gwt/user/client/impl/DOMImplStandard.java Index: user/src/com/google/gwt/dom/client/DOMImplMozilla.java === --- user/src/com/google/gwt/dom/client/DOMImplMozilla.java (revision 5638) +++ user/src/com/google/gwt/dom/client/DOMImplMozilla.java (working copy) @@ -37,6 +37,20 @@ }-*/; @Override + public native EventTarget eventGetRelatedTarget(NativeEvent evt) /*-{ +// Hack around Mozilla bug 497780 (relatedTarget sometimes returns XUL +// elements). Trying to access relatedTarget.nodeName will throw an +// exception if it's a XUL element. +var relatedTarget = evt.relatedTarget; +try { + var nodeName = relatedTarget.nodeName; + return relatedTarget; +} catch (e) { + return null; +} + }-*/; + + @Override public int getAbsoluteLeft(Element elem) { return getAbsoluteLeftImpl(elem.getOwnerDocument().getViewportElement(), elem); Index: user/src/com/google/gwt/user/client/impl/DOMImplStandard.java === --- user/src/com/google/gwt/user/client/impl/DOMImplStandard.java (revision 5638) +++ user/src/com/google/gwt/user/client/impl/DOMImplStandard.java (working copy) @@ -39,22 +39,30 @@ private static JavaScriptObject dispatchEvent; @Override - public native Element eventGetFromElement(Event evt) /*-{ -if (evt.type == mouseover) - return evt.relatedTarget; -if (evt.type == mouseout) - return evt.target; + public Element eventGetFromElement(Event evt) { +if (evt.getType().equals(mouseover)) { + return evt.getRelatedTarget().cast(); +} + +if (evt.getType().equals(mouseout)) { + return evt.getTarget().cast(); +} + return null; - }-*/; + } @Override - public native Element eventGetToElement(Event evt) /*-{ -if (evt.type == mouseover) - return evt.target; -if (evt.type == mouseout) - return evt.relatedTarget; + public Element eventGetToElement(Event evt) { +if (evt.getType().equals(mouseover)) { + return evt.getTarget().cast(); +} + +if (evt.getType().equals(mouseout)) { + return evt.getRelatedTarget().cast(); +} + return null; - }-*/; + } @Override public native Element getChild(Element elem, int index) /*-{ --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Fix for Firefox 3.5 relatedTarget bug (https://bugzilla.mozilla.org/show_bug.cgi?id=497780)
Note that the referenced Firefox bug is marked as fixed/resolved, but it didn't make it into the Firefox 3.5 release branch (they're expecting to ship a fix in 3.5.1, which essentially means we're all going to be stuck with this behavior for at least a year or so). I've tested this patch on a large internal application that was throwing exceptions because of the aforementioned bug, and it very clearly fixed the issue. http://gwt-code-reviews.appspot.com/49803/diff/1/3 File user/src/com/google/gwt/user/client/impl/DOMImplStandard.java (right): http://gwt-code-reviews.appspot.com/49803/diff/1/3#newcode65 Line 65: } Changing these methods to simply use the Java Event.getRelatedTarget() methods ensures that relatedTarget will always be accessed through the guarded method. Also, don't worry about the .cast() calls -- these (old) methods have always assumed that an Element would get returned (as opposed to an EventTarget). So they're no more wrong than they ever were :) http://gwt-code-reviews.appspot.com/49803 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Update RichTextAreaImplSafari
Looks good, modulo my comment about repeating method declarations in the formatter interfaces. http://gwt-code-reviews.appspot.com/49802/diff/1/5 File user/src/com/google/gwt/user/client/ui/RichTextArea.java (right): http://gwt-code-reviews.appspot.com/49802/diff/1/5#newcode485 Line 485: void undo(); Is there any particular reason for copying all the basic and extended formatter methods into this derived interface? Couldn't we just leave them where they are until the deprecated interfaces are removed? I doubt it makes a substantive difference, but it seems kind of smelly. http://gwt-code-reviews.appspot.com/49802 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Fix for Firefox 3.5 relatedTarget bug (https://bugzilla.mozilla.org/show_bug.cgi?id=497780)
LGTM http://gwt-code-reviews.appspot.com/49803 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Update RichTextAreaImplSafari
http://gwt-code-reviews.appspot.com/49802/diff/1/5 File user/src/com/google/gwt/user/client/ui/RichTextArea.java (right): http://gwt-code-reviews.appspot.com/49802/diff/1/5#newcode485 Line 485: void undo(); It prevents a deprecation compiler warning when using the methods. If we inherit them from Basic/ExtendedFormatter, we get deprecation warnings. http://gwt-code-reviews.appspot.com/49802 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r5639 - Removed most of the RichTextAreaImplSafari implementation used only for older versions of...
Author: jlaba...@google.com Date: Tue Jun 30 06:58:38 2009 New Revision: 5639 Modified: trunk/user/src/com/google/gwt/user/client/ui/RichTextArea.java trunk/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImpl.java trunk/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplSafari.java trunk/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplStandard.java Log: Removed most of the RichTextAreaImplSafari implementation used only for older versions of Safari. Patch by: jlabanca Review by: jgw Issue: 2813 Modified: trunk/user/src/com/google/gwt/user/client/ui/RichTextArea.java == --- trunk/user/src/com/google/gwt/user/client/ui/RichTextArea.java (original) +++ trunk/user/src/com/google/gwt/user/client/ui/RichTextArea.java Tue Jun 30 06:58:38 2009 @@ -56,7 +56,10 @@ * focused at least once. If you just want to initialize the content of * the {...@link RichTextArea}, use {...@link RichTextArea#setHTML(String)} instead. * /p + * + * @deprecated use {...@link Formatter} instead */ + @Deprecated public interface BasicFormatter { /** @@ -188,7 +191,10 @@ * focused at least once. If you just want to initialize the content of * the {...@link RichTextArea}, use {...@link RichTextArea#setHTML(String)} instead. * /p + * + * @deprecated use {...@link Formatter} instead */ + @Deprecated public interface ExtendedFormatter extends BasicFormatter { /** @@ -271,6 +277,215 @@ } /** + * p + * This interface is used to access full formatting options, when available. + * If the implementation supports full formatting, then + * {...@link RichTextArea#getFormatter()} will return an instance of this + * class. + * /p + * p + * The formatter will format the user selected text in the + * {...@link RichTextArea}. As a result, it will only work reliably if the + * {...@link RichTextArea} is attached, visible to on the page, and has been + * focused at least once. If you just want to initialize the content of + * the {...@link RichTextArea}, use {...@link RichTextArea#setHTML(String)} instead. + * /p + */ + public interface Formatter extends ExtendedFormatter { +/** + * Creates a link to the supplied URL. + * + * @param url the URL to be linked to + */ +void createLink(String url); + +/** + * Gets the background color. + * + * @return the background color + */ +String getBackColor(); + +/** + * Gets the foreground color. + * + * @return the foreground color + */ +String getForeColor(); + +/** + * Inserts a horizontal rule. + */ +void insertHorizontalRule(); + +/** + * Inserts generic html. + * + * @param html the HTML to insert + */ +void insertHTML(String html); + +/** + * Inserts an image element. + * + * @param url the url of the image to be inserted + */ +void insertImage(String url); + +/** + * Starts an numbered list. Indentation will create nested items. + */ +void insertOrderedList(); + +/** + * Starts an bulleted list. Indentation will create nested items. + */ +void insertUnorderedList(); + +/** + * Is the current region bold? + * + * @return true if the current region is bold + */ +boolean isBold(); + +/** + * Is the current region italic? + * + * @return true if the current region is italic + */ +boolean isItalic(); + +/** + * Is the current region strikethrough? + * + * @return true if the current region is strikethrough + */ +boolean isStrikethrough(); + +/** + * Is the current region subscript? + * + * @return true if the current region is subscript + */ +boolean isSubscript(); + +/** + * Is the current region superscript? + * + * @return true if the current region is superscript + */ +boolean isSuperscript(); + +/** + * Is the current region underlined? + * + * @return true if the current region is underlined + */ +boolean isUnderlined(); + +/** + * Left indent. + */ +void leftIndent(); + +/** + * Redo an action that was just undone. + */ +void redo(); + +/** + * Removes all formatting on the selected text. + */ +void removeFormat(); + +/** + * Removes any link from the selected text. + */ +void removeLink(); + +/** + * Right indent. + */ +void rightIndent(); + +/** + * Selects all the text. + */ +void selectAll(); + +/** + * Sets the background color. + * + * @param color the new background color + */ +void setBackColor(String color); + +/** + * Sets the font name. + * + * @param name the new font name + */ +
[gwt-contrib] Re: Add Impl.getNameOf() to expose JNameOf nodes to Java code
Thanks for the review; the JSNI lookup logic had already been extracted into JsniRefLookup by Lex some number of weeks ago. Committed at r5640. http://gwt-code-reviews.appspot.com/46802 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Fix for Firefox 3.5 relatedTarget bug (https://bugzilla.mozilla.org/show_bug.cgi?id=497780)
On 2009/06/30 13:45:55, jlabanca wrote: LGTM Thanks, commited at r5641. http://gwt-code-reviews.appspot.com/49803 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Allow detached JDO objects to be transferred via RPC
Hi Bruno - I've uploaded a new patch that's more along these lines. Hopefully it will do what you are looking for. Thanks, Dan On Tue, Jun 30, 2009 at 4:15 AM, bruno bruno.marches...@gmail.com wrote: Hi Bod and Dan, Very happy to see that this issue is on its way to be solved :) Nevertheless, I think it would be useful if JDO management code and RPC serialization can be separated : instead of having for (Class iface : interfaces) { if (javax.jdo.spi.Detachable.equals(iface.getName())) { // JDO specific code } } a code like this would be better : for (Class iface : interfaces) { if (this.serializationTransformer.isTransformable(iface)) { serializationTransformer.transform(instanceClass); } } where JDO specific code is encapsulated in a specific code. As another side benefit, this mechanism could be used to enhance GWT serialization process for any other persistence library. HTH Bruno On 29 juin, 19:16, b...@google.com wrote: http://gwt-code-reviews.appspot.com/47807/diff/1/9 File user/src/com/google/gwt/user/client/rpc/WeakMapping.java (right): http://gwt-code-reviews.appspot.com/47807/diff/1/9#newcode31 Line 31: public static Object get(Object instance, String key) { On 2009/06/29 15:34:02, Dan Rice wrote: I'm not sure what can be said about the namespace. What do you have in mind? Note that the key space is module-wide, so some care should be taken to choose sufficiently unique identifiers. http://gwt-code-reviews.appspot.com/47807 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: SoyLite
My +1 in general. On Katharina's point, is it practical to just add a note to the HTML output, rather than looking for a code change, to the effect of some small methods may have been inlined away, perhaps citing an option (-XsoycExtra, I see in the patch? Or maybe an option to -soyc, like -soyc[=default|detailed]?) to use for accurate-but-heavy-and-confusing output... On Mon, Jun 29, 2009 at 4:48 PM, Katharina Probst kpro...@google.comwrote: Hi Lex, all of what you say makes sense to me. I think SoyLite is a great idea and we should go ahead with it. I do have one concern, however: as you mention below, some methods will simply appear to disappear under SoyLite. For instance, in your first example, Point.getX() will not appear to produce any output. I'm a bit afraid that this will also cause confusion (and, similarly to partial billing, some people may think the SOYC report is wrong). It is *less* confusing than what's currently in trunk, but I am wondering whether there could be a hybrid approach, where we record in a lightweight way, without reverting back to the current expensive SOYC, where something gets inlined. It appears that partial billing is mainly due to inlining. Would it make sense to annotate methods with inlining targets, so that the SOYC report could show, for every method, all places where it was inlined into? While this would incur an additional cost during compilation, it could clear up some confusion in the final report. Is this too heavy-weight? For right now, I think SoyLite is a great idea. I would consider inlining tracing a possible future enhancement. kathrin On Mon, Jun 29, 2009 at 12:20 PM, Lex Spoon sp...@google.com wrote: On Sun, Jun 28, 2009 at 12:19 AM, John Tamplinj...@google.com wrote: On Fri, Jun 26, 2009 at 3:20 PM, Lex Spoon sp...@google.com wrote: I've been trying to think of ways to speed up the -soyc option, and here is the result of one attempt. What do people think? The idea is to mimick some aspects of the speedy symbolMaps files. Instead of using the enhanced SourceInfo's to track links between before-optimization and after-optimization code, bill size information only to the program as it stands at the end of Java optimization. Additionally, be careful to avoid needing any massaging of the data in StoryRecorder; instead, make a single pass through all the size information. How much would it be skewed by JS-level optimizations? What about JSNI code? The basic framework is the same in both cases. Output bytes get billed back to Java code. That's final output bytes, after all optimization is complete. Both would bill JSNI code to the associated Java native method. The difference is whether to map each byte to multiple methods, or to pick just one. Let me give some examples. Suppose Point is a class with a method getX() that is always inlined. Thus, Point.getX() is inlined away during Java optimization. Then suppose some method TextArea.getArea() calls Point.getX(). In trunk, Point.getX() is billed for every place it gets inlined, so it will show up in the size breakdown. TextArea.getArea(), meanwhile, will not be billed for all of its output bytes; the ones that it got by inlining Point.getX() will be partially billed back to Point.getX(). To contrast, with SoyLite, Point.getX() would not show up in the size output, and TextArea.getArea() would be billed slightly more. As another example, suppose Java method Integer.toString ends up compiling to JavaScript function toString_3. Also, suppose the compiler creates a static version Integer.toString$, which then compiles to function toString_4. In trunk, Integer.toString is given full blame for toString_3 and half blame for toString_4; Integer.toString$ is given half blame for toString_4. With SoyLite, Integer.toString is given full blame for toString_3, and Integer.toString$ is given full blame for toString_4. Does that clear things up better? If not, perhaps we should examine Showaces in more detail to find real examples of differences to look at. Lex --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: IE8 disappearing history
Joel, I'm out of the office today, but I'll be sure to give it a shot first thing tomorrow and report back. Thanks. - Amir On Jun 30, 5:32 am, Joel Webber j...@google.com wrote: Amir, I'd be very interested in any way you can find to reproduce this bug reliably. The History implementation in IE8 is very simple, because they added direct support for using the url #hash to update the history state, and for the onhashchange event. It is possible that we're doing something in the iframe linker's bootstrap script to tickle this bug, though it's not clear to me what that might be. Since you're building with trunk right now, you could also try building against the current contents of the 1.6 release branch (/releases/1.6), which has full IE8 support, but not the linker changes. We're going to be releasing out of this branch very soon (as soon as we merge the fix for a Firefox 3.5 regression they are shipping today). Cheers, joel. On Tue, Jun 30, 2009 at 12:01 AM, Amir Kashani amirkash...@gmail.comwrote: I’m having a strange issue with trunk and IE8 where the browser’s history stack inexplicably “disappears”. That is, the history drop down list empties (including previously visited non-GWT sites, like MSN) and the back/forward buttons don’t work. My guess is that this is a bug in IE8 that GWT is somehow triggering since as far as I know, an application can’t explicitly clear a browser’s back history. I haven’t been able to find a definitive set of steps to duplicate this. I’ll be clicking along, adding items to the history stack and regularly checking the history drop-down menu until at some point, the list is either completely empty or only contains the current page. Other times, I’ll click back or forward, and as soon as I do, the buttons become disabled (list is empty). To complicate matters, I haven’t been able to create a simple example that exhibits the bug; it only occurs with my fairly large application. I _think_ I’ve narrowed down the issue to a change made to the IFrame linker in r5393. Using r5392, history works exactly as expected. Unfortunately, I can’t use r5393 directly, as it has a bug which isn’t fixed way until r5523, where document.body is accessed before it is initialized, causing my app to not load at all. Swapping out IFrameTemplate.js with r5523’s version exhibits the broken behavior with r5393. I can’t for the life of me explain how the IFrame linker change causes this, or why it’s not a consistent set of steps (timing issue?) or why it only happens with my application and not smaller ones. Any insight or tips on how to further track down the problem so I can submit a coherent bug report would be greatly appreciated. - Amir --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] derpc review: hosted-mode user code, rebind, and related tests
Sorry this took so long -- its a lot of code. In general it looks pretty good - mostly just minor nits and a couple clarifications requested, plus one potentially significant issue. I would like to see example payloads in comments (not sure the best place to put it -- maybe in the CommandSink implementations, SimplePayloadDecoder, etc). * TestSetValidator.java, others* I am getting a checkstyle error here on the import order. Eclipse doesn't reorder them, but checkstyle requires that static imports come at the end of each group of imports and ordered among themselves. I am attaching a patch to gwt.importorder which gets close, but it doesn't exactly match checkstyle (if there are static and non-static imports in the same prefix, they will be separated by Eclipse but Checkstyle wants them in the same group). After applying the patch, Ctrl-Shift-O will rearrange imports in the order Checkstyle is happy with. This also needs to be done in the other files where static imports are used. *HybridServiceServlet.java* writeResponse is private and unused, so it needs to have @SuppressWarnings(unused) // referenced by JSNI added. *CustomFieldSerializerTest.java* Why does this take 10x as long? The build already takes long enough and if there is an issue getting to the server I would rather it fail in quicker than 50s. How about 10s if it needs to be increased? *InheritanceTest.java* I know it is existing code, but I would change the anonymous subclasses of AsyncCallback to be AsyncCallbackObject to avoid raw type warnings. *CustomFieldSerializerTestSetValidator.java* line 42: where is it tested that we don't see this STE? *RpcProxyCreator.java* - writeSerializationPolicyFile - will this get called? It looks like ProxyCreator will wind up creating a string null if so -- is that an issue? - Can you give an overview of what is going on with the artificial rescues here? *RPC.java* - line 55: add a comment explaining the space is needed to avoid potential collisions - implementsInterfaceRecursive: perhaps Recursive helper for implementsInterface() would be a more useful comment. *SimplePayloadSink.java* - line 231: would it be useful to tie this to -style PRETTY? Like maybe provide a static setter and have generated code insert a call to it in PRETTY mode? - append: where is quoting the RPC_SEPARATOR_CHAR handled if it is contained within the string? - I don't see where all the quoting is handled like ServerSerializationStreamReader deserializeStringTable (and others) did before -- various browsers have issues with different characters (current Android doesn't handle any non-ASCII due to a double-decode problem), and while I am not looking at the web-mode code with OOPHM (and hopefully eventually an Android plugin among others) I still think this needs to be solved here. Maybe I am missing it since otherwise I don't see how UnicodeEscapingTest2 could pass on all browsers. *SimplePayloadDecoder.java* - same comment about quoting and encoding - missing newline at EOF *HasSetters.java, HasValues.java, **ClientOracle.java**, AbstractRemoteServiceServlet.java * missing newline at EOF *RpcRequestBuilder.java* line 44: not sure I see the value in this comment, as the IDE will do that for you. I know you were just keeping it like the existing code, but I would remove all of them. -- John A. Tamplin Software Engineer (GWT), Google --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~--- Index: eclipse/settings/code-style/gwt.importorder === --- eclipse/settings/code-style/gwt.importorder (revision 5639) +++ eclipse/settings/code-style/gwt.importorder (working copy) @@ -1,9 +1,16 @@ #Organize Import Order -#Thu Jul 20 15:01:42 EDT 2006 -6=javax -5=java -4=org -3=net -2=junit -1=com +#Tue Jun 30 09:38:40 GMT-05:00 2009 +9=\#org +8=org +7=\#net +6=net +5=\#junit +13=\#javax +4=junit +12=javax +3=\#com +11=\#java +2=com +10=java +1=\#com.google 0=com.google
[gwt-contrib] [google-web-toolkit commit] r5643 - Merging r5641 from trunk (Fix for Firefox 3.5 Event.relatedTarget bug).
Author: j...@google.com Date: Tue Jun 30 08:39:59 2009 New Revision: 5643 Modified: releases/1.6/user/src/com/google/gwt/dom/client/DOMImplMozilla.java releases/1.6/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java Log: Merging r5641 from trunk (Fix for Firefox 3.5 Event.relatedTarget bug). Modified: releases/1.6/user/src/com/google/gwt/dom/client/DOMImplMozilla.java == --- releases/1.6/user/src/com/google/gwt/dom/client/DOMImplMozilla.java (original) +++ releases/1.6/user/src/com/google/gwt/dom/client/DOMImplMozilla.java Tue Jun 30 08:39:59 2009 @@ -38,6 +38,20 @@ }-*/; @Override + public native EventTarget eventGetRelatedTarget(NativeEvent evt) /*-{ +// Hack around Mozilla bug 497780 (relatedTarget sometimes returns XUL +// elements). Trying to access relatedTarget.nodeName will throw an +// exception if it's a XUL element. +var relatedTarget = evt.relatedTarget; +try { + var nodeName = relatedTarget.nodeName; + return relatedTarget; +} catch (e) { + return null; +} + }-*/; + + @Override public int getAbsoluteLeft(Element elem) { return getAbsoluteLeftImpl(elem.getOwnerDocument().getViewportElement(), elem); Modified: releases/1.6/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java == --- releases/1.6/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java (original) +++ releases/1.6/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java Tue Jun 30 08:39:59 2009 @@ -39,22 +39,30 @@ private static JavaScriptObject dispatchEvent; @Override - public native Element eventGetFromElement(Event evt) /*-{ -if (evt.type == mouseover) - return evt.relatedTarget; -if (evt.type == mouseout) - return evt.target; + public Element eventGetFromElement(Event evt) { +if (evt.getType().equals(mouseover)) { + return evt.getRelatedTarget().cast(); +} + +if (evt.getType().equals(mouseout)) { + return evt.getTarget().cast(); +} + return null; - }-*/; + } @Override - public native Element eventGetToElement(Event evt) /*-{ -if (evt.type == mouseover) - return evt.target; -if (evt.type == mouseout) - return evt.relatedTarget; + public Element eventGetToElement(Event evt) { +if (evt.getType().equals(mouseover)) { + return evt.getTarget().cast(); +} + +if (evt.getType().equals(mouseout)) { + return evt.getRelatedTarget().cast(); +} + return null; - }-*/; + } @Override public native Element getChild(Element elem, int index) /*-{ --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r5644 - Updating branch-info.
Author: j...@google.com Date: Tue Jun 30 08:40:18 2009 New Revision: 5644 Modified: branches/snapshot-2009.06.16-r5570/branch-info.txt Log: Updating branch-info. Modified: branches/snapshot-2009.06.16-r5570/branch-info.txt == --- branches/snapshot-2009.06.16-r5570/branch-info.txt (original) +++ branches/snapshot-2009.06.16-r5570/branch-info.txt Tue Jun 30 08:40:18 2009 @@ -17,4 +17,6 @@ $ svn merge -c5597 https://google-web-toolkit.googlecode.com/svn/trunk /trunk 5606 was merged (r5607) into snapshot $ svn merge -c5606 https://google-web-toolkit.googlecode.com/svn/trunk +/trunk 5641 was merged (r5642) into snapshot + $ svn merge -c5641 https://google-web-toolkit.googlecode.com/svn/trunk --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r5640 - Add Impl.getNameOf() to expose JNameOf nodes to Java code.
Author: b...@google.com Date: Tue Jun 30 07:54:21 2009 New Revision: 5640 Modified: trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ReplaceRebinds.java trunk/user/src/com/google/gwt/core/client/impl/Impl.java Log: Add Impl.getNameOf() to expose JNameOf nodes to Java code. http://gwt-code-reviews.appspot.com/46802/show Patch by: bobv Review by: scottb Modified: trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java == --- trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java (original) +++ trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java Tue Jun 30 07:54:21 2009 @@ -77,6 +77,7 @@ com.google.gwt.lang.ClassLiteralHolder, com.google.gwt.core.client.RunAsyncCallback, com.google.gwt.core.client.impl.AsyncFragmentLoader, + com.google.gwt.core.client.impl.Impl, com.google.gwt.lang.EntryMethodHolder,})); static final MapString, SetString traceMethods = new HashMapString, SetString(); Modified: trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ReplaceRebinds.java == --- trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ReplaceRebinds.java (original) +++ trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ReplaceRebinds.java Tue Jun 30 07:54:21 2009 @@ -20,15 +20,21 @@ import com.google.gwt.dev.jdt.RebindPermutationOracle; import com.google.gwt.dev.jjs.InternalCompilerException; import com.google.gwt.dev.jjs.ast.Context; +import com.google.gwt.dev.jjs.ast.HasEnclosingType; +import com.google.gwt.dev.jjs.ast.HasName; import com.google.gwt.dev.jjs.ast.JClassLiteral; import com.google.gwt.dev.jjs.ast.JClassType; +import com.google.gwt.dev.jjs.ast.JDeclaredType; import com.google.gwt.dev.jjs.ast.JExpression; import com.google.gwt.dev.jjs.ast.JGwtCreate; import com.google.gwt.dev.jjs.ast.JMethod; import com.google.gwt.dev.jjs.ast.JMethodCall; import com.google.gwt.dev.jjs.ast.JModVisitor; +import com.google.gwt.dev.jjs.ast.JNameOf; import com.google.gwt.dev.jjs.ast.JProgram; import com.google.gwt.dev.jjs.ast.JReferenceType; +import com.google.gwt.dev.jjs.ast.JStringLiteral; +import com.google.gwt.dev.util.JsniRef; import java.util.ArrayList; import java.util.List; @@ -40,30 +46,85 @@ private class RebindVisitor extends JModVisitor { +private final JMethod nameOfMethod; private final JMethod rebindCreateMethod; -public RebindVisitor(JMethod rebindCreateMethod) { +public RebindVisitor(JMethod nameOfMethod, JMethod rebindCreateMethod) { + this.nameOfMethod = nameOfMethod; this.rebindCreateMethod = rebindCreateMethod; } @Override public void endVisit(JMethodCall x, Context ctx) { JMethod method = x.getTarget(); - if (method == rebindCreateMethod) { -assert (x.getArgs().size() == 1); -JExpression arg = x.getArgs().get(0); -assert (arg instanceof JClassLiteral); -JClassLiteral classLiteral = (JClassLiteral) arg; -JReferenceType sourceType = (JReferenceType) classLiteral.getRefType(); -ListJClassType allRebindResults = getAllPossibleRebindResults(sourceType); -JGwtCreate gwtCreate = new JGwtCreate(x.getSourceInfo(), sourceType, -allRebindResults, program.getTypeJavaLangObject()); -if (allRebindResults.size() == 1) { - // Just replace with the instantiation expression. - ctx.replaceMe(gwtCreate.getInstantiationExpressions().get(0)); -} else { - ctx.replaceMe(gwtCreate); + if (method == nameOfMethod) { +replaceImplNameOf(x, ctx); + + } else if (method == rebindCreateMethod) { +replaceGwtCreate(x, ctx); + } +} + +private void replaceGwtCreate(JMethodCall x, Context ctx) { + assert (x.getArgs().size() == 1); + JExpression arg = x.getArgs().get(0); + assert (arg instanceof JClassLiteral); + JClassLiteral classLiteral = (JClassLiteral) arg; + JReferenceType sourceType = (JReferenceType) classLiteral.getRefType(); + ListJClassType allRebindResults = getAllPossibleRebindResults(sourceType); + JGwtCreate gwtCreate = new JGwtCreate(x.getSourceInfo(), sourceType, + allRebindResults, program.getTypeJavaLangObject()); + if (allRebindResults.size() == 1) { +// Just replace with the instantiation expression. +ctx.replaceMe(gwtCreate.getInstantiationExpressions().get(0)); + } else { +ctx.replaceMe(gwtCreate); + } +} + +private void replaceImplNameOf(JMethodCall x, Context ctx) { + JExpression arg0 = x.getArgs().get(0); + assert arg0 instanceof JStringLiteral; + String stringLiteral = ((JStringLiteral) arg0).getValue(); + + HasName named = null; + + JDeclaredType
[gwt-contrib] [google-web-toolkit commit] r5641 - Fix for Firefox 3.5 relatedTarget bug (https://bugzilla.mozilla.org/show_bug.cgi?id=497780)
Author: j...@google.com Date: Tue Jun 30 08:01:08 2009 New Revision: 5641 Modified: trunk/user/src/com/google/gwt/dom/client/DOMImplMozilla.java trunk/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java Log: Fix for Firefox 3.5 relatedTarget bug (https://bugzilla.mozilla.org/show_bug.cgi?id=497780) Review: http://gwt-code-reviews.appspot.com/49803 Modified: trunk/user/src/com/google/gwt/dom/client/DOMImplMozilla.java == --- trunk/user/src/com/google/gwt/dom/client/DOMImplMozilla.java (original) +++ trunk/user/src/com/google/gwt/dom/client/DOMImplMozilla.javaTue Jun 30 08:01:08 2009 @@ -37,6 +37,20 @@ }-*/; @Override + public native EventTarget eventGetRelatedTarget(NativeEvent evt) /*-{ +// Hack around Mozilla bug 497780 (relatedTarget sometimes returns XUL +// elements). Trying to access relatedTarget.nodeName will throw an +// exception if it's a XUL element. +var relatedTarget = evt.relatedTarget; +try { + var nodeName = relatedTarget.nodeName; + return relatedTarget; +} catch (e) { + return null; +} + }-*/; + + @Override public int getAbsoluteLeft(Element elem) { return getAbsoluteLeftImpl(elem.getOwnerDocument().getViewportElement(), elem); Modified: trunk/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java == --- trunk/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java (original) +++ trunk/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java Tue Jun 30 08:01:08 2009 @@ -39,22 +39,30 @@ private static JavaScriptObject dispatchEvent; @Override - public native Element eventGetFromElement(Event evt) /*-{ -if (evt.type == mouseover) - return evt.relatedTarget; -if (evt.type == mouseout) - return evt.target; + public Element eventGetFromElement(Event evt) { +if (evt.getType().equals(mouseover)) { + return evt.getRelatedTarget().cast(); +} + +if (evt.getType().equals(mouseout)) { + return evt.getTarget().cast(); +} + return null; - }-*/; + } @Override - public native Element eventGetToElement(Event evt) /*-{ -if (evt.type == mouseover) - return evt.target; -if (evt.type == mouseout) - return evt.relatedTarget; + public Element eventGetToElement(Event evt) { +if (evt.getType().equals(mouseover)) { + return evt.getTarget().cast(); +} + +if (evt.getType().equals(mouseout)) { + return evt.getRelatedTarget().cast(); +} + return null; - }-*/; + } @Override public native Element getChild(Element elem, int index) /*-{ --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Dynamic panel and RPC
Hello! I want know about the Dynamic panel. I do not know if there is Dynamic panel in GWT. One Day, I do RPC by opertion OnSuccess(), to make a Dynamic panel. but the panel is not show first. when Switch interface the panel is show after. so i don't know why. Like: public void onSuccess(Object result) { panel.add(new Button(abc)); panel.show(); } Can you help me? Thanks! --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r5642 - Merging r5641 from trunk (Fix for Firefox 3.5 Event.relatedTarget bug).
Author: j...@google.com Date: Tue Jun 30 08:39:50 2009 New Revision: 5642 Modified: branches/snapshot-2009.06.16-r5570/user/src/com/google/gwt/dom/client/DOMImplMozilla.java branches/snapshot-2009.06.16-r5570/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java Log: Merging r5641 from trunk (Fix for Firefox 3.5 Event.relatedTarget bug). Modified: branches/snapshot-2009.06.16-r5570/user/src/com/google/gwt/dom/client/DOMImplMozilla.java == --- branches/snapshot-2009.06.16-r5570/user/src/com/google/gwt/dom/client/DOMImplMozilla.java (original) +++ branches/snapshot-2009.06.16-r5570/user/src/com/google/gwt/dom/client/DOMImplMozilla.java Tue Jun 30 08:39:50 2009 @@ -37,6 +37,20 @@ }-*/; @Override + public native EventTarget eventGetRelatedTarget(NativeEvent evt) /*-{ +// Hack around Mozilla bug 497780 (relatedTarget sometimes returns XUL +// elements). Trying to access relatedTarget.nodeName will throw an +// exception if it's a XUL element. +var relatedTarget = evt.relatedTarget; +try { + var nodeName = relatedTarget.nodeName; + return relatedTarget; +} catch (e) { + return null; +} + }-*/; + + @Override public int getAbsoluteLeft(Element elem) { return getAbsoluteLeftImpl(elem.getOwnerDocument().getViewportElement(), elem); Modified: branches/snapshot-2009.06.16-r5570/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java == --- branches/snapshot-2009.06.16-r5570/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java (original) +++ branches/snapshot-2009.06.16-r5570/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java Tue Jun 30 08:39:50 2009 @@ -39,22 +39,30 @@ private static JavaScriptObject dispatchEvent; @Override - public native Element eventGetFromElement(Event evt) /*-{ -if (evt.type == mouseover) - return evt.relatedTarget; -if (evt.type == mouseout) - return evt.target; + public Element eventGetFromElement(Event evt) { +if (evt.getType().equals(mouseover)) { + return evt.getRelatedTarget().cast(); +} + +if (evt.getType().equals(mouseout)) { + return evt.getTarget().cast(); +} + return null; - }-*/; + } @Override - public native Element eventGetToElement(Event evt) /*-{ -if (evt.type == mouseover) - return evt.target; -if (evt.type == mouseout) - return evt.relatedTarget; + public Element eventGetToElement(Event evt) { +if (evt.getType().equals(mouseover)) { + return evt.getTarget().cast(); +} + +if (evt.getType().equals(mouseout)) { + return evt.getRelatedTarget().cast(); +} + return null; - }-*/; + } @Override public native Element getChild(Element elem, int index) /*-{ --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Focus and Event fixes for RichTextArea
Reviewers: jgw, Description: This patch fixes a few issues in RichTextArea: Issue 3133: Events triggered by RichTextArea are not sent through the normal event system, so none of the DOM methods that rely on currentEvent work. I fixed this by calling DOM#dispatchEvent() instead of calling Widget#onBrowserEvent() directory. Issue 3176 and 3503: Most of the browsers behave weirdly when you programatically focus the RichTextArea immediately after attaching it. Firefox doesn't show the text caret. Safari/Chrome catch key events, but you can't actually type. I modified the code to delay focus until the widget is fully initialized, normalizing the behavior across all browsers. In Firefox, we use a hack (focus, blur, focus) to ensure that text caret appears. Blur Bug: Old Mozilla throws an exception whenever blur is called. I added a deferred binding to ignore the blur request. Safari/Chrome Focus Handlers: Safari and Chrome never fire focus handlers before we add the events to the iframe instead of its content window. This is now fixed. Testing: I manually verified these changes in all browsers. I also wrote some unit tests as best I could to catch the associated errors. Please review this at http://gwt-code-reviews.appspot.com/50803 Affected files: user/src/com/google/gwt/user/RichText.gwt.xml user/src/com/google/gwt/user/User.gwt.xml user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplIE6.java user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplMozilla.java user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplOldMozilla.java user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplOpera.java user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplSafari.java user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplStandard.java --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r5646 - Merging trunk r5627 into this branch.
Author: j...@google.com Date: Tue Jun 30 13:00:02 2009 New Revision: 5646 Modified: branches/snapshot-2009.06.16-r5570/user/src/com/google/gwt/user/client/ui/RadioButton.java Log: Merging trunk r5627 into this branch. Modified: branches/snapshot-2009.06.16-r5570/user/src/com/google/gwt/user/client/ui/RadioButton.java == --- branches/snapshot-2009.06.16-r5570/user/src/com/google/gwt/user/client/ui/RadioButton.java (original) +++ branches/snapshot-2009.06.16-r5570/user/src/com/google/gwt/user/client/ui/RadioButton.java Tue Jun 30 13:00:02 2009 @@ -62,7 +62,7 @@ setStyleName(gwt-RadioButton); sinkEvents(Event.ONCLICK); -sinkEvents(Event.ONMOUSEOUT); +sinkEvents(Event.ONMOUSEUP); sinkEvents(Event.ONBLUR); sinkEvents(Event.ONKEYDOWN); } --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Allow @def to be retrieved as a String from CssResource
Reviewers: robertvawter_google.com, Description: I would like to be able to use @def to define color values in my .css file but also access them in my Java code. This change allows you to define an accessor in your CssResource implementation class that returns a String. Please review this at http://gwt-code-reviews.appspot.com/50804 Affected files: user/src/com/google/gwt/resources/client/CssResource.java user/src/com/google/gwt/resources/css/ast/CssVisitor.java user/src/com/google/gwt/resources/rg/CssResourceGenerator.java user/test/com/google/gwt/resources/client/CSSResourceTest.java user/test/com/google/gwt/resources/client/deftest.css user/test/com/google/gwt/resources/client/test.css --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: using string constants in @def
I uploaded a patch for consideration at: http://gwt-code-reviews.appspot.com/50804 On Tue, Jun 30, 2009 at 9:49 AM, Eric Ayerszun...@google.com wrote: In this case, I'm trying to share color definitions between CSS and my source. I have a palette of colors that I want to share. On Tue, Jun 30, 2009 at 9:13 AM, Bob Vawterrobertvaw...@google.com wrote: What you're asking for isn't too hard to implement, but I'm curious about the actual use case. In what circumstances would your Java code care about string-valued properties? Can @eval or the value() function be used instead? -- Bob Vawter Google Web Toolkit Team -- Eric Z. Ayers - GWT Team - Atlanta, GA USA http://code.google.com/webtoolkit/ -- Eric Z. Ayers - GWT Team - Atlanta, GA USA http://code.google.com/webtoolkit/ --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Allow @def to be retrieved as a String from CssResource
I think the following scenario should be made to work. my.css: @def shadow #abc .shadow { color: shadow; } my.java MyCss implements CssResource { String shadow(); @ClassName(shadow) String shadowClass(); } http://gwt-code-reviews.appspot.com/50804/diff/1/5 File user/src/com/google/gwt/resources/css/ast/CssVisitor.java (right): http://gwt-code-reviews.appspot.com/50804/diff/1/5#newcode188 Line 188: e.printStackTrace(); Remove. http://gwt-code-reviews.appspot.com/50804/diff/1/6 File user/src/com/google/gwt/resources/rg/CssResourceGenerator.java (right): http://gwt-code-reviews.appspot.com/50804/diff/1/6#newcode1739 Line 1739: if (String.equals(toImplement.getReturnType().getSimpleSourceName())) { Use JClassType comparison for correctness. This would match com.foo.String. http://gwt-code-reviews.appspot.com/50804/diff/1/6#newcode1740 Line 1740: returnExpr = \ + def.getValues().get(0) + \; The value has to be escaped; see the Generator.escape(). http://gwt-code-reviews.appspot.com/50804/diff/1/6#newcode1790 Line 1790: // TODO(zundel): make conditional on Strict mode? This condition should always be an error. http://gwt-code-reviews.appspot.com/50804/diff/1/4 File user/test/com/google/gwt/resources/client/test.css (right): http://gwt-code-reviews.appspot.com/50804/diff/1/4#newcode24 Line 24: Revert. http://gwt-code-reviews.appspot.com/50804 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Add Impl.getNameOf() to expose JNameOf nodes to Java code
Ah, that does ring a bell. funny, I can't actually find any way in the tool that lets you see what svn rev the patch is actually against. On Tue, Jun 30, 2009 at 10:56 AM, b...@google.com wrote: Thanks for the review; the JSNI lookup logic had already been extracted into JsniRefLookup by Lex some number of weeks ago. Committed at r5640. http://gwt-code-reviews.appspot.com/46802 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Misc JS problem cleanup
I did, it's in there at r5602. On Tue, Jun 30, 2009 at 9:15 AM, j...@google.com wrote: On 2009/06/19 17:30:23, jgw wrote: On 2009/06/19 01:37:23, scottb wrote: LGTM. Good catches, all. BTW, Scott -- could you please go ahead and commit this when you have a moment? I'd like to get these into the 1.6 maintenance release. http://gwt-code-reviews.appspot.com/42802 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Fix a couple of tiny checkstyle problems in dev
Reviewers: scottb, Please review this at http://gwt-code-reviews.appspot.com/50805 Affected files: dev/core/src/com/google/gwt/core/ext/SelectionProperty.java dev/core/src/com/google/gwt/dev/jjs/ast/JMethod.java Index: dev/core/src/com/google/gwt/dev/jjs/ast/JMethod.java === --- dev/core/src/com/google/gwt/dev/jjs/ast/JMethod.java(revision 5637) +++ dev/core/src/com/google/gwt/dev/jjs/ast/JMethod.java(working copy) @@ -42,7 +42,6 @@ System.out.println(code); } - /** * Special serialization treatment. */ Index: dev/core/src/com/google/gwt/core/ext/SelectionProperty.java === --- dev/core/src/com/google/gwt/core/ext/SelectionProperty.java (revision 5637) +++ dev/core/src/com/google/gwt/core/ext/SelectionProperty.java (working copy) @@ -42,7 +42,7 @@ /** * Gets the fallback value for the property - * @return the fallback, or + * @return the fallback, or . */ String getFallbackValue(); --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Fix a couple of tiny checkstyle problems in dev
1 issue, but no need to re-review http://gwt-code-reviews.appspot.com/50805/diff/1/3 File dev/core/src/com/google/gwt/core/ext/SelectionProperty.java (right): http://gwt-code-reviews.appspot.com/50805/diff/1/3#newcode44 Line 44: * Gets the fallback value for the property Period should go here. http://gwt-code-reviews.appspot.com/50805/diff/1/3#newcode45 Line 45: * @return the fallback, or . and not here.:) http://gwt-code-reviews.appspot.com/50805 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r5647 - Updating branch-info.
Author: j...@google.com Date: Tue Jun 30 13:00:59 2009 New Revision: 5647 Modified: branches/snapshot-2009.06.16-r5570/branch-info.txt Log: Updating branch-info. Modified: branches/snapshot-2009.06.16-r5570/branch-info.txt == --- branches/snapshot-2009.06.16-r5570/branch-info.txt (original) +++ branches/snapshot-2009.06.16-r5570/branch-info.txt Tue Jun 30 13:00:59 2009 @@ -19,4 +19,6 @@ $ svn merge -c5606 https://google-web-toolkit.googlecode.com/svn/trunk /trunk 5641 was merged (r5642) into snapshot $ svn merge -c5641 https://google-web-toolkit.googlecode.com/svn/trunk +/trunk 5627 was merged (r5646) into snapshot + $ svn merge -c5627 https://google-web-toolkit.googlecode.com/svn/trunk --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r5650 - Add tests for data-collection ASM visitors.
Author: j...@google.com Date: Tue Jun 30 17:14:14 2009 New Revision: 5650 Added: changes/jat/ihm/dev/core/test/com/google/gwt/dev/javac/asm/ changes/jat/ihm/dev/core/test/com/google/gwt/dev/javac/asm/AsmTestCase.java (contents, props changed) changes/jat/ihm/dev/core/test/com/google/gwt/dev/javac/asm/CollectClassDataTest.java (contents, props changed) Modified: changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/asm/CollectAnnotationData.java Log: Add tests for data-collection ASM visitors. Modified: changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/asm/CollectAnnotationData.java == --- changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/asm/CollectAnnotationData.java (original) +++ changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/asm/CollectAnnotationData.java Tue Jun 30 17:14:14 2009 @@ -114,10 +114,23 @@ private CallbackCollectAnnotationData.AnnotationData callback; private CollectAnnotationData.AnnotationData annotation; + /** + * Construct the collector. + * + * @param desc class descriptor of the annotation class + * @param visible true if the annotation is visible at runtime + */ public CollectAnnotationData(String desc, boolean visible) { this(desc, visible, null); } + /** + * Construct the collector. + * + * @param desc class descriptor of the annotation class + * @param visible true if the annotation is visible at runtime + * @param callback callback to be called when the annotation is finished + */ public CollectAnnotationData(String desc, boolean visible, CallbackCollectAnnotationData.AnnotationData callback) { annotation = new AnnotationData(desc, visible); Added: changes/jat/ihm/dev/core/test/com/google/gwt/dev/javac/asm/AsmTestCase.java == --- (empty file) +++ changes/jat/ihm/dev/core/test/com/google/gwt/dev/javac/asm/AsmTestCase.java Tue Jun 30 17:14:14 2009 @@ -0,0 +1,31 @@ +package com.google.gwt.dev.javac.asm; + +import com.google.gwt.dev.util.Util; + +import junit.framework.TestCase; + +import java.io.InputStream; + +public abstract class AsmTestCase extends TestCase { + + private static final ClassLoader CLASSLOADER = CollectClassDataTest.class.getClassLoader(); + + public AsmTestCase() { +super(); + } + + public AsmTestCase(String name) { +super(name); + } + + protected byte[] getClassBytes(Class? clazz) { +byte[] bytes; +InputStream str = CLASSLOADER.getResourceAsStream( +clazz.getName().replace('.', '/') + .class); +if (str == null) { + return null; +} +return Util.readStreamAsBytes(str); + } + +} \ No newline at end of file Added: changes/jat/ihm/dev/core/test/com/google/gwt/dev/javac/asm/CollectClassDataTest.java == --- (empty file) +++ changes/jat/ihm/dev/core/test/com/google/gwt/dev/javac/asm/CollectClassDataTest.java Tue Jun 30 17:14:14 2009 @@ -0,0 +1,198 @@ +/* + * Copyright 2008 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.dev.javac.asm; + +import com.google.gwt.core.ext.typeinfo.test.PrimitiveValuesAnnotation; +import com.google.gwt.core.ext.typeinfo.test.TestAnnotation; +import com.google.gwt.dev.asm.AnnotationVisitor; +import com.google.gwt.dev.asm.ClassReader; +import com.google.gwt.dev.asm.Opcodes; +import com.google.gwt.dev.asm.Type; +import com.google.gwt.dev.asm.commons.EmptyVisitor; +import com.google.gwt.dev.javac.asm.CollectAnnotationData.AnnotationData; +import com.google.gwt.dev.javac.asm.CollectClassData.ClassType; + + +import java.util.List; + +/** + * Tests for {...@link CollectClassData}. + */ +public class CollectClassDataTest extends AsmTestCase { + + @SuppressWarnings(unused) + public static class One extends EmptyVisitor { + +@Override +public AnnotationVisitor visitAnnotation(String desc, boolean visible) { + return new CollectAnnotationData(desc, visible); +} + } + + @PrimitiveValuesAnnotation(b = 42, i = 42) + protected static class Two { + +private String field; + +@TestAnnotation(field) +private String annotatedField; + +public Two(int a) { + this(a, null); +} + +@TestAnnotation(foo) +public String foo(int a)
[gwt-contrib] [google-web-toolkit commit] r5651 - More sort format.
Author: sco...@google.com Date: Tue Jun 30 18:16:39 2009 New Revision: 5651 Modified: trunk/user/src/com/google/gwt/junit/JUnitMessageQueue.java trunk/user/src/com/google/gwt/junit/JUnitShell.java Log: More sort format. Modified: trunk/user/src/com/google/gwt/junit/JUnitMessageQueue.java == --- trunk/user/src/com/google/gwt/junit/JUnitMessageQueue.java (original) +++ trunk/user/src/com/google/gwt/junit/JUnitMessageQueue.java Tue Jun 30 18:16:39 2009 @@ -89,7 +89,8 @@ /** * Gets a human-readable string. - * @return Fetches a human-readable representation of the current test object + * + * @return Fetches a human-readable representation of the current test object */ public String getCurrentTestName() { if (currentTest == null) { @@ -147,7 +148,7 @@ /** * Returns a human-formatted message identifying what clients have connected - * but have not yet reported results for this test. It is used in a timeout + * but have not yet reported results for this test. It is used in a timeout * condition, to identify what we're still waiting on. * * @return human readable message @@ -157,7 +158,7 @@ StringBuilder buf = new StringBuilder(); int itemCount = 0; for (ClientStatus clientStatus : clientStatuses.values()) { -if (clientStatus.hasRequestedCurrentTest +if (clientStatus.hasRequestedCurrentTest clientStatus.currentTestResults == null) { if (itemCount 0) { buf.append(, ); @@ -171,8 +172,8 @@ if (itemCount 0) { buf.append('\n'); } -buf.append(difference + - other client(s) haven't responded back to JUnitShell since the start of the test.); +buf.append(difference ++ other client(s) haven't responded back to JUnitShell since the start of the test.); } return buf.toString(); } Modified: trunk/user/src/com/google/gwt/junit/JUnitShell.java == --- trunk/user/src/com/google/gwt/junit/JUnitShell.java (original) +++ trunk/user/src/com/google/gwt/junit/JUnitShell.java Tue Jun 30 18:16:39 2009 @@ -330,15 +330,15 @@ /** * The amount of time to wait for all clients to have contacted the server and - * begin running the test. Contacted does not necessarily mean the test - * has begun, e.g. for linker errors stopping the test initialization. + * begin running the test. Contacted does not necessarily mean the test has + * begun, e.g. for linker errors stopping the test initialization. */ private static final int TEST_BEGIN_TIMEOUT_MILLIS = 6; /** * The amount of time to wait for all clients to complete a single test - * method, in milliseconds, measured from when the ilast/i client - * connects (and thus starts the test). 5 minutes. + * method, in milliseconds, measured from when the ilast/i client + * connects (and thus starts the test). 5 minutes. */ private static final long TEST_METHOD_TIMEOUT_MILLIS = 30; @@ -503,9 +503,9 @@ private long testBeginTimeout; /** - * Timeout for individual test method. If System.currentTimeMillis() is later - * than this timestamp, then we need to pack up and go home. Zero for not - * yet set (at the start of a test). This interval begins when the + * Timeout for individual test method. If System.currentTimeMillis() is later + * than this timestamp, then we need to pack up and go home. Zero for not yet + * set (at the start of a test). This interval begins when the * testBeginTimeout interval is done. */ private long testMethodTimeout; @@ -586,11 +586,12 @@ } else if (testMethodTimeout currentTimeMillis) { double elapsed = (currentTimeMillis - testBeginTime) / 1000.0; throw new TimeoutException( -The browser did not complete the test method +The browser did not complete the test method + messageQueue.getCurrentTestName() + in -+ TEST_METHOD_TIMEOUT_MILLIS + ms.\n We have no results from: -+ messageQueue.getWorkingClients() -+ \n Actual time elapsed: + elapsed + seconds.\n); ++ TEST_METHOD_TIMEOUT_MILLIS ++ ms.\n We have no results from: ++ messageQueue.getWorkingClients() + \n Actual time elapsed: ++ elapsed + seconds.\n); } } else if (testBeginTimeout currentTimeMillis) { double elapsed = (currentTimeMillis - testBeginTime) / 1000.0; @@ -668,9 +669,8 @@ currentModule.clearEntryPoints(); currentModule.addEntryPointTypeName(GWTRunner.class.getName()); // Squirrel away the name of the active module for GWTRunnerGenerator -
[gwt-contrib] Re: GWT emulation of HTML5/CSS3 features
+1 On Mon, Jun 29, 2009 at 7:24 AM, dflorey daniel.flo...@gmail.com wrote: Hi, I've been wondering how GWT should deal with upcoming new features in HTML5/CSS3. There are several areas where functionality that has been implemented in GWT is now also available in the upcoming rendering engines. GWT is creating highly optimized JavaScript and the JavaScript-engines are getting better and better... but: My guess is that for example animations will be smoother when using CSS3 animations instead of JavaScript based animations. Same about rounded corners/shadows and stuff alike. In GWT you'll typically use DecoratedPanel to implement rounded corners with shadows. But Firefox3.5 and the latest Safari and Chrome releases also support css-based rounded borders and shadows. So my proposal would be to use deferred binding to emulate these features on browsers that do not support the latest features (IE8...) and to use a lightweight css based impl on WebKit/Firefox 3.5. In my example of DecoratedPanel the 9x9 approach should be kept for IE and a null impl with css based rounded corners should be available for Firefox (css have to match the given theme). Animations that come with the standard widgets should also be able to fallback to css based animations when available. I've been also reading some posts about the new datagrid html extension and thought it might be clever to have a look at the spec when moving the tables from incubator to trunk to see how far the concepts match. Would be very cool to have a native table implementation on WebKit browsers while other fallback to gwt impls. What do you think? -- Fred Sauer Developer Advocate Google Inc. 1600 Amphitheatre Parkway Mountain View, CA 94043 fre...@google.com --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: GWT emulation of HTML5/CSS3 features
+1 On Jun 29, 10:24 am, dflorey daniel.flo...@gmail.com wrote: Hi, I've been wondering how GWT should deal with upcoming new features in HTML5/CSS3. There are several areas where functionality that has been implemented in GWT is now also available in the upcoming rendering engines. GWT is creating highly optimized JavaScript and the JavaScript-engines are getting better and better... but: My guess is that for example animations will be smoother when using CSS3 animations instead of JavaScript based animations. Same about rounded corners/shadows and stuff alike. In GWT you'll typically use DecoratedPanel to implement rounded corners with shadows. But Firefox3.5 and the latest Safari and Chrome releases also support css-based rounded borders and shadows. So my proposal would be to use deferred binding to emulate these features on browsers that do not support the latest features (IE8...) and to use a lightweight css based impl on WebKit/Firefox 3.5. In my example of DecoratedPanel the 9x9 approach should be kept for IE and a null impl with css based rounded corners should be available for Firefox (css have to match the given theme). Animations that come with the standard widgets should also be able to fallback to css based animations when available. I've been also reading some posts about the new datagrid html extension and thought it might be clever to have a look at the spec when moving the tables from incubator to trunk to see how far the concepts match. Would be very cool to have a native table implementation on WebKit browsers while other fallback to gwt impls. What do you think? --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: HelpRequired : GWT-Incubator: GlassPanel changes
Surya, In general you should be able to follow along http://code.google.com/p/google-web-toolkit-incubator/wiki/GlassPanel and just include the GlassPanel code in your project as you suggested. Any chance you are using GWT trunk rather than 1.6.4? If so, check to see you have the latest source code which includes the ie8 rule as seen in http://code.google.com/p/google-web-toolkit-incubator/source/browse/trunk/src/com/google/gwt/widgetideas/GlassPanel.gwt.xml Fred On Wed, Jun 24, 2009 at 4:34 AM, Surya master...@gmail.com wrote: Hi , I am fairly new to GWT and my requirement needs a glasspanel to be used. But due to the heavy size of incubator.jar file i would like to just copy the GlassPanel class and GlassPanelImpl into my own workspace and create a custom glasspanel . This would remove the dependency on incubator.jar file. All is well at compile time. But when i compile it , it throws an error saying GlassPanelImpl cannot be abstract Please suggest if i am missing anything. Any help would be greatly appreciated. Thanks and Regards, Surya. On May 5, 5:24 pm, David david.no...@gmail.com wrote: Hi, I just created a trimmed down GlassPanel that only contains what we need. Just as a thought on bug 1186, why not deprecate the ListBox widget and replace it with a custom widget. The standard listbox in the browser is underpowered when it comes to styling. I would like to put more than just strings in there. If that were the case then all these tricks to get dialogs to render correctly while dragging or to cancel events are no longer needed in IE6. David On Tue, May 5, 2009 at 12:49 PM, Thomas Broyer t.bro...@gmail.com wrote: On 5 mai, 10:15, stuckagain david.no...@gmail.com wrote: Hi, We are currently moving to the GWT 1.6 release and also updated to the latest incubator. I am having a problem with the GlassPanel widget in the incubator and looked a bit into the implementation. It has a functionality that it automatically grabs the focus. This functionality is not what we wanted so in a previous version if had just overriden the setFocus method to override this behaviour. We are using the GlassPanel to only block part of our UI when input fields are changed by the user. The side effect is that now when the user changes the input field, after one character, the GlassPanel is shown and the user has to click on the input field again to continue entering data. Could this automatically grabbing the focus be made optional ? Right now I can only see a solution by copying the code and deleting this unwanted functionality since the rework of the component no longer allows me to change the behaviour. the GlassPanel should be usable in more situations than just to block the complete window. I agree, and even in those situations, when used in combination with a modal popup panel, grabbing the focus isn't strictly necessary either (note that PopupPanel does not grab the focus, instead it eats up every event not targeted at the modal popup panel). I do believe actually that the lightbox effect should be done by the popup panel (when modal), as it would also solve issue 1186 [1] (defaulting to being fully transparent) [1]http://code.google.com/p/google-web-toolkit/issues/detail?id=1186 I also see in the code that in onAttach a FocusPanelImpl is attached to the root panel... does this mean that every time I remove the GlassPanel from the page and reattach that it will add another FocusPanelImpl ? That looks like a leak to me (the onDetach does not remove it unless I overlooked it ?) As said on the JavaDoc for this FocusPanelImpl class, it removes itself (it does this as soon as it gains the focus, which it grabs as soon as it's attached to the document). Another comment is the usage of a WindowResizeListener. Isn't this duplicate code from the ResizableWidgetCollection ? GlassPanel has unfortunately not been updated for a while (including for GWT 1.6: uses WindowResizeListener instead of ResizeHandler, EventPreview instead of NativePreviewHandler, etc.). Maybe it's time to rewrite it, and/or split it into more a set of widgets, each one specialized on one thing (lightbox+dialog, cover part of the page, etc.)- Hide quoted text - - Show quoted text - -- Fred Sauer Developer Advocate Google Inc. 1600 Amphitheatre Parkway Mountain View, CA 94043 fre...@google.com --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: GlassPanelImpl throws compiletime errors
Surya, Also see my reply to your other email and make sure that if you're on GWT trunk that you have the latest module file which includes an ie8 rule as seen in http://code.google.com/p/google-web-toolkit-incubator/source/browse/trunk/src/com/google/gwt/widgetideas/GlassPanel.gwt.xml Fred On Wed, Jun 24, 2009 at 4:51 AM, Surya master...@gmail.com wrote: Hi, I am relatively new to GWT. My requirement is to use GlassPanel but my hands are tied down because of the heavy size of incubator.jar file which my deployment war file cannot afford. So the only option is to use custom glasspanel. So i copied down teh source code both GlassPanel.java and GlassPanelImpl.java and included in mywork space. All is well till compile time. When i compile, it throws an error stating GlassPanelImpl cannot be abstract. My CustomGlassPanel.java extends from GlassPanel. i changed GlassPanel.java to refer this CustomGlassPanelImpl instead of GlassPanelImpl. But still i get this error. Any help is really helpful and appreciated. Thanks, Surya -- Fred Sauer Developer Advocate Google Inc. 1600 Amphitheatre Parkway Mountain View, CA 94043 fre...@google.com --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: GWT emulation of HTML5/CSS3 features
Transparent support for CSS3/HTML5 on all browsers including IE would be a killer feature !+1 2009/7/1 tfreitas tfrei...@gmail.com +1 On Jun 29, 10:24 am, dflorey daniel.flo...@gmail.com wrote: Hi, I've been wondering how GWT should deal with upcoming new features in HTML5/CSS3. There are several areas where functionality that has been implemented in GWT is now also available in the upcoming rendering engines. GWT is creating highly optimized JavaScript and the JavaScript-engines are getting better and better... but: My guess is that for example animations will be smoother when using CSS3 animations instead of JavaScript based animations. Same about rounded corners/shadows and stuff alike. In GWT you'll typically use DecoratedPanel to implement rounded corners with shadows. But Firefox3.5 and the latest Safari and Chrome releases also support css-based rounded borders and shadows. So my proposal would be to use deferred binding to emulate these features on browsers that do not support the latest features (IE8...) and to use a lightweight css based impl on WebKit/Firefox 3.5. In my example of DecoratedPanel the 9x9 approach should be kept for IE and a null impl with css based rounded corners should be available for Firefox (css have to match the given theme). Animations that come with the standard widgets should also be able to fallback to css based animations when available. I've been also reading some posts about the new datagrid html extension and thought it might be clever to have a look at the spec when moving the tables from incubator to trunk to see how far the concepts match. Would be very cool to have a native table implementation on WebKit browsers while other fallback to gwt impls. What do you think? --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---