Re: jsni - overlay types - js arrays Java API
Thanks! fortunately I didn't get to use it in my projects but I will do it. GWT should provide with an official library or class for doing native stuff like this. People porting/wrapping javascript libraries to GWT really need a good utility class mainly for converting casting java to JavaScript types and viceversa and are doing it by their own (my work: http://code.google.com/p/gwtjsutil/) :( On Friday, September 27, 2013 4:48:21 PM UTC, Greg wrote: This will NOT work in GWT 2.2 See: https://code.google.com/p/google-web-toolkit/issues/detail?id=6594 Workaround provided there works. On Monday, December 24, 2012 3:22:11 AM UTC+1, Sebastián Gurin wrote: Thank you Thomas for your reply, I learned new things. Didn't know about if ( GWT.isScript() ) {you can cast the js array to java arrays directly }. I will definetly use those classes for my projects. Thanks again -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: RPC does not work with GAE?
RPC and GAE worked for me with any problem / fix. Are you sure the .class files of those not found classes exists in WEB-INF/classes or in any .jar of WEB-INF/lib ? On Monday, April 22, 2013 1:11:20 PM UTC-3, membersound wrote: HI, I have a little GWT app that I tried to deploy to GAE the first time. The clientside app works fine so far, but when executing a RPC request (which works on my local machine), there are exceptions about class not found. Do I have to make any changes for RPC with GAE? Or may I have forgotten anything? 87.164.58.50 - - [22/Apr/2013:09:07:16 -0700] POST /myapp/json HTTP/1.1 500 0 http://myappde.appspot.com/; Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0 myappde.appspot.com ms=128 cpu_ms=151 app_engine_release=1.7.7 instance=00c61b117c8332cd88265d53cab93b8de36c6e63 W 2013-04-22 09:07:16.330 EXCEPTION java.lang.ClassNotFoundException: de.myapp.server.file.DownServlet at com.google.appengine.runtime.Request.process-32af579146635ab3(Request.java) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) at org.mortbay.util.Loader.loadClass(Loader.java:91) at org.mortbay.util.Loader.loadClass(Loader.java:71) at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73) at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685) at org.mortbay.jetty.servlet.Context.startContext(Context.java:140) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:480) at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:487) at com.google.tracing.TraceContext.runInContext(TraceContext.java:774) at com.google.tracing.TraceContext$DoInTraceContext.runInContext(TraceContext.java:751) at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:342) at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:334) at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:484) at java.lang.Thread.run(Thread.java:679) E 2013-04-22 09:07:16.374 javax.servlet.ServletContext log: unavailable javax.servlet.UnavailableException: de.myapp.server.file.DownServlet at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:79) at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685) at org.mortbay.jetty.servlet.Context.startContext(Context.java:140) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:219) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:194) at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:134) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:438) at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:480) at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:487) at com.google.tracing.TraceContext.runInContext(TraceContext.java:774) at com.google.tracing.TraceContext$DoInTraceContext.runInContext(TraceContext.java:751) at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:342) at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:334) at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:484) at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251) at java.lang.Thread.run(Thread.java:679) W 2013-04-22 09:07:16.377 EXCEPTION java.lang.ClassNotFoundException: de.myapp.server.file.UpServlet at
Re: how to deploy a demo program created by GWT glugin for eclipse?
You just copy your GWT project's war folder to $JETTY_HOME/webapps and rename it accordingly. Also rename the copied war folder to something that identify your webapp. For example, $JETTY_HOME/webapps/gwttest1/ myGWTHtmlfile.html Then start jetty and your app should be available at localhost:8080/ gwttest1/myGWTHtmlfile.html If you son't want to have the prefix gwttest1 then just copy the GWT war folder to $JETTY_HOME/webapps and rename it to 'root', for example $JETTY_HOME/webapps/root/myGWTHtmlfile.html. In this case your app should be available at localhost:8080/myGWTHtmlfile.html For more information: http://wiki.eclipse.org/Jetty/Howto/Deploy_Web_Applications Good luck. On Monday, April 1, 2013 12:44:47 PM UTC-3, wahaha wrote: we use GWT glugin to create a demo project with sample code,and then we can compile the client part to Javascript. and then,how should we deploy the sever part to jetty? sorry for my poor english.. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: momentgwt - a GWT wrapper library for momentjs.com
Problem fixed. That .jar contains 2 projects inside: momentgwt and gwtjsutil - (an utility library of mine for easier javascript wrapper libraries development). Jar replaced. Sorry for the inconvenience On Sunday, March 24, 2013 3:43:10 PM UTC-3, Mohammad Al-Quraian wrote: When I tried to use the example: Moment.moment().add(2, days).format( Do , h:mm:ss a) After inheriting the required module and including the jar, it gives me this error: The type org.sgx.jsutil.client.JsObject cannot be resolved. It is indirectly referenced from required .class files On Thursday, March 21, 2013 10:22:15 PM UTC+3, Sebastián Gurin wrote: I just released a GWT wrapper for the nice JavaScript library momentjs ( momentjs.com). It resulted on a small and easy to use alternative for working with dates, calendars, intervals, date formats, date internationalization, etc. https://github.com/cancerberoSgx/momentgwt Hope it can be of help to somebody working with dates, calendars, etc. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: momentgwt - a GWT wrapper library for momentjs.com
yes is it possible. Take a look at http://momentjs.com/docs/#/i18n/ for seeing how momentjs support internationalization (you must load an extra .js with the desired language definitions). YOu can find all the locales files here: https://github.com/timrwood/moment/tree/develop/min/lang I just made an example on how to do this using momentgwt: https://github.com/cancerberoSgx/momentgwt/blob/master/momentgwttest/momentgwttest1/src/org/sgx/momentgwttest1/client/tests/InternationalizationTest1.java Hope that helps On Monday, March 25, 2013 2:11:45 PM UTC-3, Mohammad Al-Quraian wrote: Thanks for the fix, do you know how can I change the locale/language (if that's possible)? Or if it's possible to adopt to the locale of the browser? Cheers On Monday, March 25, 2013 7:09:09 PM UTC+3, Sebastián Gurin wrote: Problem fixed. That .jar contains 2 projects inside: momentgwt and gwtjsutil - (an utility library of mine for easier javascript wrapper libraries development). Jar replaced. Sorry for the inconvenience On Sunday, March 24, 2013 3:43:10 PM UTC-3, Mohammad Al-Quraian wrote: When I tried to use the example: Moment.moment().add(2, days).format( Do , h:mm:ss a) After inheriting the required module and including the jar, it gives me this error: The type org.sgx.jsutil.client.JsObject cannot be resolved. It is indirectly referenced from required .class files On Thursday, March 21, 2013 10:22:15 PM UTC+3, Sebastián Gurin wrote: I just released a GWT wrapper for the nice JavaScript library momentjs ( momentjs.com). It resulted on a small and easy to use alternative for working with dates, calendars, intervals, date formats, date internationalization, etc. https://github.com/cancerberoSgx/momentgwt Hope it can be of help to somebody working with dates, calendars, etc. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: momentgwt - a GWT wrapper library for momentjs.com
forgot to impact that little fix in the .jar. Sorry. On Monday, March 25, 2013 9:17:45 PM UTC-3, Mohammad Al-Quraian wrote: Thanks for your replies, I really appreciate that. There's an issue with your code, I'm not sure if it's a bug or not. It gives me this error: com.google.gwt.core.client.JavaScriptException: (ReferenceError) @com.google.gwt.core.client.impl.Impl::apply(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)([JavaScript object(7), JavaScript object(5), JavaScript object(13)]): langDef is not defined It works if I changed it to: Moment.lang(es, null); On Monday, March 25, 2013 9:00:38 PM UTC+3, Sebastián Gurin wrote: yes is it possible. Take a look at http://momentjs.com/docs/#/i18n/ for seeing how momentjs support internationalization (you must load an extra .js with the desired language definitions). YOu can find all the locales files here: https://github.com/timrwood/moment/tree/develop/min/lang I just made an example on how to do this using momentgwt: https://github.com/cancerberoSgx/momentgwt/blob/master/momentgwttest/momentgwttest1/src/org/sgx/momentgwttest1/client/tests/InternationalizationTest1.java Hope that helps On Monday, March 25, 2013 2:11:45 PM UTC-3, Mohammad Al-Quraian wrote: Thanks for the fix, do you know how can I change the locale/language (if that's possible)? Or if it's possible to adopt to the locale of the browser? Cheers On Monday, March 25, 2013 7:09:09 PM UTC+3, Sebastián Gurin wrote: Problem fixed. That .jar contains 2 projects inside: momentgwt and gwtjsutil - (an utility library of mine for easier javascript wrapper libraries development). Jar replaced. Sorry for the inconvenience On Sunday, March 24, 2013 3:43:10 PM UTC-3, Mohammad Al-Quraian wrote: When I tried to use the example: Moment.moment().add(2, days).format( Do , h:mm:ss a) After inheriting the required module and including the jar, it gives me this error: The type org.sgx.jsutil.client.JsObject cannot be resolved. It is indirectly referenced from required .class files On Thursday, March 21, 2013 10:22:15 PM UTC+3, Sebastián Gurin wrote: I just released a GWT wrapper for the nice JavaScript library momentjs (momentjs.com). It resulted on a small and easy to use alternative for working with dates, calendars, intervals, date formats, date internationalization, etc. https://github.com/cancerberoSgx/momentgwt Hope it can be of help to somebody working with dates, calendars, etc. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: momentgwt - a GWT wrapper library for momentjs.com
yes, fixed. Thanks! On Friday, March 22, 2013 7:04:54 AM UTC-3, nino wrote: Good work. I think you have a bug here no ? I dont see you using the date argument. public static final native Moment moment(String date)/*-{ return $wnd.moment(); }-*/; 2013/3/22 Sebastián Gurin sebast...@gmail.com javascript: apidocs available, THE class: http://cancerbero.vacau.com/gwt/momentgwtjavadoc/org/sgx/momentgwt/client/Moment.html -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com javascript:. To post to this group, send email to google-we...@googlegroups.comjavascript: . Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
gwtsjcl - a crypto library
I was needing a lightweight crypto library for GWT so I have made a wrapper of the excellent Stanford Javascript Crypto Library http://crypto.stanford.edu/sjcl/ The project page is http://code.google.com/p/gwtsjcl/ Besides encryption it also support utilities related to hash, codecs, etc like for example sha256, base64, hex, bitarray, utf8, JSON, random number generators, etc. It is very small and efficient. Hope someone needing quality encryption on the client can make use of this. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: momentgwt - a GWT wrapper library for momentjs.com
I don't think so. This is a 100% JavaScript library for the browser. On the server you have java.util for date/calendar fully supported. Regards On Saturday, March 23, 2013 5:53:31 PM UTC-3, Mohammad Al-Quraian wrote: Thanks a lot Sebastian. Can I use this on the server? -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [gwt-contrib] gwtmauve: java emulation / compatibility test kit in GWT
I'm glad you find this project useful. I don't have the time right now to fill issues :( Please feel free to use the project for founding bugs and fill the issues. About the test, for my personal taste, it concentrates too much on testing if a NPE is or is not throwed. I agree this is not a serious bug and that GWT won't fix it (and I agree with the reasons). But as you mention there are other bugs that I thing are worthwhile. The list of issues I have collected were discovered by my with these tests in a day or two. I think with some more time several and more concrete / positive bugs can be found. Also I know of at least one person that, after my project, cloned the original java mauve project for better GWT and maven integration (https://github.com/niloc132/mauve-gwt). On Friday, March 22, 2013 7:31:51 PM UTC-3, John A. Tamplin wrote: On Thu, Mar 21, 2013 at 9:16 PM, Sebastián Gurin sebast...@gmail.comjavascript: wrote: I think this can be really interesting to those looking to find GWT jre emulation bugs. I myself just discovered some of them listed on http://gwtmauve.googlecode.com/svn/trunk/gwtmauve/readme.txt (rich conclusions of this project results can be taken from these bugs) Well, I hope this can be useful to those who want to find and fix GWT bugs and also to know which parts of the GWT JRE emulation are more broken in production mode. Use it as you like. Had to release it under gpl3 for respecting mauve sources license. Comments and ideas are most welcome. Regards Thanks, this is useful. Note that clone isn't supported (it can't be supported in general in JS), and generally you shouldn't expect the same exceptions to be thrown where doing so is inefficient -- see https://developers.google.com/web-toolkit/doc/latest/DevGuideCodingBasicsCompatibility. For example, Java String is directly mapped to a JS string, so the only way to give the same IOOB exceptions would be to add checks around every index/substring/etc operation. Likewise for many NPEs. That explains a large chunk of them. Some of the others, such as Character.toTitleCase, are because they can't be implemented properly and shouldn't really be used anyway (in many cases, the title case of a character should be multiple characters). BigInteger is itself a slow emulation in JS, so I am not surprised that isProbablyPrime is extremely slow on a large number. The others, such as the missing Collections.rotate and bugs in Arrays.fill, Collections.copy, and String.compareTo are good catches and should have issues filed. -- John A. Tamplin -- -- 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.
Re: How to get parameter from url using History?
I use the following for getting the current url. You should parse or split the string for getting your parametersvalues public final native static String getCurrentAddressUrl()/*-{ return $wnd.document.location.href; }-*/; hope that can help On Friday, March 22, 2013 1:55:58 AM UTC-3, Nguyễn Huệ wrote: I using Window.Location.getParameter(doc) return null! So how to solve this problem -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[gwt-contrib] gwtmauve: java emulation / compatibility test kit in GWT
Hi all. I just ported the Mauve Project (http://www.sourceware.org/mauve/) test framework and Java compatibility tests to GWT : http://code.google.com/p/gwtmauve/ I thought can be interesting to this group: basically gwtmauve are thousands of tests runned on GWT, testing the GWT Java Runtime ( https://developers.google.com/web-toolkit/doc/latest/RefJreEmulation) . It contains full java.lang and java.util mauve compatibility tests and developed a small html report application that runs all the tests with results and links to the tests sources: http://cancerbero.vacau.com/gwt/gwtMauve/ I had to comment those parts of mauve sources that test parts of the JRE emulation that are not supported by GWT ( https://developers.google.com/web-toolkit/doc/latest/RefJreEmulation). Note that it can break your browser. I compiled it using compiler style pretty for easy debugging JavaScript errors in the client.I'm testing in firefox . It is interesting to know that almost no errors are reported when using the GWT devmode. But a lot of errors are reported when running the tests in production mode. I think this can be really interesting to those looking to find GWT jre emulation bugs. I myself just discovered some of them listed on http://gwtmauve.googlecode.com/svn/trunk/gwtmauve/readme.txt (rich conclusions of this project results can be taken from these bugs) Well, I hope this can be useful to those who want to find and fix GWT bugs and also to know which parts of the GWT JRE emulation are more broken in production mode. Use it as you like. Had to release it under gpl3 for respecting mauve sources license. Comments and ideas are most welcome. Regards -- -- 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.
momentgwt - a GWT wrapper library for momentjs.com
I just released a GWT wrapper for the nice JavaScript library momentjs (momentjs.com). It resulted on a small and easy to use alternative for working with dates, calendars, intervals, date formats, date internationalization, etc. https://github.com/cancerberoSgx/momentgwt Hope it can be of help to somebody working with dates, calendars, etc. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: momentgwt - a GWT wrapper library for momentjs.com
apidocs available, THE class: http://cancerbero.vacau.com/gwt/momentgwtjavadoc/org/sgx/momentgwt/client/Moment.html -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Error this.appendChild is not a function?
hope the following two tips are of help: 1 ) that sounds like a null pointer exception (natively). you are trying to invoke a native field of a null value 2 ) removing all childrens iterating through them can be very tricky. See a correct way of doing it manually : https://code.google.com/p/gwtjsutil/source/browse/trunk/gwtjsutil/src/org/sgx/jsutil/client/DOMUtil.java#72 : while(e.getLastChild()!=null) e.removeChild(e.getLastChild()); good luck On Sunday, February 17, 2013 6:56:19 PM UTC-2, Ed wrote: When I override the method SimplePanel.clear() to remove all elements of the contained element in SimplePanel, and then add a widget throug setWidget() I receive the error (see the complete error below: --- this.appendChild is not a function? I remove all element after SimplePanel performs a clear itself such that it removed the contained widget, something like (subclass of SimplePanel: public final void clear() { super.clear(); UtilsWidget.removeAllChilds(getElement()); } } --- I remove all child elements by iterating through all children (in reversed order) and removing them when the child is of type Element. When I not remove all children, all is fine, but then the added extra elements aren't removed :( Why is this? I perform this step as I also add lightweight text elements to the SimplePanel that I also want to be removed. The exact exception (using gwt 2.5.0): - com.google.gwt.core.client.JavaScriptException: (TypeError) @com.google.gwt.core.client.impl.Impl::apply(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)([JavaScript object(2812), JavaScript object(1793), JavaScript object(2822)]): this.appendChild is not a function com.bv.gwt.common.exception.ExceptionHandlerDefault - - Handling an exception. Exception: com.google.gwt.core.client.JavaScriptException: (TypeError) @com.google.gwt.core.client.impl.Impl::apply(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)([JavaScript object(2812), JavaScript object(1793), JavaScript object(2822)]): this.appendChild is not a function at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at com.google.gwt.core.client.impl.Impl.apply(Impl.java) at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:242) at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364) at java.lang.Thread.run(Thread.java:662) -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
GwtMauve - Mauve Java compatibility tests in GWT
Hi all. I just ported the Mauve Project (http://www.sourceware.org/mauve/) test framework and Java compatibility tests to GWT : http://code.google.com/p/gwtmauve/ I have ported java.lang and java.util mauve compatibility tests and developed a small html report application that runs all the tests with results and links to the tests sources: http://cancerbero.vacau.com/gwt/gwtMauve/ I had to comment those parts of mauve sources that test parts of the JRE emulation that are not supported by GWT (https://developers.google.com/web-toolkit/doc/latest/RefJreEmulation). Note that it can break your browser. I compiled it using compiler style pretty for easy debugging JavaScript errors in the client.I'm testing in firefox . It is interesting to know that almost no errors are reported when using the GWT devmode. But a lot of errors are reported when running the tests in production mode. I think thanks to gwtmauve many bugs in the GWT JRE emulation can be found. I myself just discovered what seems the following GWT bugs , only testing today: * new StringBuffer(null) should throw a NPE * abcd.charAt(-1) and abcd.charAt(4); should throw a indexoutofboundsexception * hello.substring(-1); and hello.substring(22); b.substring(4, b.length() + 1); and b.substring(4, -1); all should throw a indexoutofboundsexception * String.CASE_INSENSITIVE_ORDER instanceof Serializableshould be true * String.compareTo and new String() bug: int result = abc\tABC 123.compareTo(new String()); /* notice: abc\tABC 123.compareTo() will work ! */ if (result != 11) Window.alert(error, result : + result); else Window.alert(OK, result: + result); Well, I hope this can be useful to those who want to find and fix GWT bugs and also to know which parts of the GWT JRE emulation are more broken in production mode. Use it as you like. Had to release it under gpl3 for respecting mauve sources license. Comments and ideas are most welcome. Regards -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Updating GWT libraries for supporting xsiframe
On Sunday, January 20, 2013 2:49:27 PM UTC-2, Thomas Broyer wrote: How about ScriptInjector.TOP_WINDOWhttp://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/core/client/ScriptInjector.html#TOP_WINDOWinstead of your JsUtil.window().cast() ? (I think the reason is explained in the javadoc) That did the trick too. Thanks! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/IgzVX6Yi0VQJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Are the GWT APIs dead?
Hi, I'm working on a Google's Java API for GWT that works 100% on the client side : http://code.google.com/p/gwtgapi/ example gallery with sources: http://cancerbero.freevar.com/gwtgapi/ (you must authorize the APIs in the Google APIs console, an authorize button appears at the bottom) It is based on the JavaScript project http://code.google.com/p/google-api-javascript-client which is 100% GWT-wrapped (using overlay types). Also supported some Java utilities for easy authentication and module loading. Now the big task : I'm writing more Java friendly API (extending JavaScriptObject), some google modules are ready but there is a lot of work (I'm only working on those who interest me more) I didn't announce this project here before because I wanted a better product before. But perhaps announce it here can be good, mainly for completing the mechanical big work that needs to be done, this is, writing the Java GWT overlay types for google APIs requests and return types from reading the google apis reference documents. Any feedback and help is most appreciated. On Sunday, January 20, 2013 12:38:24 PM UTC-2, Charles Youakim wrote: I'm looking at the project and there's nearly zero activity. The last chatter was about Maps v3, and that was 9 months ago. https://groups.google.com/forum/?fromgroups#!forum/GWT-Google-Apis Should I be worried? -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/HAyH4Y-CrugJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Updating GWT libraries for supporting xsiframe
Hi niloc, thank you very much for your ideas. In my case your solution 3) (inlining the js) is not what I want. In my case I want two things: 1) easy to the end user (it shouldn't have to worry about adding thirdLibrary.js file anywhere) 2) easy for me to update to new versions of thirdLibrary.js. Do not have to mantain my own version of thirdLibrary.js. So for me your 2b) solution is what I wanted and worked fine. See how I'm loading sizzle.js now: http://code.google.com/p/gwtsizzle/source/browse/trunk/gwtsizzle/src/org/sgx/gwtsizzle/client/Sizzle.java#28 Note that for some unknown reason setWindow($wnd) was required for this to work! Thank you again! On Wednesday, January 2, 2013 6:21:41 PM UTC-2, Colin Alworth wrote: Greetings from IRC - glad to see you are continuing with this idea. It could be worth considering inlining the sizzle.js code as JSNI to avoid the extra .js file at all, either from the module file or from the base html file. This has the additional constraint/advantage that you'll need to modify the code slightly to allow it to work from within GWT (i.e. document - $doc, window - $wnd), and remove any `with` statements. At that point it should behave well from within GWT, though the closure compiler might give it some grief. This is sort of a 3) to your list. 2b) Use ScriptInjector plus a TextResource - no async, as the code will be compiled in, and no need to rewrite to use $doc/$wnd and avoid with - the compiler will also leave this code alone, as it looks like a string. Like the option above (and unlike 1 and 2) this will still result in the sizzle.js file to be compiled into the giant hash name.cache.html file, minimizing the number of downloads required. The chief advantage I see in 3) over 2b) is that it paves a smoother path toward making a proper 'port' instead of a 'wrapper' or 'bridge' (lets leave the naming to the other thread...) - you can slowly rewrite JS to Java methods, or break the JS into multiple JSNI methods depending on what they do and how you want to access them. Another advantage is that the compiler can at least do *something* to JSNI, whereas it will leave 1), 2), and 2b) alone and unoptimized - this could even allow you to source in unobfuscated JS in the JSNI, and let GWT do the minimizing for you - and if you can make Closure play nice, you'll even get strings like Sizzle rewritten too. In contrast, 2b) gives you an easier first step forward, no async messiness, and no external dependencies or extra wiring that the library's users will need to do. Still worthwhile, but a different goal to follow. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/QV3SzHaC5iQJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Some of my images arnt being turned into image strips :?
try to prevent any inlining or other optimizations using : @Source(img0001.png) @ImageOptions(preventInlining=true) ImageResource img0001(); From ImageResource.java : /** * Set to {@code true} to require the ImageResource to be downloaded as a * separate resource at runtime. Specifically, this will disable the use of * {@code data:} URLs or other bundling optimizations for the image. This * can be used for infrequently-displayed images. */ Good luck On Sunday, January 20, 2013 1:30:05 PM UTC-2, darkflame wrote: I'm starting to think...unless I am doing something stupid...this is a GWT error. At the very least the behavior contradicts the documentation: The ClientBundle generator combines all of the images defined in your interface into a single, optimized image. This certainly doesn't seem to be the case. Even without my specific problem, I am pretty sure many small images would get converted to DataURLs no? On Jan 8, 3:54 pm, darkflame darkfl...@gmail.com wrote: Still no luck. If it helps diagnose I can supply sample images. On Saturday, December 29, 2012 11:31:06 PM UTC+1, darkflame wrote: ...and thus are rather flickery when animating between them. (they are frames in a animated sprite). What baffles me is they are defined the same way as others that do seem to work. eg. I have a file like: public interface MemDayImages extends ClientBundle { ... @Source(/MemorableDayIcons/MEDIUM/magrietbag0.png) ImageResource MEDmagrietbag0(); @Source(/MemorableDayIcons/MEDIUM/magrietbag1.png) ImageResource MEDmagrietbag1(); @Source(/MemorableDayIcons/MEDIUM/magrietbag2.png) ImageResource MEDmagrietbag2(); ... Which makes a lovely image strip that animates really smoothly. I have another group of sprites however: public interface NoirInternalSprites extends ClientBundle { @Source(com/darkflame/client/JargScene/firelopp/fireloop0050.png) ImageResource fireloop0050(); @Source(com/darkflame/client/JargScene/firelopp/fireloop0051.png) ImageResource fireloop0051(); @Source(com/darkflame/client/JargScene/firelopp/fireloop0052.png) ImageResource fireloop0052(); @Source(com/darkflame/client/JargScene/firelopp/fireloop0053.png) ImageResource fireloop0053(); ... Which does not. These pngs instead turn into dozens of separate files - not a image strip at all. So what gives :? What determines when images are combined and when they are not ? For reference, I use set-property name=ClientBundle.enableInlining value=false / in my gwt.xml to stop data urls being formed. Thanks for any pointers, -Thomas -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/IHhKfBmSn7oJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: gwtsizzle - CSS selectors for GWT dom
Yes, I know, sizzle will use querySelector when available and it has an implementation for old browsers. Regards On Tuesday, January 1, 2013 8:24:51 AM UTC-2, Chris Price wrote: Not sure which browsers you are targeting or the selectors you require, but querySelector might be an alternative without requiring the extra library. http://caniuse.com/#feat=queryselector On 1 Jan 2013 05:14, Sebastián Gurin sebast...@gmail.com javascript: wrote: Thank you Thomas for the clarification and for taking a look to the project. Didn't know about the new xsiframe. I'm reading some documentation and fixing my projects. about wrapper/port thing, I thought a wrapper was when you put the JSO as a pure java class attribute. Then you delegate all methods to the JSO. You have a little (x2) overhead because of the second call but you gain in language because you work with pure java so you can do new MyClass() and inheritance. In my case I use JSOs for talking directly to JS objects from java, so I didn't called wrapper but perhaps you are right, i don't know... iIm pretty confused about terminology here you are right it is not a port... I would call it (direct) Java API for sizzlejs . Happy new year and thanks again! On Monday, December 31, 2012 9:58:44 PM UTC-2, Thomas Broyer wrote: On Monday, December 31, 2012 10:55:50 PM UTC+1, Sebastián Gurin wrote: I needed a lightweight solution for CSS selectors in com.google.gwt.dom.client.**Element so I made a GWT port of the JavaScript library *sizzle*js.com/ http://sizzlejs.com/ Ah, this is not a port, it's a wrapper. Also note that the script src= in the gwt.xml won't work with the xsiframe linker (and the xsiframe linker is the future) -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/RjoowyRiuDEJ. To post to this group, send email to google-we...@googlegroups.comjavascript: . To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com javascript:. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/Og5rXrn-F8UJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: gwtsizzle - CSS selectors for GWT dom
Oh another term :( I think I will call it wrapper as you suggested before. I like the first level wrapper vs second level wrapper idea for discriminate between them. Thank you again for all the help! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/I0tQmK7_KPMJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Updating GWT libraries for supporting xsiframe
I'm the author of some GWT libraries wrapping some JS libraries like YUI, raphaeljs, sizzlejs, etc. In this GWT libraries I need to include the JS files and until now I'm doing this using script src=jsLibrary.js/script in my libraries gwt.xml. This way the end user of my libs do not have to worry about getting or loading the JS library at all, just inherith my library and it is ready to work. But script in gwt.xml is not supported by the new xsiframe linker. As I understand from previous discussion and documentation, there are two possible solutions: 1) First solution: let the user be responsible of including the aLibrary.js file in its html host page. This adds extra work to the end user: he has to download the .js minified file and include it on the html host page. 2) Second solution: use a tool like ScriptInjector for loading aLibrary.js file dynamically. With this solution I release the user of the responsabilities of having to get the .js file and put it on the host page, but adds an extra step for our users. For example, in my libraries getting started guides like http://code.google.com/p/gwtsizzle/wiki/GettingStarted the user is able to use the Java API directly withtout loading anything, but now he must first load the library async for using it, like this: MyLib.load(new MyCallback(){ public void loaded(){ //now start using the API } }) This two solutions adds extra work to the end user compared to my current solution of symply using script src=aLib.js/script in my library's gwt.xml file. So my question is, am I missing something ? a third solution that I didn't contemplate ? Or simply updating my GWT wrapper libraries to support xsiframe linker will add extra work to my libraies end users ? Regards and thanks in advance. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/Gah89dluRfkJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: dynamic update data
define some class with a name like ClientContext or something like that. Let that class be the home of the client entities you want to manage (like your pizzas). This class is responsble of mantaining this client entities both by let you add/remove the entities and also let observers to subscribe to entity changes. So when you add / remove entities you notify the observers. Then register a Entity change listener and when notified for an entity change, just update all the GUI components that need to be updated when you add/remove pizzas. Something like this: public class ClientContext { private ListPizza pizzas; public void add(Pizza p) { pizzas.add(p); notifyAllListeners(); } public void addPizzaListener(PizzaListener l){...} public void notifyAllListeners(){for(PizzaListener l : listeners){l.notifyPizzasChange(); }} } ..then on your GUI code...: ClientContext.getInstance().addPizzaListener(new PizzaListener(){ public void notifyPizzasChange(){update the list box using ClientContext.getInstance().getPizzas()} }) Hope this can clarify something... Happy new year to you too! P/D: in these cases, I often find much more useful to have a MapString, Pizza for storing the pizzas by id. Also you can use a cheap map using Js Objects directly instead of java.util.Map implementations, like this: http://code.google.com/p/yuigwt/source/browse/trunk/yuigwt/src/org/sgx/yuigwt/yui/util/LWMap.java On Tuesday, January 1, 2013 5:29:57 PM UTC+1, Aldin wrote: Happy New Year! Your idea is not bad. But I don't know how to achieve your logic. I trying to implement your idea without success. I can add my new pizza object to ArrayList of pizza objects but how to update the ListBox??? On Mon, Dec 24, 2012 at 6:14 PM, Sebastián Gurin sebast...@gmail.comjavascript: wrote: If the pizza objects that your client posses are not a very big number, then, instead updating against the server, you can mantain a local collection of pizzas in the client. I mean, write a class like PizzaHome or something like that that contains a collection or a map of pizzas. When you add a new pizza or remove a pizza, make a call to the server for adding/updating and then modify the local pizza home PizzaHome.getInstance().addNew(pizza1). The Pizza home can be an Observable that notify other interested part of your client when the local pizza collection changes. Also from time to time you can synchronize this PizzaHome with your server. On Monday, December 24, 2012 8:48:00 AM UTC-2, Aldin wrote: Hi guys, I am developing pizza ordering application. I have two forms: 1) For inserting new pizza 2) and for ordering. Here you can see: inserting.pnghttps://docs.google.com/file/d/0B3erDjZR5T_NT094alBMbG9FUlk/edit ordering.pnghttps://docs.google.com/file/d/0B3erDjZR5T_NTG1JZnFOMldRRTQ/edit When I insert a new pizza and go to check on combo box (picture ordering) I can't see my new pizza in combo box. The new pizza is inserted in my databases. The pizzas in combo box are from my database. I have one idea. But I don't think it is good. To use Timer t = new Timer() { public void run() { //display all pizza from my database every 2 se to combobox } }; t.schedule(2000); Any idea for better approach??? Thanks -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/1VMHjsTx0o4J. To post to this group, send email to google-we...@googlegroups.comjavascript: . To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com javascript:. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/ZpGfUttNR3MJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
gwtsizzle - CSS selectors for GWT dom
I needed a lightweight solution for CSS selectors in com.google.gwt.dom.client.Element so I made a GWT port of the JavaScript library *sizzle*js.com/ http://sizzlejs.com/ GWTSIZZLE : http://code.google.com/p/gwtsizzle/ Since it has a very simple JavaScript API it only took me 1 hour to author this project. It is much more lighter than using gquery (about 19kb). Any feedback is most appreciated. Usage example: // ala JavaScript JsArrayElement result = Sizzle.sizzleArray(div p); for (int i = 0; i result.length(); i++) System.out.println(result.get(i).getTagName()); // ala Java for (Element e : Sizzle.sizzleCol(div p)) System.out.println(e.getTagName()); -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/a2i1sHAnU74J. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: gwtsizzle - CSS selectors for GWT dom
Thank you Thomas for the clarification and for taking a look to the project. Didn't know about the new xsiframe. I'm reading some documentation and fixing my projects. about wrapper/port thing, I thought a wrapper was when you put the JSO as a pure java class attribute. Then you delegate all methods to the JSO. You have a little (x2) overhead because of the second call but you gain in language because you work with pure java so you can do new MyClass() and inheritance. In my case I use JSOs for talking directly to JS objects from java, so I didn't called wrapper but perhaps you are right, i don't know... iIm pretty confused about terminology here you are right it is not a port... I would call it (direct) Java API for sizzlejs . Happy new year and thanks again! On Monday, December 31, 2012 9:58:44 PM UTC-2, Thomas Broyer wrote: On Monday, December 31, 2012 10:55:50 PM UTC+1, Sebastián Gurin wrote: I needed a lightweight solution for CSS selectors in com.google.gwt.dom.client.Element so I made a GWT port of the JavaScript library *sizzle*js.com/ http://sizzlejs.com/ Ah, this is not a port, it's a wrapper. Also note that the script src= in the gwt.xml won't work with the xsiframe linker (and the xsiframe linker is the future) -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/RjoowyRiuDEJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: dynamic update data
If the pizza objects that your client posses are not a very big number, then, instead updating against the server, you can mantain a local collection of pizzas in the client. I mean, write a class like PizzaHome or something like that that contains a collection or a map of pizzas. When you add a new pizza or remove a pizza, make a call to the server for adding/updating and then modify the local pizza home PizzaHome.getInstance().addNew(pizza1). The Pizza home can be an Observable that notify other interested part of your client when the local pizza collection changes. Also from time to time you can synchronize this PizzaHome with your server. On Monday, December 24, 2012 8:48:00 AM UTC-2, Aldin wrote: Hi guys, I am developing pizza ordering application. I have two forms: 1) For inserting new pizza 2) and for ordering. Here you can see: inserting.pnghttps://docs.google.com/file/d/0B3erDjZR5T_NT094alBMbG9FUlk/edit ordering.pnghttps://docs.google.com/file/d/0B3erDjZR5T_NTG1JZnFOMldRRTQ/edit When I insert a new pizza and go to check on combo box (picture ordering) I can't see my new pizza in combo box. The new pizza is inserted in my databases. The pizzas in combo box are from my database. I have one idea. But I don't think it is good. To use Timer t = new Timer() { public void run() { //display all pizza from my database every 2 se to combobox } }; t.schedule(2000); Any idea for better approach??? Thanks -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/1VMHjsTx0o4J. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: jsni - overlay types - js arrays Java API
Thank you Thomas for your reply, I learned new things. Didn't know about if ( GWT.isScript() ) {you can cast the js array to java arrays directly }. I will definetly use those classes for my projects. Thanks again -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/5gn_erJdUC8J. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
jsni - overlay types - js arrays Java API
Hi all. I'm porting some javascript libraries to GWT and in this thread I hope I can share and learn best ways of accessing Js native arrays from java language. I try to add the minimun overhead so I'm using GWT's JsArray, JsArrayMixed, JsArrayString, etc for referencing arrays whenever I can. But this is not so friendly for a Java programmer accustomed to work with real java arryas (String[]) or with java.util.Collection API. The first thing I thought of was convert js arrays to Java arrays. Unfortunately i didn't found a way of doing this without (linear overhead); public static JsArrayNumber toJsArrayDouble(double[]a) { if(a==null) return null; JsArrayNumber jsa = (JsArrayNumber) JsArrayNumber.createArray(); for (int i = 0; i a.length; i++) { jsa.push(a[i]); } return jsa; } Now I'm experimenting on wrapping a Js Array into a java Collection. For this I made a simple Java class that extends java.util.AbstractCollection [0] and wrapps a pure js array. So from jsni code now I can return Java Collections instead JsArray like types and the final user of my libs can write java statements like for(String s : myOverlay.getArrayProp()) {..}. Also this solution adds very few (constant) overhead. So now I'm using two getters for js arrays, one that return the real js array object using GWT's JsArray* and other that return a Java Collection: /** * Returns 'columns' property (JavaScript array) * @return */ public native final JsArrayString columns() /*-{ return this[columns]; }-*/; /** * Returns 'columns' property (Java Collection) * @return */ public native final CollectionString getColumns() /*-{ return @org.sgx.test1.client.JsUtil::toJavaCollection(Lcom/google/gwt/core/client/JavaScriptObject;)(this[columns]); }-*/; I would like to hear what others in the same situation do. Use JsArray* GWT's classes vs more Java friendly API ??? Thanks in advance any suggestion or comment is most appreciated. [0] - Source code for my Java Collection class wrapper import java.util.AbstractCollection; import java.util.Iterator; import com.google.gwt.core.client.JavaScriptObject; /** * a Java Friendly way of working with Js Arrays using the Java.util.Collection API * @author sg * * @param T */ public class JsArrayCollectionT extends AbstractCollectionT { private JsArrT _data; /** * creates an empty array */ public JsArrayCollection() { _data = JsArr.create().cast(); } /** * creates JsArrayCollection wrapping an existing js array */ public JsArrayCollection(JavaScriptObject data) { this._data = data.cast(); } public static T JsArrayCollectionT create(JavaScriptObject data) { return new JsArrayCollectionT(data); } @Override public IteratorT iterator() { return new JsArrayIteratorT(this); } @Override public int size() { return _data.size(); } public static class JsArrayIteratorT implements IteratorT { private JsArrayCollectionT arr; int currentIndex; public JsArrayIterator(JsArrayCollectionT arr) { this.arr = arr; currentIndex=0; } @Override public boolean hasNext() { //System.out.println(currentIndex+ - +arr.size()); return currentIndex arr.size(); } @Override public T next() { currentIndex++; return arr._data.get(currentIndex-1); } @Override public void remove() { arr._data.slice(currentIndex-1, currentIndex); } } /** untyped array */ private static class JsArrT extends JavaScriptObject { protected JsArr(){} public native final JsArrT slice(int start, int end)/*-{ return this.slice(start, end); }-*/; public static final native T JsArrT create() /*-{ return []; }-*/; public final native int size() /*-{ return this.length; }-*/; public final native T get(int i) /*-{ return this[i]; }-*/; } } -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/DbMp1hrjhVUJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: The Future of GWT Report 2012 Published
mine http://code.google.com/p/raphael4gwt/ has support for some charts types of graphael like bar, pie, line, grid, sunburst, radar, etc.- See the demo: http://cancerbero.vacau.com/gwt/graphael4gwtGallery On Tuesday, December 4, 2012 6:05:26 PM UTC-2, James wrote: I am evaluating a chart library for my incoming project. I can not find any information about chart library for GWT. Is it included in the next report? I am trying to find the most popular chart library for GWT. James -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/iHIBck5pivcJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
overlay types not so zero-overhead
Hi all. I'm playing with GWT overlay types for learning better ways of overlaying and working with them more agile. In particular I found that JSO setters methods that return 'this' for method chaining are a good way of defining an object state in a single Java statement, just like they are done in JavaScript. I written about this in http://cancerberonia.blogspot.com/2012/12/guidelines-for-writing-gwt-overlay-types.html This setters methods look like this: public native final MyJSO color(String val) /*-{ this[color]=val; return this; }-*/; So I can define an object in a single Java Statement like MyJSO my1 = MyJSO.create().color(red).age(14); I feel very confortable with that approach and using it on my GWT projects based on JSOs. But to my surprise (thanks to IRC user niloc132), these setters are not inlined in the GWT compiler JavaScript output. Please, read last part of my blog post About Performance. For each setter a JavaScript function is defined and called: the JSNI code is not inlined. So this is not a zero overhead solution (as my libraries promise). I tried different approachs for defining these setters, but with the same results in all cases. My question is, can I force the GWT compiler somehow to inline some of mine JSNI methods, perhaps with some annotation ? Do somebody have any suggestions for making setters returning 'this' to be inlined in javascript output instead of creating and calling javascript functions in javascript generated code ? Regards and thanks in advance. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/nP7VQfsZHvgJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Pass data by hostpage error:JavaScriptObject$ cannot be cast to com.pkg.model
I think you have it wrong. I would do this, first, People must be a JavaScriptObject not an interface: public class People extends JavaScriptObject { protected People(){} public native final String image() /*-{ return this[image]; }-*/; public native final People image(String val) /*-{ this[image] = val; return this; }-*/; } Then, I think you are wrong also in getRecommendedFriends(). It needs to be final and to return a JsArrayPeople private native final JsArrayPeople getRecommendedFriends()/*-{return $wnd.rcmdFriends;}-*/; Other stuff I think it is OK. Than should work. On Wednesday, December 5, 2012 6:05:43 AM UTC-2, Alex Luya wrote: I followed this article to use hostpage to pass an array to client: https://developers.google.com/web-toolkit/articles/dynamic_host_page Currently,I can see follow content in firebug html style=overflow: hidden;head..script type=text/javascript var rcmdFriends=[{Name:Friend-0,Image:url}]; /script/head../html Then I tried to use these code to get js variable(a json array actually) from hostpage and print it to user: //get array from host pageprivate native JsArrayExtPeople getRecommendedFriends()/*-{return $wnd.rcmdFriends;}-*/; @Overridepublic void onModuleLoad(){final FlowPanel fPanel = new FlowPanel();JsArrayExtPeople channels = getRecommendedFriends();for (int i = 0, len = channels.length(); i len; i++){ //print name to user fPanel.add(new Label(channels.get(i).getName()));}RootPanel.get().add(fPanel);} //model definition@SingleJsoImpl(PeopleImpl.class)public interface People extends HasName{String getImage();void setImage(String Image);} But got this eror: java.lang.ClassCastException: com.google.gwt.core.client.JavaScriptObject$ cannot be cast to com.pkg.People Strangely,I can already see the length of channels is 1,and why do I get this casting error?How to solove this problem? -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/voU6DFKaC7oJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: overlay types not so zero-overhead
Thomas, thank you very much for your input. I think I will keep coding using method chaining and now at least I know they are not free in terms of code size and performance. Also I will test how this behaves introducing closure. Also I have made some little tests, the most interesting is using setters like this: public native final JsFriendlyBeam age(int val) /*-{ var v = this; v[age]=val; return v; }-*/; In that case, the result of translating chained setters like JsFriendlyBeam.create().color(turttlered2).age(14).head(JavaScriptObject.createObject()); is the following JavaScript output: jsFriendlyBeam = (v = (v_1 = (v_0 = {} , v_0['color'] = 'turttlered2' , v_0) , v_1['age'] = 14 , v_1) , v['head'] = {} , v); There the jsni is inlined like I want but at the cost of introducing new js variables v_# for each method call. It do not occurs me how the setter chaining can be translated inline to javascript withtou introducing extra js functions of variables, so perhaps it is impossible. Thank you for the feedback.! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/IkqNosBuR-AJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Google Maps with GWT
I'm having success with this GWT librari (maps version 3) : https://github.com/branflake2267/GWT-Maps-V3-Api On Monday, November 26, 2012 6:08:20 PM UTC-2, Deepak Singh wrote: Hi All, I am using gwt-maps.jar for integrating maps with our application. I am following the link http://code.google.com/p/gwt-google-apis/wiki/MapsGettingStarted GWT 2.5 version Code: Maps.loadMapsApi(, 2, false, new Runnable() { @Override public void run() { System.out .println(YatrafinderDevEnv.onModuleLoad().new Runnable() {...}.run()); LatLng cawkerCity = LatLng.newInstance(39.509, -98.434); MapOptions mo = MapOptions.newInstance(); final MapWidget map = new MapWidget(cawkerCity, 2, mo); map.setSize(100%, 100%); // Add some controls for the zoom level map.addControl(new LargeMapControl()); // Add a marker map.addOverlay(new Marker(cawkerCity)); // Add an info window to highlight a point of interest map.getInfoWindow().open(map.getCenter(), new InfoWindowContent(World's Largest Ball of Sisal Twine)); RootPanel.get(paymentInfoDiv).add(map); } }); I am getting exception while invoking MapWidget. ExceptionInitializer exception. I believe this library does not work with GWT 2.5 Pls guide me here. -- Deepak Singh -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/Hbo4dtcuHP0J. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Get an attribute from a GWT object via jsni?
no, com.google.gwt.canvas.dom.client.Context2d is a JavaScriptObject so just treat it as a javascript object not as a java object in jsni code. . On Sunday, November 25, 2012 9:30:46 AM UTC-2, Andrea Boscolo wrote: Try with return conte...@com.google.gwt.canvas.dom.client.Context2d::webkitBackingStorePixelRatio; but I don't think it will ever work. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/Pm7fVpw3pYAJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Get an attribute from a GWT object via jsni?
that should work... What is the result ? On Saturday, November 24, 2012 1:05:28 PM UTC-2, markww wrote: Hi, I'm using Canvas, I need to get a property from the context: context.webkitBackingStorePixelRatio; I'm not sure how to make a jsni function to do this (this property does not seem to have a wrapper already in the gwt Context2d class): // How do we define this function and pass in our GWT Context2d instance? public static native double getBackingStoreRatio(Context2d context) /*-{ return context.webkitBackingStorePixelRatio || 1; }-*/; Canvas canvas = Canvas.createIfSupported(); Context2d context = canvas.getContext2d(); double isThatRight = getBackingStoreRation(context); Yeah I'm not sure what the sytax is for this, the Context2d variable is a GWT object already, Thanks (trying to get the variables from this article for hdpi screen support) http://www.html5rocks.com/en/tutorials/canvas/hidpi/ -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/SwwZsbfkhYoJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: extending uiBinder - give support to 3rd party GUI JavaScript toolkits
Finally, I was able to successfully integrate YUI JavaScript library in UIbinder. I didn't use GWT Widgets for the binding bu t DOM Element directly and take advance of YUI Widget HTML Markup definitions. Written some notes at http://cancerbero.mbarreneche.com/yuigwt/gallery/?test=uibinderuserguidesingleTest=1using this same proposed technology (YUI+uibinder). Hope it can be of help for others in a similar situation. On Monday, October 29, 2012 7:45:14 PM UTC-2, Sebastián Gurin wrote: Thank you Joseph, I'm researching the use of @UIChild now. Also I have posted another related question at https://groups.google.com/forum/?fromgroups=#!topic/google-web-toolkit/-Ed_fnqeFTU Regards -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/rprBlUyT3vsJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Extern library include
You can use script and stylesheet like this in your module definition: script src='http://yui.yahooapis.com/3.7.3/build/yui/yui-min.js' / stylesheet src=https://cdnjs.cloudflare.com/ajax/libs/alloy-ui/1.0.1/aui-skin-classic/css/aui-skin-classic-all-min.css/ For putting your library's .js file inside your project's module : 1) create a folder myPublicFolder at the same location as your gwt.xml file and copy yourLibrary.js inside 2) add public path=myPublicFolder/public to your gwt.xml 3) add script src=myPublicFolder/yourLibrary.js/script to your gwt.xml -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/LbJ19j9-BzMJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: what is -war {path} means in eclipse Arguments Program Arguments means in GWT application
hi tong. when you create a new Google Web Application, by default you will have a /yourproject/war folder and that is your webapp root folder /war/WEB-INF/web.xml. For example,. after you compile your GWT project you can just copy this war folder to your Java container like tomcat webapps folder. This is the folder expected in the -war parameter in the eclipse application launcher configuration. By default you will always have it on /yourGwtProject/war hope that helps On Tuesday, October 30, 2012 4:36:37 AM UTC-2, tong123123 wrote: as in the attached file, for GWT application using GPE, in the Run Configuration Arguments program arguments text box, what is the meaning for -war {path}??? is this mean when I use run as web application, eclipse treat the [path} in -war {path} as the war folder? (in my case, eclipse use d:\workspace\debugleveldemo\target\DebugLevelDemo-1.0-SNAPSHOT as war folder?) where is the related -war info can be found? -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/9216yvTBGIQJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT vs SmartGWT
Also, besides Joseph said (it is true in my case), there is a fundamental difference and it is that vaadin, smartGWT, etc uses an architecture where they depend on server side stuff. For example, all vaading Java code runs in the serverside, and the webapp is rendered 100% on the serverside. The widgets depend on this server side for rendering and there is client-server comunication for rendering, layouting, events, etc. In pure GWT, you are not dependent on a certain serverside technology, you could use php, java container or even no serverside at all. Also, I have found difficult to interoperate between technologies like vaadin and smartGWT with 3rd party JavaScript widgets, or even with normal GWT . Regards On Tuesday, October 30, 2012 9:38:30 AM UTC-2, Alfredo Quiroga-Villamil wrote: I've seen in the past many comments and different opinions about Vaadin, GXT, SmartGWT and GWT-only apps. I think the fundamental thing to remember here is resources. If you work for a company where you can afford to have the designer/s, a CSS savy person/s and the time to build and enhance more than anything pure GWT widgets then by all means go with the GWT only approach. Do that also if you know the app is being built and will be there to stay for a loog time. However, in many cases we all seem to think that those frameworks only provide cosmetic things and they really don't. They actually provide a whole lot more than just style. Not all GWT-only widgets, but many actually need a lot of work in both how they look as well as how they are used programmatically. Not too long ago I set out to build a pure GWT app (one man app only and being built by someone, me in this case that have been building GWT for quite some time) and I was the one that almost jumped off the building in this case. I found myself, styling things, some of the widgets needed a lot of extra boiler plate (take Cell Table for instance), just to do basic stuff that using some of the other frameworks mentioned would just be one or a few lines of code. So if you have to make a decision, think about one thing and one thing only. Do you truly have the resources/time, both design and coding wise to enhance the existing GWT widgets? The answer to that will likely tell you what to use and it's likely the reason why those companies are such value-add to the existing GWT code base. As far as performance goes, unless you are building an App for something extremely, and I emphasize extremely demanding, there is little to none chance that using GXT, Vaadin or SmartGWT will have an actual impact on your app. Alfredo On Mon, Oct 29, 2012 at 8:01 PM, Joseph Lust lifeo...@gmail.comjavascript: wrote: Folks in my company were just asking me this the other day. If you want an app that looks like the GXT or SmartGWT showcase, and absolutely nothing more, then use them. But you'll have to bend to their paradigms and extend their frameworks if you want more than they do. Further, these frameworks are heavy weight, so doing just what you need in GWT will be much faster performance wise. This is why we stick with pure GWT on my team and why another dev team in our company wanted to jump off a cliff after building a 400 screen app in GXT. Sincerely, Joseph -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/yKJ3UnRqsMMJ. To post to this group, send email to google-we...@googlegroups.comjavascript:. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com javascript:. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- Alfredo Quiroga-Villamil AOL/Yahoo/Gmail/MSN IM: lawwton -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/cwQkn1O8OgcJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Future of GWT survey
Done!, hey ! you don't have Uruguay in you country select box :( -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/QAtatRSv2TIJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: extending uiBinder - give support to 3rd party GUI JavaScript toolkits
Nino, thank you for you comments. Finnaly I was able to create a simple GWT Widget class hierarchy that wrap my YUI widgets, extending Composite class. So I'm using widgets minimally, but not events - if the user wants events support then it should use the YUI Event API in its .java files, not GWT's. At this time I can write my yui widgets in UIBinder's XML without trouble. The only bad thing is the following. My yui widgets are instantiated using a YUIContext object (a JSO) . (it is a porting based 100% on overlay types). So my GWT widget wrappers need access to this object. The bad thing is that I cannot find a way to pass that object from UIBinder markup to my children YUI wrapped widgets. Currently I'm using a static field for storing this object, and the user is responsible of setting it statically before rendering anything with uibinder , and all my widgets classes uses this static property internally for the native instantiation. Question: There is any way of telling uibinder root widget to automatically pass an object to its childrens, or automatically call a setter on its childs for setting this object (automatically)? Regards, hope I made myself clear. P/S: I'm just starting with UIBinder , the lack of UIBinder documentation make it strange how well this technology is adopted. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/VZGnzOGhmUcJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
UIBinder - custom ElementParser for my UI Widgets.
Hi all. I'm developing UIBinder support for my GWT port of JavaScript library YUI. So far so good, but now I encounter the following problem. In YUI, there are components like TabView (similar to TabPanel / TabLayoutPanel). I would very like to support a XML syntax like TabPanel or TabLayoutPanel with pseudo XML elements for grouping the tabs and titles (g:tab, g:header, etc) As I understand this is the responsability of com.google.gwt.uibinder.elementparsers.ElementParser. As I can see there is an implementation for each complex YUI widget. I would very like to try developing my own ElementParsers, but I cannot find how to register a custom ElementParser for my own YUI widgets. I can see a lot of people doing nasty hacks for support something similar and I cannot believe that GWT UIBinder do not support this. Any idea ? Thanks in advance -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/jx5ykiww_zoJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: extending uiBinder - give support to 3rd party GUI JavaScript toolkits
Thank you Joseph, I'm researching the use of @UIChild now. Also I have posted another related question at https://groups.google.com/forum/?fromgroups=#!topic/google-web-toolkit/-Ed_fnqeFTU Regards -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/uYDMWAN_mxYJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
extending uiBinder - give support to 3rd party GUI JavaScript toolkits
Hi all. I have ported a GUI JavaScript library to GWT -http://code.google.com/p/yuigwt/. I would like yuigwt users be able to use YUI widgets in uibinder. YUI (yuigwt) defines its own Widget infrastructure and class hierarchy, event handling, etc and it not depends on GWT widgets and GWT DOM. It also has some rudimentary support for displaying YUI widgets inside GWT Widgets and viceversa, and the same for com.google.gwt.dom.client.* As I understand from javadocs, all my custom UIBinder classes must inherit from com.google.gwt.user.client.ui.UIObject. But it seems it do not support events, so I guess this mean uiBinder is dependent on GWT Widgets. I have found no documentation or forum post dedicated explicitly to UIBinder and 3rd party javascript toolkits interoperability. Also I have found some projects aimed to do this like http://code.google.com/p/gwt-customuibinder/, but I'm not sure to use them. So my questions are, for defining UIBinder classes to support YUI Widgets, 1) is there are a way of support uibinder Events without working with GWT Widgets API? 2) Do I need to base my uibinder on GWT Widget ? An I obligated to work with my rudimentary GWT widget - YUI widget intoroperability ? 3) any one have any expertice in this field (give 3rd party JavaScript toolkits ported to GWT uiBinder support ? ) Thanks in advance. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/ByAlGyu1AVwJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT Junit Test
You can also write pure JUnit (not GWT JUnit) tests in a separate project and use syncproxy for calling your RPC services synchronously (very desired behavior for testing RPC services). In this tutorial I try to explain, step by step how to do it: http://cancerberonia.blogspot.com/2012/10/testing-gwt-service-classes.html Hope that can help you -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/yET3Opv3vQgJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: ANN:gwt-yui-ext Demos
a similar newer project :yuigwt - http://code.google.com/p/yuigwt/- a YUI 3 complete porting to GWT Java. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/Lr-4ar1D1rIJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT RPC synchronic calls
just published some notes about how getting started with syncproxy and eclipse + google plugin for testing GWT services synchronously: http://cancerberonia.blogspot.com/2012/10/testing-gwt-service-classes.html -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/hEs0k4z0CzgJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: mp3 resources - can they be played from within GWT?
Perhaps something like http://code.google.com/p/gwt-sound/ On Saturday, October 6, 2012 9:59:00 PM UTC-3, jones34 wrote: Is there any way (a widget, maybe) I can play an MP3 that I have as gwt resource, without leaving gwt or sending the user to a new browser tab? An MP3 player widget, maybe? thanks -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/Ym5eaRHFR5EJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT RPC synchronic calls
Brian: well said. I'm on that road now. As a commend: I tried block the client with some dirty sleep() function like the following , and in devmode, as I suspected, It didn't worked, because, the devmode itlself was being blocked too function sleep(milliseconds) { var start = new Date().getTime(); for (var i = 0; i 1e7; i++) { if ((new Date().getTime() - start) milliseconds){ break; } }} On Thursday, October 4, 2012 10:47:00 PM UTC-3, Brian Slesinsky wrote: Yes, running in the JVM is better. I've tried pretty hard to make this work well and as a result, I don't recommend writing integration tests in GWT (or JavaScript). Integration tests are naturally represented as a sequence of actions that perform I/O, and this works better on a platform that supports blocking I/O natively. There are design patterns to make a chain of async callbacks look more sequential, but the resulting code still ends up looking pretty unnatural and hard to debug. - Brian On Wednesday, October 3, 2012 2:39:55 PM UTC-7, Sebastián Gurin wrote: Aja Jens I understand now thanks. Tests are normal java programs that perform RPC targetting your running gwt application somewhere else.Trying to get it work that way. Thanks again. On Wednesday, October 3, 2012 6:26:43 PM UTC-3, Jens wrote: Jens, thank you but as I suspected I have troubles. What do you mean with a pure JUnit test ? you mean a non gwt program ? A pure junit test launched from a normal java runtime, not in GWT ? Yes. See the provided tests of gwt-syncproxy (e.g.: http://code.google.com/p/gwt-syncproxy/source/browse/trunk/test/com/gdevelop/gwt/syncrpc/test/EnumsTest.java). These are normal JUnit Tests. I thought syncproxy was a library for the gwt client side, so it is strange to me that dodn't come with a gwt module definition. The docs says ( http://code.google.com/p/gwt-syncproxy/) I must instantiate the service class on the client side like this: private static GreetingService rpcService = SyncProxy.newProxyInstance(GreetingService.class, http://example.com/helloApp;, greet); When the docs say Java Client code it means the client side code of the server service. It does not mean GWT client code. SyncProxy.newProxyInstance() will never work in GWT client code. -- J. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/IzNA5Fxze7MJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Are you happy with GWT?
yes I'm happy, and besides the other people reasons, I would like to share my experience from the point of view of reusing existing javascript toolkits and frameworks. GWT let you define a Java API for any existing JavaScript toolkit or library. The mechanism of translating an existing JavaScript API to a GWT Java API using GWT JSNI and JavaScriptObject (overlay types) is very mechanical, and can be boosted using a good api tool like eclipse editor's Java code Templates. Besides using overlaytypes gives a Java API with zero-overhead : your java calls will be literally translated to native javascript. No wrappers ! So in other words, GWT provides with good tools for easy and safe JavaScript toolkit definition and reuse in java. (at this time however is rare not to find a GWT version of a cool existing JavaScript toolkit). On Friday, October 5, 2012 12:53:17 PM UTC-3, Charlie Youakim wrote: I'm deciding on whether to switch my team to GWT. I think the biggest thing for me as the tech lead for the company is Are you happy with your choice to use GWT? My reasons for thinking to switch: -Javascript is a fast and free language, sometimes too fast and free for a large team. Coding standards can vary from developer to developer, and maintaining architectures can be difficult -Javascript mistakes are only caught in runtime. The fact that GWT(Java) would catch 90+% of our simple mistakes makes me more confident that our clients won't. -Javascript allows for rapid development, but not so rapid bug fixing. -Strict Java coding + a strong architecture at the outset creates a great foundation to build from. I've even seen this in my firm's Android apps. They are very stable. But for me, I'd really like to hear from developers active in the community. Are you happy? Or do you wish you went a different route? My goal is to have my dev team work more on new projects rather than fixing old projects. I am hoping that GWT can help with that. thoughts? -Charlie -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/oiHEVv8ykcEJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
GWT RPC synchronic calls
Hi all. I really want to use RPC synchronic calls for creating simple to read automated tests against my model classes services. *** I don't want to use RPC calls synchronically on production code, only on my automated tests. In my particular case, I think it is a common case, I have some RPC services that perform CRUD operations on some model class. (behind there is appengine datastore and objectify, but that isn't part of the problem). I want to write test units that, for example, add some entities through RPC, delete, search and update the entities and make some asserts for making sure it works (like a DAO automated test in common j2ee applications). The problem is that because of the asynchronic nature of GWT RPC it is very hard to write such tests cases. For example, writing a simple use case test like 1) save a new entity, 2) get the entity and check it was saved/loaded ok 3) update the entity and assert it was updated ok, 4) delete the entity and assert it was deleted ok take five or more anidated rpc callbacks. and more complicated uses cases code are almost impossible to write/ read. I have created a simple Synchronic queue so I can execute each stage of the test more asynchronically and thus more readable. But still kind of complicated, see http://code.google.com/p/yuigwt/source/browse/madrenecesidad/src/org/sgx/madrenecesidad/client/test/tests/ChannelServiceTest1.java#41 In this case, synchronic RPC would be ideal: service.addMyEntity(new MyEntity(...)); assertTrue(service.listMyEntities().size()==1); MyEntity e = service.getEntityByName(name); assertTrue(e.getName.equals(...)); service.deleteMyEntity(e); assertTrue(service.listMyEntities().size()==0); etc. There is a project called http://code.google.com/p/gwt-syncproxy/ that claims to support synch rpc calls just like I want, but it do not seems to be supported anymore and the .jar do not contain any GWT module My question to you all is, is there a way of facilitating the writing of automated testcases for testing RPC services ? How do you do that ? I bet GWT brings something for this case after all automated testing on RPC services should be a common tasks for GWTers but I can't figure out. Thanks in advance, any suggestion is most welcome. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/TRR8BEef8o0J. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT RPC synchronic calls
Jens, thank you but as I suspected I have troubles. What do you mean with a pure JUnit test ? you mean a non gwt program ? A pure junit test launched from a normal java runtime, not in GWT ? then this is not for me. In my case I want to launch the tests from my GWT/GAE application itself , not from a pure junit test I thought syncproxy was a library for the gwt client side, so it is strange to me that dodn't come with a gwt module definition. The docs says (http://code.google.com/p/gwt-syncproxy/) I must instantiate the service class on the client side like this: private static GreetingService rpcService = SyncProxy.newProxyInstance(GreetingService.class, http://example.com/helloApp;, greet); But that introduces the GWT compilation error: No source code is available for type com.gdevelop.gwt.syncrpc.SyncProxy; did you forget to inherit a required module? Espected error.. I'm trying now to put the library sources in my own code. Hope that let me use it. Any suggestions are appreciated, in the meanwhile will try to contact the authors. Thanks On Wednesday, October 3, 2012 3:26:58 PM UTC-3, Jens wrote: I think you dont need a GWT module for gwt-syncproxy. It should work in a pure JUnit test as it does not use GWT.create() for creating the GWT service. gwt-syncproxy uses Java's dynamic proxy to implement the service interface and uses Java's HttpUrlConnection to call your server. -- J. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/FPSIG22RZbAJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT RPC synchronic calls
Aja Jens I understand now thanks. Tests are normal java programs that perform RPC targetting your running gwt application somewhere else.Trying to get it work that way. Thanks again. On Wednesday, October 3, 2012 6:26:43 PM UTC-3, Jens wrote: Jens, thank you but as I suspected I have troubles. What do you mean with a pure JUnit test ? you mean a non gwt program ? A pure junit test launched from a normal java runtime, not in GWT ? Yes. See the provided tests of gwt-syncproxy (e.g.: http://code.google.com/p/gwt-syncproxy/source/browse/trunk/test/com/gdevelop/gwt/syncrpc/test/EnumsTest.java). These are normal JUnit Tests. I thought syncproxy was a library for the gwt client side, so it is strange to me that dodn't come with a gwt module definition. The docs says ( http://code.google.com/p/gwt-syncproxy/) I must instantiate the service class on the client side like this: private static GreetingService rpcService = SyncProxy.newProxyInstance(GreetingService.class, http://example.com/helloApp;, greet); When the docs say Java Client code it means the client side code of the server service. It does not mean GWT client code. SyncProxy.newProxyInstance() will never work in GWT client code. -- J. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/AhqneOVZXgoJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Nasty overlay types restrinction : Only one JavaScriptObject type may implement the methods of an interface
nino: thank you very much! I have my two question responded in your code snippet. My last question: I notice you perform most of the job in javascript / jsni, nice. How is your experience using eclipse+google Java code refactoring tools ? in particular, method and class renames ? Thank you again.- On Thursday, September 13, 2012 5:51:30 PM UTC-3, nino wrote: In one our our project we have a base which goes something like public class ProxyObject { protected JavaScriptObject jsObj; protected ProxyObject() { } } The we do public class View extends ProxyObject { public View() { createPeer(); } View(JavaScriptObject obj) { jsObj = obj; } private ListView children = new ArrayListView(); @Override public native Point getAnchorPoint() /*-{ var jso = th...@com.emitrom.gwt4.ti.mobile.client.core.ProxyObject::getJsObj()(); var obj = jso.anchorPoint; var toReturn = @com.emitrom.gwt4.ti.mobile.client.ui.Point::new(Lcom/google/gwt/core/client/JavaScriptObject;)(obj); return toReturn; }-*/; } We create the wrapped JSO in the constructor and delegation is done using JSNI which save the need of the explicit cast. To call methods on the wrapped JSO we use JSNI Hope this could help 2012/9/13 Sebastián Gurin sebast...@gmail.com javascript: Hi nino, i'm making a second Java API for my yuigwt project, on top of my JSO based Java API, wrapping JSO objects and delegating methods to it. I have a couple of questions for you about this. I'm not sure, perhaps the best is to create another thread for this questions, but here they go: I have a rich class hierarchy for example, ClassC extends ClassB extends ClassA Now for ClassA I'm writing: public class ClassA { protected JSOClassA _wrapped; } The problem is that in ClassB and ClassC I must cast _wrapped to JSOClassB and JSOClassC for implementing method delegation, so I ended with something like public class ClassB extends ClassA { protected JSOClassB _wrappedClassB() { return _wrapped.cast(); } } public class ClassC extends ClassB { protected JSOClassC _wrappedClassC() { return _wrapped.cast(); } } can you think of another more simpler way to solve this ? And the other question is, how or where should I initialize the _wrapped field ? at constructor ? Regards and thanks in advance. On Tuesday, September 11, 2012 7:24:56 AM UTC-3, nino wrote: Answer below in Bold. Cheers 2012/9/11 Sebastián Gurin sebast...@gmail.com Nino; I very like your thoughts and I agree with them. My reply between lines: On Monday, September 10, 2012 5:05:25 PM UTC-3, nino wrote: The main Question is do you want YUI users to use Java or do you want to bring Java Devs to YUI ? I think you will get more traction by choosing the latter. I also thought of that. I started learning how to port JavaScript libraries to GWT with my project http://code.google.com/p/** raphael4gwt/ http://code.google.com/p/raphael4gwt/ , a vector drawing library. As such, performance was a requirement, and then a Java API using GWT overlays directly was a requirement. But now for YUIGWT I wonder if that is true. Some notes: *Yeah overlay type can be inherited but there is not much u can do with that.Plus the methods beeing all finals one cant override them. Not really flexible imho*. 1) overlay types CAN be inherited, but I agre that is very unconfortable for end GWT/Java users to do this... this is a very important issue in my project I think... 2) I very liked your question: do you want YUI users to use Java or do you want to bring Java Devs to YUI ? and it is making me reflect a lot. thanks. While a zero overhead API gives you the ability to easely write YUI code in java soon you will get users request like Why cant i extends class X to add my own functions. Overlay types dont give you. We had this problems while implementing our libraries. We started first with 1:1 match of the JS API. Until our users start complaining about the API not beeing extensible. What you would expect when using an OO language like Java. Well, but tell me, do you write a second Java API, with real java classes that wrapp the Js objects ? and if so, do you use your previous 1:1 Java API for writing the this second more-java-confortable API? (I sould do that) and if so, do you use some Java code generator tool for artificial create the second Java API form the first 1:1 - overlays Java API ? can this be mechanized at all? I'm questioning my self these kind of things for my project YUIGWT. YUI has a very big API, and unlike other libraries it contains utils for doing a more structured - object oriented javascript like classes, inheritance, plugins, attributes, events, etc. All artificially and fully extensible from javascript. The big
Re: Nasty overlay types restrinction : Only one JavaScriptObject type may implement the methods of an interface
Hi nino, i'm making a second Java API for my yuigwt project, on top of my JSO based Java API, wrapping JSO objects and delegating methods to it. I have a couple of questions for you about this. I'm not sure, perhaps the best is to create another thread for this questions, but here they go: I have a rich class hierarchy for example, ClassC extends ClassB extends ClassA Now for ClassA I'm writing: public class ClassA { protected JSOClassA _wrapped; } The problem is that in ClassB and ClassC I must cast _wrapped to JSOClassB and JSOClassC for implementing method delegation, so I ended with something like public class ClassB extends ClassA { protected JSOClassB _wrappedClassB() { return _wrapped.cast(); } } public class ClassC extends ClassB { protected JSOClassC _wrappedClassC() { return _wrapped.cast(); } } can you think of another more simpler way to solve this ? And the other question is, how or where should I initialize the _wrapped field ? at constructor ? Regards and thanks in advance. On Tuesday, September 11, 2012 7:24:56 AM UTC-3, nino wrote: Answer below in Bold. Cheers 2012/9/11 Sebastián Gurin sebast...@gmail.com javascript: Nino; I very like your thoughts and I agree with them. My reply between lines: On Monday, September 10, 2012 5:05:25 PM UTC-3, nino wrote: The main Question is do you want YUI users to use Java or do you want to bring Java Devs to YUI ? I think you will get more traction by choosing the latter. I also thought of that. I started learning how to port JavaScript libraries to GWT with my project http://code.google.com/p/raphael4gwt/, a vector drawing library. As such, performance was a requirement, and then a Java API using GWT overlays directly was a requirement. But now for YUIGWT I wonder if that is true. Some notes: *Yeah overlay type can be inherited but there is not much u can do with that.Plus the methods beeing all finals one cant override them. Not really flexible imho*. 1) overlay types CAN be inherited, but I agre that is very unconfortable for end GWT/Java users to do this... this is a very important issue in my project I think... 2) I very liked your question: do you want YUI users to use Java or do you want to bring Java Devs to YUI ? and it is making me reflect a lot. thanks. While a zero overhead API gives you the ability to easely write YUI code in java soon you will get users request like Why cant i extends class X to add my own functions. Overlay types dont give you. We had this problems while implementing our libraries. We started first with 1:1 match of the JS API. Until our users start complaining about the API not beeing extensible. What you would expect when using an OO language like Java. Well, but tell me, do you write a second Java API, with real java classes that wrapp the Js objects ? and if so, do you use your previous 1:1 Java API for writing the this second more-java-confortable API? (I sould do that) and if so, do you use some Java code generator tool for artificial create the second Java API form the first 1:1 - overlays Java API ? can this be mechanized at all? I'm questioning my self these kind of things for my project YUIGWT. YUI has a very big API, and unlike other libraries it contains utils for doing a more structured - object oriented javascript like classes, inheritance, plugins, attributes, events, etc. All artificially and fully extensible from javascript. The big desicion I have to make is this: the objective of YUIGWT is to bring the YUI public concrete utilities to the GWT user, like a datatable, a button, etc . But not to support those utilities enhancing the Javascript language. *We dont use generator for our APIs. We go the insane way to look at each methods in the APIs we try to wrap! This is a lot of work but it gives us the possibility to optimize/enhendce some stuff. And sometime leave some stuff out that dont make sence for a Java Developer. Plus you come to learn the JS library which is not bad (At my day to day work i dont use GWT but EXTJS. So Wrapping ExtJS helped me understand that library better, and hate it even more lol). * * * * Concerning building the objects. Like i said before we basically have a real Java Object wrapping a JSO. And we are just delegating to the native JSO. You can have a look at our Java API for Sencha Touch ( http://emitrom.com/touch4j) to see it in action.* * * * If you have any question feel free to ping me.* code That looks pretty cool. Now what if i want to extend Button and override some methods ? This is the perfect example, thank you! Currently in my YUIGWT project (very new project) I do not contemplate that. What I'm thinking can be a perfect solution for me is : to create a second Button class, that wraps all current Button methods, as you suggested in your first
Re: Store data temporarily
Hi; I'm not sure if this is what you need: http://yuilibrary.com/yui/docs/cache/ it support offline cache and use of html5 localstorage when possible. This is an example using YUIGWThttp://code.google.com/p/yuigwt/library: http://cancerbero.mbarreneche.com/yuigwt/gallery/?test=cache1 final Cache cache1 = Y.newCache(CacheConfig.create().max(5).expires(360)); Y.newButton(ButtonConfig.create().label(Save).render(parent).on(click, new EventCallback() { @Override public void call(EventFacade e) { cache1.add(cacheKey1, p.get(value)); } })); Y.newButton(ButtonConfig.create().label(Load).render(parent).on(click, new EventCallback() { @Override public void call(EventFacade e) { p.set(value, cache1.retrieve(cacheKey1).responseString()); } })); On Wednesday, September 12, 2012 7:27:46 PM UTC-3, More Programmer wrote: Dear All: Please can you help me, I need store data temporarily, I'm using GWT 2.4 to store data on a master- detail, ie from 1 to n, once introduced all newly detailed data will be stored for a single master. Best Regards Jacobo -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/hKqyF8akVG0J. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Nasty overlay types restrinction : Only one JavaScriptObject type may implement the methods of an interface
Nino; I very like your thoughts and I agree with them. My reply between lines: On Monday, September 10, 2012 5:05:25 PM UTC-3, nino wrote: The main Question is do you want YUI users to use Java or do you want to bring Java Devs to YUI ? I think you will get more traction by choosing the latter. I also thought of that. I started learning how to port JavaScript librariesto GWT with my project http://code.google.com/p/raphael4gwt/ , a vector drawing library. As such, performance was a requirement, and then a Java API using GWT overlays directly was a requirement. But now for YUIGWT I wonder if that is true. Some notes: 1) overlay types CAN be inherited, but I agre that is very unconfortable for end GWT/Java users to do this... this is a very important issue in my project I think... 2) I very liked your question: do you want YUI users to use Java or do you want to bring Java Devs to YUI ? and it is making me reflect a lot. thanks. While a zero overhead API gives you the ability to easely write YUI code in java soon you will get users request like Why cant i extends class X to add my own functions. Overlay types dont give you. We had this problems while implementing our libraries. We started first with 1:1 match of the JS API. Until our users start complaining about the API not beeing extensible. What you would expect when using an OO language like Java. Well, but tell me, do you write a second Java API, with real java classes that wrapp the Js objects ? and if so, do you use your previous 1:1 Java API for writing the this second more-java-confortable API? (I sould do that) and if so, do you use some Java code generator tool for artificial create the second Java API form the first 1:1 - overlays Java API ? can this be mechanized at all? I'm questioning my self these kind of things for my project YUIGWT. YUI has a very big API, and unlike other libraries it contains utils for doing a more structured - object oriented javascript like classes, inheritance, plugins, attributes, events, etc. All artificially and fully extensible from javascript. The big desicion I have to make is this: the objective of YUIGWT is to bring the YUI public concrete utilities to the GWT user, like a datatable, a button, etc . But not to support those utilities enhancing the Javascript language. code That looks pretty cool. Now what if i want to extend Button and override some methods ? This is the perfect example, thank you! Currently in my YUIGWT project (very new project) I do not contemplate that. What I'm thinking can be a perfect solution for me is : to create a second Button class, that wraps all current Button methods, as you suggested in your first post. The user could override some methods, and it is his responsability to call super.(). In the constructor, they must pass me the Y object that is responsible for instantiate the real - native Button . Well, a pleasure to read you, if you have any other suggestions or tips about this subject are most welcome. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/a-U28tdEaPAJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Nasty overlay types restrinction : Only one JavaScriptObject type may implement the methods of an interface
Chris: thank you very much: It didn't occured that to me and just tried and worked fine! Will use this pattern, thanks again. ! On Friday, September 7, 2012 1:05:46 PM UTC-3, Chris Price wrote: Sebastián: You may already be aware of this, but when I first looked into this problem it was a subtlety I had overlooked. If you have - interface A { void a();} interface B extends A { void b(); } interface C extends A { void c(); } You can't have - final class BImpl implements B { void a() { ... } void b() { ... } } final class CImpl implements C { void a() { ... } void c() { ... } } Because as has been pointed out a would be implemented twice. However, you can have - final abstract class AImpl implements A { void a() { ... } } final abstract class BImpl extends A implements B { void b() { ... } } final abstract class CImpl extends A implements C { void c() { ... } } Because in this case a is only implemented once. It may not help but when I was wrapping a third-party lib, I found the above pattern worked almost everywhere. Chris On Fri, Sep 7, 2012 at 4:53 PM, Alain Ekambi jazzma...@gmail.comjavascript: wrote: Your approach however would make this kind of Java API much more confortable to Java users Is nt it why you are wrapping YUI in the first place ? To make it confortable for Java users ? 2012/9/7 Sebastián Gurin sebast...@gmail.com javascript: Thanks Paul, Nino and Thomas Paul: yes I suppose that too, but interfaces do not implement methods, so I thought it is strange. Nino: I do not want to make object wrapping as you suggested because I want my library user's to use the overlay types directly for a zero-overhead API. Your approach however would make this kind of Java API much more confortable to Java users. Thomas, thanks. Yes I'm using .cast() a lot, it is much more confortable than java casting. Also I have designed this YUI java API to be the most similar to the native javascript API. So code using mine YUIGWT will look strange to java programmers, for example, a js literal object definition : in javascrpt: var p = {name: seba, age: 28} in java: Person p = Person.create().name(seba).age(28); On Thursday, September 6, 2012 3:22:16 PM UTC-3, Sebastián Gurin wrote: Hi all. I'm writing a lot of GWT overlay types for my new project YUIGWT - http://code.google.com/p/yuigwt/. I'm creating a nice and rich java hierarchy of overlay types there. Today I discovered that it is not good to let overlay types (extends JavaScriptObject implement interfaces because it seems that for a certain interface, no more than one overlay type can implement its methods. The error in question is pasted below, but this arrises a big question for me: While I understand perfectly what the error means, I would really appreciate if somebody can explain me the reasons behind this nasty restriction ? ?? [ERROR] [org.sgx.yuigwt.YuiGwtTestOnline] - Line 9: Only one JavaScriptObject type may implement the methods of an interface that declared methods. The interface (org.sgx.yuigwt.yui.yql.api.YQLQueryResult) is implemented by both (org.sgx.yuigwt.yui.yql.api.desc.DescResult) and (org.sgx.yuigwt.yui.yql.api.wheather.forecast.WheatherForecastResult) Thanks in advance. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/GAl_l1hUSQkJ. To post to this group, send email to google-we...@googlegroups.comjavascript:. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com javascript:. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-we...@googlegroups.comjavascript:. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com javascript:. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/8fm0bbM9lWYJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Nasty overlay types restrinction : Only one JavaScriptObject type may implement the methods of an interface
Nino: mmm that depends. In my case the first thing I want is to provide Java and YUI users the possibility of using these two technologies together. Secondary, I want 2 things: zero-overhead API and an easy learning curve for YUI js users (so If you know Javascript YUI to be trivial to learn my YUI java API). These last two items, lead me to write a Java API that is almost the same as the YUI Javascript API with the less Java sugar or Java helper classes I can. Just learn a few rules on how to do JavaScript in Java code and just use the Java API like you were using the js api. For example, compare these two equivalent js and java codes: YUI Javascript: YUI().use('button', function (Y) { var button1 = new Y.Button({ label: 'a simple button' }).render(parent); button1.on(click, function(e){ alert(clicked at x = +e.clientX); }) }); Java YUI Equivalent in YUIGWT: YUI.Use(new String[]{button}, new YUICallback() { @Override public void ready(YuiContext Y) { Widget button1 = Y.newButton( ButtonConfig.create().label(a simple button) ).render(parent); button1.on(click, new NodeEventCallback() { @Override public void call(YuiEvent e) { Window.alert(button pressed at x =+e.clientX()); } }); } }); hehe, a little weird to see for regular java users, but easy to understand to YUI and Java users. Checkout an example gallery with java sources online at http://cancerbero.mbarreneche.com/yuigwt/gallery/ and some of my thoughts about this at http://code.google.com/p/yuigwt/wiki/YUIJavaApi . One of the god things I discovered for this approach is that Java API writing can me very mechanich, and I can take advance of eclipse java code templates for agile writing java YUI code. Regards. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/CXgAf0nZgSsJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Nasty overlay types restrinction : Only one JavaScriptObject type may implement the methods of an interface
Thanks Paul, Nino and Thomas Paul: yes I suppose that too, but interfaces do not implement methods, so I thought it is strange. Nino: I do not want to make object wrapping as you suggested because I want my library user's to use the overlay types directly for a zero-overhead API. Your approach however would make this kind of Java API much more confortable to Java users. Thomas, thanks. Yes I'm using .cast() a lot, it is much more confortable than java casting. Also I have designed this YUI java API to be the most similar to the native javascript API. So code using mine YUIGWT will look strange to java programmers, for example, a js literal object definition : in javascrpt: var p = {name: seba, age: 28} in java: Person p = Person.create().name(seba).age(28); On Thursday, September 6, 2012 3:22:16 PM UTC-3, Sebastián Gurin wrote: Hi all. I'm writing a lot of GWT overlay types for my new project YUIGWT - http://code.google.com/p/yuigwt/. I'm creating a nice and rich java hierarchy of overlay types there. Today I discovered that it is not good to let overlay types (extends JavaScriptObject implement interfaces because it seems that for a certain interface, no more than one overlay type can implement its methods. The error in question is pasted below, but this arrises a big question for me: While I understand perfectly what the error means, I would really appreciate if somebody can explain me the reasons behind this nasty restriction ? ?? [ERROR] [org.sgx.yuigwt.YuiGwtTestOnline] - Line 9: Only one JavaScriptObject type may implement the methods of an interface that declared methods. The interface (org.sgx.yuigwt.yui.yql.api.YQLQueryResult) is implemented by both (org.sgx.yuigwt.yui.yql.api.desc.DescResult) and (org.sgx.yuigwt.yui.yql.api.wheather.forecast.WheatherForecastResult) Thanks in advance. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/GAl_l1hUSQkJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT Compilation Time Performance Improvement
Niraj: IMHO if you want to agile GWT development you want to develop using the GWT devel mode or the GWT2.5 SuperDevMode (haven't tried myself) instead modify java - compile with ant - see the changes. You could ignore devel mode vs production differences when hard - developing, and perform a main compilation only after you finished a day's work or a module and test only for those kind of differences only in production mode. Also, I would try to run the GWT devel mode using your external server application along with the rest of your webapp, instead builtin GWT server. can I know what differences are those you are talking about ? Regards and good look On Thursday, September 6, 2012 1:33:57 AM UTC-3, Niraj Salot wrote: Hi Members, Thanks for all your suggestion/comments. We have already tried below mentioned options to improve the compilation time overall. 1. Memory Settings. -Xmx and Xms 2. localWorkers 3. DraftCompile The question could arise to members mind that why we need to compile a lot but the thing is :- while doing the development work If we use the development mode provided by GWT , sometimes happens that the end output in production mode is diff. then development mode. So we can not trust that what is shown in development mode will be same in production mode. Hence developers compile their code on their machine and test it before putting something on main server. The issue is developers machine have overall RAM of 4 GB only. And when Jboss , Eclipse and Compilation of GWT runs , It is very very slow. So for even the small changes , developers needs to compile , build the WAR and then deploy to check that his code is working ok or not. I am looking for some option which could allow me to pre-compile GWT modules. So that If some GWT module is not changed and when I compile the main module , that GWT module should not compile as it is not changed at all. I am not still not getting how to use the concept of *.gwtar files which is mentioned in our discussion. Would appreciate if someone can provide more details on the same. Thanks,Niraj. On Tuesday, 4 September 2012 11:40:19 UTC+5:30, Niraj Salot wrote: Hi Members, We are using GWT Version 2.4 in our current project. On server side, we are using Spring Custom JDBC framework. We are using Maven as our Build Tool. The application is getting deployed on JBOSS 7 Server. Currently we have everything in one single Eclipse Project. Means one Application.gwt.xml file and one ApplicationContext.xml for spring. We have around 2000 Java files out of which around 1500 are for GWT related source files. The project is still growing with more source files. We are fine with timings of Java to Javac [class file] Compilation time. But when It comes to Java to JavaScript , It is a issue. We have used all hacks mentioned in the GWT Forum. Like. 1. Compiling for only one Local 2. Compiling for only one Browser But still the compilation is taking 4-6 minutes.. OR even 7 minutes some times. With this question, I would like to know the options available to improve the same. We are thinking to Split the Project like this WAY: - Module 1 (JAR Build) - Module 2 (JAR Build) - Module Main (WAR Build). This would contain Application.gwt.xml file which would inherit Module 1 Module 2. Now Question comes: *1) Will this help us in Improving the compilation time?* *2) IF we change only Module 2 and then compile Module Main, will GWT still compile Module 1 as it is inherited by Module Main?* Please share your views on above scenario. We have even tried out GWT 2.5 option but no help in performance improvements. Thanks, Niraj Salot. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/vN3pg8mTTlcJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Nasty overlay types restrinction : Only one JavaScriptObject type may implement the methods of an interface
Hi all. I'm writing a lot of GWT overlay types for my new project YUIGWT - http://code.google.com/p/yuigwt/. I'm creating a nice and rich java hierarchy of overlay types there. Today I discovered that it is not good to let overlay types (extends JavaScriptObject implement interfaces because it seems that for a certain interface, no more than one overlay type can implement its methods. The error in question is pasted below, but this arrises a big question for me: While I understand perfectly what the error means, I would really appreciate if somebody can explain me the reasons behind this nasty restriction ? ?? [ERROR] [org.sgx.yuigwt.YuiGwtTestOnline] - Line 9: Only one JavaScriptObject type may implement the methods of an interface that declared methods. The interface (org.sgx.yuigwt.yui.yql.api.YQLQueryResult) is implemented by both (org.sgx.yuigwt.yui.yql.api.desc.DescResult) and (org.sgx.yuigwt.yui.yql.api.wheather.forecast.WheatherForecastResult) Thanks in advance. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/bVE-agIAe-kJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
YUIGWT - YUI 3 in GWT
I just started a YUI 3 http://yuilibrary.comJava GWT API. It is a GWT library for using YUI 3. Project home page: http://code.google.com/p/yuigwt/ http://code.google.com/p/yuigwt/ Example Gallery with online Java sources :http://cancerbero.vacau.com/yuigwt/ It is 99% overlay types, and the syntax try to emulate YUI JavaScript syntax statements as much as possible. (see JavaScript YUI code compared to its YUIGWT Java code equivalent: http://code.google.com/p/yuigwt/wiki/equivalentCodeCompared ) The project is very very new, but a general pattern for migrating all the YUI JavaScript API to Java was found, using 100% GWT Overlay types for a zero overhead Java API. A lot of components are already ready to be used, check the example gallery that will reflect current progress. I must say, I must to give thanks to eclipse java templates for writing GWT overlay methods; it is speeding my code a lot. Any suggestions or ideas are most welcome. Regards, -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/fVGkaVLc8ZEJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT vs YUI
I'm doing a YUI 3 GWT Java API on code.google.com/p/*yuigwt*/http://code.google.com/p/yuigwt/ On Tuesday, December 4, 2007 9:59:37 AM UTC-2, eliasb...@gmail.com wrote: I personally believe GWT is best case scenarion for people that refuse or want to avoid the quirks of HTML+JavaScript It is my personal choice because it allows me to program a web application's UI the same way I program a standalone application (Swing like or SWT like) Also programming with a more familiar model requires less time. Development times and related costs are thus reduced. Extensibility is also another additional benefit. Being able to create custom components (either from scratch or from others) adds flexibility. I would suggest creating GWT wrappers of the YUI components. I haven't done something similar (yet) but I believe it is worth the effort plus I wouldn't expect it to be very hard. On Dec 4, 2007 1:52 PM, Gene Ash jane...@gmail.com javascript: wrote: Hi, We have been using GWT as the framework in our project for quite some time. Now we are considering migrating the application to YUI due to the following reasons: 1. Richness of controls available 2. Simpler skinning model (developing custom CSS to meet the project styles) 3. More open - no complicated Java-to-JS tool to deal with, if we really get stuck 4. flexible separation between AJAX features and server-side templates 5. fairly good object-oriented JavaScript - using proto-types and super-classes But I am personally not clear as to which framework is better in the long run. So I thought of getting your views in this regard. Please share your views/suggestions. Thanks. Kind Regards, Gene -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/L7lst2rEDJAJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
call java method with generics from jsni
hi all. Can I call a java instance method with generic parameters from jsni code ? In my case: public interface ArrayListCallbackT { boolean call(T item, int index); } /** ArrayList is my overlay */ public class ArrayListT extends JavaScriptObject extends JavaScriptObject { public native final ArrayListT each(ArrayListCallbackT c)/*-{ var f = $entry(function(item, index){ return c.@my.package.collection.ArrayListCallback::call(TT;I)(item, index); }); return this.each(f); }-*/; } my problem is with call() method calling (containing a generic type parameter). Eclipse editor autocompletes like that but it won't compile. So my question is is it possible to do that call? Thanks in advance. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/L15ozvBnu1MJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.