Re: How to override style?
Hi! Every GWT widget has its style. You should write style for .gwt-Hyperlink if you want to apply this rule for every Hyperlink widget in your application (Check this out http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/Hyperlink.html). .gwt-Hyperlink{ color: red; font-size: 12px; /*etc.*/ } In API documentation you can find for every widget which css rules are provided for specific widget. Best regards. Ray wrote: Hi,I have a CSS file which has something as follow: a { color: #77; font-size: 12px; text-decoration: none ; } .Login{ color:#FF } Now in my GWT application when I using widget Hyperlink like: Hyperlink link = new Hyperlink(); link.setText(Login); link.setStyleName(Login); that link will always using color of #77 not #FF. If CSS setting of a is necessary,how can I override it in my widget? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: How to Debug/Trace client side code when deploying Tomcat
Hi, As Martin pointed out you can use FireBug or Google Chrome inbuilt feature. But if you have problem debugging on different browser on your platform then I would suggest the build of OOPH is what is required. By using OOPHM you can debug your application on any browser of your choice. Building OOPHM is simple and it is listed on my blog http://allahbaksh.blogspot.com Regards, Allahbaksh Mohammedali Asadullah http://allahbaksh.blogspot.com On Feb 26, 2:26 pm, mars1412 martin.trum...@24act.at wrote: you could use firebug for firefox it will display the logmessages in the console also Iron (type of Chrome) has a java-script console where you can see the logs On Feb 25, 8:35 pm, joe young keven.c...@gmail.com wrote: I'm using NetBeans to develope my GWT applicaiotn. Everything works fine when i deploy to gwt-shell-hosted. However when I deploy to tomcat 6 with netbeans, many little problems occur. Such as. I have a TreePanel that display all the regions. When the TreePanel first create, it will call RPC to retreive data service.getGeoRootNode(new AsyncCallback() { public void onSuccess(Object result) { GeoNode rootNode = (GeoNode) result; rootTreeNode.setText(rootNode.getNodeDesc()); rootTreeNode.setIconCls(rootNode.getNodeName() + - icon); buildChildTreeNode(rootNode, rootTreeNode); // build the children nodes setRootNode(rootTreeNode); }}); However the tree building stop right after the rootNode is created. I cannot trace the code because GWT.log() cannot print to tomcat logging (I'm using log4J for server side logging) thus I don't know what happen Question1: How can we trace the client side code? Is it possible that ask GWT.log dump to log4J? Question 2: Is it because buildChildTreeNode(rootNode, rootTreeNode) is outside of onSuccess() so it cannot be run?? Thanks for your help in advance! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Clone() in GWT
Is it possible to use the method clone() on GWT Widgets or something equivalent? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Memory Leak with IE7
A Marker is a subclass of Overlay. I have an example in JavaScript attached to this issue: http://code.google.com/p/gmaps-api-issues/issues/detail?id=945 There is a GWT binding for the GMap2.removeOverlay() method on the MapWidget class. For future reference, many of the methods in the API have example code in the HelloMaps example, including removing a marker using removeOverlay(). On Thu, Feb 26, 2009 at 4:52 AM, koalina koalin...@gmail.com wrote: Matas, I've tried recompiling commenting the line in PopUpImplIE6 you suggest but with no luck :-( I've seen that declaring a vector of labeledMarker and then adding : labeledMarkerVector.add(new LabeledMarker(point, options)); removing : map.clearOverlays(); Iterator v = labeledMarkerVector.iterator (); while (v.hasNext()) { //250209Miki: rimuovo anche overlay singolarmente map.removeOverlay((LabeledMarker) v.next()); } //250209Miki: e poi svuoto vettore di appoggio labeledMarkerVector.clear(); is the same thing memory usage still increase. I notice that only with the vector, without any listener, memory doesn't increase... the leak seems to be here: ((LabeledMarker) labeledMarkerVector.lastElement()). addMarkerClickHandler(new MarkerClickHandler() { public void onClick(MarkerClickEvent event) { //050209Miki: gestisco qui il popup informativo InfoWindow info = map.getInfoWindow(); info.open(event.getSender(), new InfoWindowContent( div style='width:150px;height:65px; font-size:12px' + class='info-window'+ //pimg width='35px' src='+GWT.getModuleBaseURL() +'images/logonave.png' align='left'/p + etc ./div )); } }); is it a kwonwn issue? thx Michela On 26 Feb, 10:36, koalina koalin...@gmail.com wrote: Hi Matas, I've found this line in PopUpImplIE6..i don't call this object but perhaps it's called by InfoWindow in gwt google maps api... have i only to recompile gwt-user.jar or all the gwt and google maps jars? thx, have a nice day, Michela On 25 Feb, 16:43, Matas m.ramo...@gmail.com wrote: hi, Michela, I have similar problem (in different context) with gwt 1.5.3. and IE6/7memoryleaks. After some findings I found that leaking is caused by trasparency filter: style.filter = 'alpha(opacity=0)'; Try to remove transparency effects and then check formemoryleaks. Please, take a look at the issue for details:http://code.google.com/p/google-web-toolkit/issues/detail?id=2329q=p... -- Matas -- Eric Z. Ayers - GWT Team - Atlanta, GA USA http://code.google.com/webtoolkit/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: MVC + RPC architecture
I think this is what we get using GWT: |- Client --| |--- Server | Views and ControllersControllers for domain logic | Model ---| On the client side we've classes responsible for handling the user interaction, nothing beyond this. On the server side we've the system's logic, all the calculations, validations, and all other requirement are made here. And the model is shared between them. We still have the separation of concerns but with a smarter view (the client side) than the old full refresh. Regards, --- Felipe Marin Cypriano Vitória - ES http://www.linkedin.com/in/felipecypriano On Wed, Feb 25, 2009 at 12:22 PM, gregor greg.power...@googlemail.comwrote: Hi Reza, I think I made an unfortunate choice of words with dogma. I do not mean to diss MVC, what I really meant to convey was that there is an awfull lot more documentation around about MVC than there is about Model Delegate and the the use of the Observer and Mediator patterns in this context. You are quite right IMO that newbies should learn and apply well established patterns, but my point is that the MVC pattern has so much exposure that it is possibly unbalanced. I think part of the reason relates to your comment: And finally, I don't have anything against ModelDelegate, but I think you wouldn't use it in a jsp web site by putting all controllers code inside jsp. (which is possible and most newbies start coding this way) You definitely use a well established MVC framework. You are undeniably right about this: you should definitely use a MVC framework like struts for a JSP based application. The thing is, though, that JSP based applications are a perfect fit for the MVC pattern since each request from a view needs to be processed and redirected to the next view. A struts Action class, i.e. a controller, is perfect for this. MVC got a huge boost to its profile through struts and JSP Model 2. But a GWT AJAX application is a different animal. It is technically a thin client since it runs in a browser with no native executables or libraries required, but functionally it has a lot more in common with a traditional thick client - complex UI, no paging, asynchronous server calls, session state shifted from server to client etc. In a Java thick client, say Swing, you typically set a model graph directly on a widget, and the widget binds itself to it and controls user events and how they affect the model. In GWT it is similar to this, because events are propagated from the browser via the widgets themselves, so if you have separate controllers that need to know about events (which they do) it can become complicated and messy. This is exacerbated by the asynchronous RPC mechanism as Charles pointed out in the OP. If a widget itself is not coordinating the asynch call, but calls a method on a separate controller, you need another callback mechanism to relay the results back to the widget. There are situations where doing this is necessary. My favourite example is a work flow application where a work flow process may have many different views all of which are based on the same model graph for the process. In this case a MVC decomposition some thing like this makes sense: view / \ controller \ /\ \ / \ \ RPC\\ \ --- model IMO in many, if not most, situations that is over-engineering. However none of this answers the OP question really, nor does it answer your point that newbies should follow good practice based on known sound patterns. If not MVC then what exactly? To be sure the answer is not that well documented. The current GWT event system which is based pretty much on the Observer pattern. it works well in the simple case but has shortcomings when you scale in terms of complexity. It can get messy with dozens of different listener interfaces etc. I think the new event system coming in with 1.6 will make a big difference to this. My own response has been to experiment with the Mediator pattern as defined in the GoF book. I am pleased with the results so far. The GoF book actually uses a set of collaborating widgets as the example for Mediator. I use a mediator to coordinate events between colleague widgets (usually Composites) around a specific functional area. The Mediator only handles event subscription, publishing and routing. The Composites themselves are responsible for deciding what to do in response to a particular event. The main shortcoming of this approach I have found so far is if an event requires several Composites to refresh their data at once since this implies multiple concurrent RPC calls when one would be better. I'm still thinking about how to best deal
Portable project structure?
Hi, I am still new to GWT. Is there a guide on how I can make a project portable across different operating systems and setups? So far via the projectCreator / applicationCreator I see many of the generated artifacts are hard coded. For example the GWT installation directory in the scripts and in the eclipse files. My situation is this. I have been working on a project using ubuntu linux + eclipse. Now I want to bring other people in though they use either Windows or Linux but with different GWT setup. Dimitris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Is there a way of grep-ing for text in a search that meets teh TC?
What I want to do is have my website search for a term then find out how many pages contained that term. Its easy enough to do with php and curl but it isnt allowed by the google TC I dont need a page worth of search results a search bar etc all i need is the number of pages that contain the searched term. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
What are your thoughts on Cappuccino and SproutCore?
Cappuccino and SproutCore have been around for a while and they are really starting to make an impression on web developers. I've been using GWT in one project for 2 months, and I'm loving it. However I tried out Cappuccino, just to get the felling of it, and I was truly impressed. I was able to re-design the project's UI in Cappuccino in one week, and it seems to me that a lot of my server side code can be re-utilized if I use something like cp2javaws (haven't tried it). So, my question to you guys is how will GWT compete with Cappuccino or SproutCore, (and I'm not even mentioning JavaFX), and if you have anything planned to extend GWT capabilities of building really rich UIs just as easy as Cappuccino. Don't get me wrong, I'm a truly GWT lover. In my opinion GWT is superior in both performance and code security (minimization / obfuscation), but right now I'm really tempted to throw away 2 months of GWT work... Some pointers: http://280atlas.com/ (just announced, I recommend watching the video) http://cappuccino.org/ http://sourceforge.net/projects/cp2javaws/ http://www.carsonified.com/web-apps/why-objective-j-cappuccino-and-sproutcore-are-completely-changing-the-web-app-industry --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Translating on the server-side
1) GWT's i18n can't be used as is, since the interfaces are meant to be used at compile-time and the actual text from the properties files gets put into the js/html files. You could reuse the properties files though if you ship them with your war/ear file, and on the server side, just use old ResourceBoundle. 2) properties files are not limited to one-line messages. These are both valid entries: prop1 = first part of prop1 \ second part of prop1 \ third part of prop1 prop2 = first line of prop2 \n \ second line of prop2 \n \ third line of prop2 On Feb 25, 8:52 pm, jbdhl jbirksd...@gmail.com wrote: Consider a case where some RPCs in a GWT application will trigger the server to send an email to the user where the email should be sent in the language used at the requesting client. 1) How should I approach this server-side internationalization (i18n)? Can GWTs i18n be used in this situation? 2) The email will have multiple paragraphs of text, not just one-line messages as the property files are limited to (as far as I know). Similarly, our help-page and about-page have many large paragraphs of text. How can I translate these multi-line texts? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: how do i make image blink? [need HELP]
i see thanks! On Feb 26, 11:38 am, doopa niallhas...@googlemail.com wrote: Hello, This is 1995 we want our blink tag back. On Feb 25, 5:20 pm,ytbryanytbr...@gmail.com wrote: hi all, i am thinking of making my logo blink or maybe do something like thishttp://www.imafish.co.uk/articles/post/articles/130/52-ways-to-speed-... can someone advise me what to do ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Composites, Widgets, and polymorphism
Hi Gary, If you're doing compile time substitution (different interface for different clients, for example), I would highly recommend using Google GIN. I also use a programming to interfaces strategy. For interfaces that are widgets, the IsWidget interface is extended which has a getContainingWidget() method (implemented by the concrete classes). -- Arthur Kalmenson On Tue, Feb 24, 2009 at 10:57 PM, Gary S agilej...@earthlink.net wrote: I need to: 1. Add behavior and style to GWT widgets 2. Wrap them in Composites 3. Expose the widget behavior and style from the Composite impl class 4. Allow polymorphic substitution of widget impl classes I can do this, but it's ugly: 1. An abstract class extends Composite 2. An impl class has a reference to a widget and the abstract Composite and the impl have wrapper methods exposing some of the public widget methods. 3. In gwt.xml replaceWith elements replace the abstract class with the impl class 4. Instantiate with gwt.Create so future impls can be substituted. 5. Public init methods are necessary because gwt.Create requires a no arg Constructor. It's ugly because there is too much indirection, too many widget methods have to be proxy-ed, replaceWith xml breaks type safety, protected widget methods can't be called, and public init methods and GWT.create are more problematic than Constructors. Is there a clean(er) way to do this? Has anyone done something similar with Guice Gin provider methods? Gary S --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
NamedFrame/Frame and capturing events
Hi, I have an application which contains a central frame created using the NamedFrame class. Above and below the frame I have header and footer panels. In these panels I need to capture when a users clicks the mouse over the central NamedFrame. Unfortunately I cannot seem to find a way to do this. I was thinking of getting the NamedFrame Element and then adding an EventListener to this but haven;t managed to do so. Element e = (Element) FrameElement.as(DOM.getElementById (myId)).getContentDocument().getBody().cast(); DOM.setEventListener(e, new EventListener(){ public void onBrowserEvent(Event event) { Log.info(AHHAHA); } }); I know that the getContentDocument() will not return what I am looking for but I am wondering what I need to call in order to set this event listener from the footer/header panel for the NamedFrame panel. Any help is greatly appreciated. Thanks, Ale --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Client Properties
On 26 fév, 11:03, hovi hovi6...@gmail.com wrote: Hello, I have been using gwt for some time and I enjoy it a lot. What I couldn't find (and is propably very simple). Is how do I get value of some client property (for example locale in i18n -http://code.google.com/p/bunsenandbeaker/wiki/DevGuideSpecifyingLocale, This one is easy: LocaleInfo.getCurrentLocale().getLocaleName() log_level in gwt-log) in client? I do not use gwt-log but I guess Log.getCurrentLogLevel() ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
GWT on NetBeans 6.5 / gwt4nb
I am trying to migrate from eclipse to Netbeans as I felt 6.5 more compelling and the migration is definitely not an easy task. I am seeing lot of OutofMemory errors. I modified project.properties and used jvmargs=-Xmx512m for GWT compiler, shell. But It still breaks some place. Starting GlassFish V3 GlassFish V3 Start Failed C:\My Documents\NetBeansProjects\Nodal\ShadowSettlements\nbproject \build-gwt.xml:33: Deployment error: GlassFish V3 Start Failed See the server log for details. BUILD FAILED (total time: 2 minutes 4 The target in build.xml that breaks target name=debug description=Debug project in IDE. depends=init,compile,compile-jsps,-do-compile-single-jsp,dist if=netbeans.home nbdeploy debugmode=true clientUrlPart=${client.urlPart}/ antcall target=connect-debugger/ antcall target=debug-connect-gwt-shell/ /target Any suggestions would be greatly appreciated. Thanks -R --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Calling a Java method from handwritten JavaScript
On 26 fév, 13:13, Edgars edgars-matis...@inbox.lv wrote: Hello. I' am having problem with calling a Java method from handwritten JavaScript. Can anybody tell me, what means parameter IFI in code below. This code is from GWT developers guide. [...] public static int computeLoanInterest(int amt, float interestRate, int term) { ... } public static native void exportStaticMethod() /*-{ $wnd.computeLoanInterest = @mypackage.MyUtilityClass::computeLoanInterest(IFI); It's the JSNI signature (which looks much like JNI): I - int F - float http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5t=DevGuideJavaFromJavaScript From this same page, at the top: param-signature : is the internal Java method signature as specified here but without the trailing signature of the method return type since it is not needed to choose the overload where here links to http://java.sun.com/j2se/1.4.2/docs/guide/jni/spec/types.html#wp16432 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: GWT on NetBeans 6.5 / gwt4nb
Jason's blog did a good job: http://lemnik.wordpress.com/2008/07/27/fixing-compilation-in-gwt4nb/ Kevin On Thu, Feb 26, 2009 at 11:32 PM, Selfish Gene ravurib...@gmail.com wrote: I am trying to migrate from eclipse to Netbeans as I felt 6.5 more compelling and the migration is definitely not an easy task. I am seeing lot of OutofMemory errors. I modified project.properties and used jvmargs=-Xmx512m for GWT compiler, shell. But It still breaks some place. Starting GlassFish V3 GlassFish V3 Start Failed C:\My Documents\NetBeansProjects\Nodal\ShadowSettlements\nbproject \build-gwt.xml:33: Deployment error: GlassFish V3 Start Failed See the server log for details. BUILD FAILED (total time: 2 minutes 4 The target in build.xml that breaks target name=debug description=Debug project in IDE. depends=init,compile,compile-jsps,-do-compile-single-jsp,dist if=netbeans.home nbdeploy debugmode=true clientUrlPart=${client.urlPart}/ antcall target=connect-debugger/ antcall target=debug-connect-gwt-shell/ /target Any suggestions would be greatly appreciated. Thanks -R --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Help Related to GWT 1.6
As Bruce Johnson mentioned, the documentation comes with the 1.6 download. You can also find the online documentation here: http://code.google.com/docreader/#p=google-web-toolkit-doc-1-6s=google-web-toolkit-doc-1-6t=google-web-toolkit-doc-1-6 -- Arthur Kalmenson On Thu, Feb 26, 2009 at 2:06 AM, tapas...@gmail.com tapas...@gmail.com wrote: Hello, I believe , it's time to explore GWT 1.6 . But I am not so comfortable in creating project , compiling and launching hosted-mode with this version as there are many things got changed between 1.5 and 1.6 . Another difficulty is I have not found any documentation on 1.6. If anybody have experienced working on GWT 1.6 , please share your knowledge. Any documentation on this would be highly appreciated. Thnaks, -Tapas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: json date
The answer depends on whether you want the server to format the date or the client to. Send it as a JSONstring for the 1st case and as a JSONNumber for the latter. Send it as JSONNumber if you want the client (GWT) to be able to render the date as its local time. On Feb 25, 3:56 am, Lothar Kimmeringer j...@kimmeringer.de wrote: Dimitrijević Ivan schrieb: You can use sql99 standard (-MM-DD hh:mm:ss) to format date as string in php and write your parser which will convert sql99 date String into Date object in GWT. If the web-application is accessed internationally I think the format used with iCalendar (AFAIR) or XML is better: -MM-ddTHH:mm:ssZ Otherwise there might be confusions what 03:00:00 means, the timezone of the server or the timezone of the client. Or you define that all times have to be in UTC and you convert them accordingly on server- and client-side. Regards, Lothar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: GWT on NetBeans 6.5 / gwt4nb
You have to unjar GWT4NB to a directory. Modify build.xml in extracted directory, and then jar the whole package back. Reinstall your revised GWT4NB in NetBeans. Kevin On Fri, Feb 27, 2009 at 12:13 AM, Selfish Gene ravurib...@gmail.com wrote: Any changes to build.xml are overwritten by GWT4NB. Are there any entries I can add to gwt.properties that might help me solve this problem. On Feb 26, 9:37 am, Kevin Tarn kevn.t...@gmail.com wrote: Jason's blog did a good job: http://lemnik.wordpress.com/2008/07/27/fixing-compilation-in-gwt4nb/ Kevin On Thu, Feb 26, 2009 at 11:32 PM, Selfish Gene ravurib...@gmail.com wrote: I am trying to migrate from eclipse to Netbeans as I felt 6.5 more compelling and the migration is definitely not an easy task. I am seeing lot of OutofMemory errors. I modified project.properties and used jvmargs=-Xmx512m for GWT compiler, shell. But It still breaks some place. --- --- -- Starting GlassFish V3 GlassFish V3 Start Failed C:\My Documents\NetBeansProjects\Nodal\ShadowSettlements\nbproject \build-gwt.xml:33: Deployment error: GlassFish V3 Start Failed See the server log for details. BUILD FAILED (total time: 2 minutes 4 --- --- -- The target in build.xml that breaks --- --- -- target name=debug description=Debug project in IDE. depends=init,compile,compile-jsps,-do-compile-single-jsp,dist if=netbeans.home nbdeploy debugmode=true clientUrlPart=${client.urlPart}/ antcall target=connect-debugger/ antcall target=debug-connect-gwt-shell/ /target --- --- -- Any suggestions would be greatly appreciated. Thanks -R --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
ServletContextListener on gwt
Hello staff someone already used in the context of listeners or gwt gwt ext? Must create a listener to determine when the application is started. someone already used ServletContextListener with gwt? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
HowTo cancel a RPC call?
Hi folks, Recently i've found myself in a situation where i have to cancel a RPC call. I've found out that RequestBuilder.send() method returns a Request object that provides a cancel() method. But is it possible to get Request object without using RequestBuilder? I'm currently very comfortable with RPC (except for the above matter) and i'm reluctant to switch to RequestBuilder. Thx in advance for your help --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: HowTo cancel a RPC call?
sure, just return Request (or RequestBuilder, your option) from your async interface rather than void, and you are good to go. -jason On Feb 26, 2009, at 9:56 AM, alex.d wrote: Hi folks, Recently i've found myself in a situation where i have to cancel a RPC call. I've found out that RequestBuilder.send() method returns a Request object that provides a cancel() method. But is it possible to get Request object without using RequestBuilder? I'm currently very comfortable with RPC (except for the above matter) and i'm reluctant to switch to RequestBuilder. Thx in advance for your help --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Combox dynamic
Hello !!! I am creating dynamic ComboBox with bilioteca gwt-ext, in some cases need to fill the data again ComboBox. How to do it if I have only the name of the ComboBox? Example: for (int x=0;x= ncombobox.length();x++) { ComboBox cb = new ComboBox(); cb.setFieldLabel(ncombobox[x][1]); cb.setDisplayField(ncombobox[x][2]); } cb.setstore( ) ?? How to fill the combobox if I have only the name of the combobox? tks. Carlos --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Comparing equivalent UTF-8 characters across languages
Hi there, I'm writing an application in which I'd like to compare characters that exist in different languages. Specifically, I need String.contains(String s) to return true if one string contains characters _equivalent_ to another. For example: soñar.contains(on) should return true, recognising that the 'ñ' character is equivalent to 'n'. My database (MySQL) can do this automatically with the right configuration settings. I'm not sure if it's possible in Java. If so, is it supported by GWT? Thanks, Dirk --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: log4j for GWT
log4j is not available in GWT since it does use IO classes which are not present in the emulation library. But there's an alernative available under http://code.google.com/p/gwt-log/ Greetings Harald On 26 Feb., 16:15, Vinayak vnaidu...@gmail.com wrote: Hey, How to cnfigure log4j for GWT Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Comparing equivalent UTF-8 characters across languages
It seems that in order to do this using regular Java, I would use the java.text.Collator class: http://java.sun.com/j2se/1.5.0/docs/api/java/text/Collator.html So now my question becomes simpler, is this supported, or is there an equivalent in GWT? Thanks, Dirk On Feb 26, 4:59 pm, dirk australiandevelo...@gmail.com wrote: Hi there, I'm writing an application in which I'd like to compare characters that exist in different languages. Specifically, I need String.contains(String s) to return true if one string contains characters _equivalent_ to another. For example: soñar.contains(on) should return true, recognising that the 'ñ' character is equivalent to 'n'. My database (MySQL) can do this automatically with the right configuration settings. I'm not sure if it's possible in Java. If so, is it supported by GWT? Thanks, Dirk --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Comparing equivalent UTF-8 characters across languages
You should do that on ther server side of your app. You should Google soundex, I'm sure you will find plenty of material on how to do that. Freller On Feb 26, 6:14 pm, dirk australiandevelo...@gmail.com wrote: It seems that in order to do this using regular Java, I would use the java.text.Collator class:http://java.sun.com/j2se/1.5.0/docs/api/java/text/Collator.html So now my question becomes simpler, is this supported, or is there an equivalent in GWT? Thanks, Dirk On Feb 26, 4:59 pm, dirk australiandevelo...@gmail.com wrote: Hi there, I'm writing an application in which I'd like to compare characters that exist in different languages. Specifically, I need String.contains(String s) to return true if one string contains characters _equivalent_ to another. For example: soñar.contains(on) should return true, recognising that the 'ñ' character is equivalent to 'n'. My database (MySQL) can do this automatically with the right configuration settings. I'm not sure if it's possible in Java. If so, is it supported by GWT? Thanks, Dirk --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Listener Collection and ConcurrentModificationException
On 26 fév, 19:36, cristian.vrabie cristian.vra...@gmail.com wrote: I noticed that if you try to alter the list of a widgets listeners in the listener implementing method, you get java.util.ConcurrentModificationException: null. See http://code.google.com/p/google-web-toolkit/issues/detail?id=262 and http://code.google.com/p/google-web-toolkit/issues/detail?id=3324#c3 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Two TabPanels, different CSS styles
Is there a way to have different css styles for two of the same GWT composite types (i.e. TabPanels) in the same document? I have two TabPanels and I want one TabPanel to have larger tabs... Thanks, -ms --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
RE: Two TabPanels, different CSS styles
I belive you can do it.. Use the different style name , it will work Regards, AR -Original Message- From: Google-Web-Toolkit@googlegroups.com [mailto:google-web-tool...@googlegroups.com] On Behalf Of Master Shake Sent: Friday, February 27, 2009 8:18 AM To: Google Web Toolkit Subject: Two TabPanels, different CSS styles Is there a way to have different css styles for two of the same GWT composite types (i.e. TabPanels) in the same document? I have two TabPanels and I want one TabPanel to have larger tabs... Thanks, -ms --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: How to structure complier generated resources in customized directories
Yes that is possible, You can group all your images into a directory during your dev time resource it accordingly in ur build css files. You can even group all the nocache.js cashe.js files into a separate directory link that to the root html file by specifying the root in the meta tag. Something like this if your GWT Module is com.company.app.MyApp, the default meta tag in /index.html would be: meta name=gwt:module content=com.company.app.MyApp/ To instruct GWT to load files from the /gwt-files/ path instead of the root (/) path, use an alternate form of the content attribute meta name=gwt:module content=gwt-files=com.company.app.MyApp/ I hope this helps. On Thu, Feb 26, 2009 at 3:49 PM, tapas...@gmail.com tapas...@gmail.comwrote: Hello All, In 1.5 , Once the GWT compiler compiles the code it generates lots of .js ,.png,.html,.rpc,.gif etc files and dump all these resources in a directory. In 1.6 , the fantastic war mechanism has come but still the compiled resources are dumped under the wer directory and all are together. Is there any configurable option to structure the related files together like , all .js files in a directory say javascript , all .pngs are in images directory etc .. Any thoughts ? Thanks, -tapas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Does not work on Firefox
still it doesn't work. On Feb 26, 4:22 am, Felipe Cypriano fmcypri...@gmail.com wrote: Maybe the compiler is set to just one browser, take a look at this:http://vinaytech.wordpress.com/2008/11/10/gwt-compiler-compiling-for-... Regards, --- Felipe Marin Cypriano Vitória - EShttp://www.linkedin.com/in/felipecypriano On Thu, Feb 26, 2009 at 12:52 AM, Mallesh mallesh.kand...@gmail.com wrote: Hi Tuvok, thanks for the reply. i complied the code and using the the link from www \com.MyProject.StockWatcher\ folder. the same link works fine on IE but not on FF/chrome. more over ,www\com.MyProject.StockWatcher\gwt\standard\images folder contains only one sub folder named ie6, there was no other folders(i am not sure weather it should crate a separate folders for FF or not). On Feb 24, 10:03 am, Tuvok davidfreg...@gmail.com wrote: Maybe you're just copying the url from the development shell instead of compiling? On Feb 24, 6:54 pm, Mallesh mallesh.kand...@gmail.com wrote: Hi all, i have been playing with the gwt sample(http://code.google.com/ docreader/#p=google-web-toolkit-doc-1-5s=google-web-toolkit- doc-1-5t=GettingStartedBasics) provided on the web site. it works fine on IE6, surprising it does not work on FF 3.0.6 and chrome. am i doing something wrong ? or do i need to do anything extra to run the same app on other browsers any suggestion would be appreciated ~Mallesh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: GWT on NetBeans 6.5 / gwt4nb
Heya, Just a heads-up. I change the build.xml in the project root directory, NOT the build-impl or build-gwt files, that way GWT4NB never overwrites the changes. I'm busy working to get this patch merged into the GWT4NB project. If your normal build.xml is being overwritten, something is wrong. ;) Cheers, Jason. Kevin Tarn wrote: You have to unjar GWT4NB to a directory. Modify build.xml in extracted directory, and then jar the whole package back. Reinstall your revised GWT4NB in NetBeans. Kevin On Fri, Feb 27, 2009 at 12:13 AM, Selfish Gene ravurib...@gmail.com mailto:ravurib...@gmail.com wrote: Any changes to build.xml are overwritten by GWT4NB. Are there any entries I can add to gwt.properties that might help me solve this problem. On Feb 26, 9:37 am, Kevin Tarn kevn.t...@gmail.com mailto:kevn.t...@gmail.com wrote: Jason's blog did a good job:http://lemnik.wordpress.com/2008/07/27/fixing-compilation-in-gwt4nb/ Kevin On Thu, Feb 26, 2009 at 11:32 PM, Selfish Gene ravurib...@gmail.com mailto:ravurib...@gmail.com wrote: I am trying to migrate from eclipse to Netbeans as I felt 6.5 more compelling and the migration is definitely not an easy task. I am seeing lot of OutofMemory errors. I modified project.properties and used jvmargs=-Xmx512m for GWT compiler, shell. But It still breaks some place. --- --- -- Starting GlassFish V3 GlassFish V3 Start Failed C:\My Documents\NetBeansProjects\Nodal\ShadowSettlements\nbproject \build-gwt.xml:33: Deployment error: GlassFish V3 Start Failed See the server log for details. BUILD FAILED (total time: 2 minutes 4 --- --- -- The target in build.xml that breaks --- --- -- target name=debug description=Debug project in IDE. depends=init,compile,compile-jsps,-do-compile-single-jsp,dist if=netbeans.home nbdeploy debugmode=true clientUrlPart=${client.urlPart}/ antcall target=connect-debugger/ antcall target=debug-connect-gwt-shell/ /target --- --- -- Any suggestions would be greatly appreciated. Thanks -R --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: FF vs IE, when dealing with Lists
I have another solution for this problem.Into a Vertical panel inserted horisontal panel formatted it with css, and it is faster.. 2009/2/19 milind mpaltanw...@gmail.com Hi Nick, Flex table is pretty slow if you want to display 50+ rows in it at a time based on our experience. The slowness also varies for each browser, only realistic way of getting around this problem is to implement pagination, where you display only 20-30 rows on each page and then provide links on the header to navigate through the pages. This way i am able to manage a display of thousands of records in less than 500 milliseconds across the browsers (FF and chrome faster then IE). The application has many views with this approach displaying simple tabluar data and also hierarchical data structures. For displaying hierarchical data structures i initially went with Tree, but that was pretty slow for large no. of rows, so i simulated tree inside FlexTable using Click listener on (+/-) images. This works like a charm. Regards, Milind On Feb 18, 4:21 pm, Nick nickc...@gmail.com wrote: Ok, Results What I’m finding is that the Grid does beat the FlexTable, but not by much with a small data set. Larger sets seem to widen the gap. My guess for this is that since FlexTable has the ability to add rows (Grid is sized from the start) that it works much like how other resizable constructs work such as Java’s ArrayList. My reasoning for this is that the first time the test is run the speed is very slow on the FlexTable (especially in IE). Repeated test runs after the initial are faster and I think this is because the table was being sized the first time as rows were added, and didn’t need to be resized during the following tests. The other thing I’m finding is that performace varies based on browser. I’m seeing FF run reasonably well. With IE the Grid runs about the same as FF but the FlexTable runs considerably slower. I also tested Opera and was stunned as it blew both others out of the water. My full write up is here with times and a test application you can run in your browser. http://whatwouldnickdo.com/wordpress/401/performance-grid-vs-flextable/ On Feb 18, 2:10 pm, Nick nickc...@gmail.com wrote: Thanks for the response, I think you're correct. And it makes sense that adding rows dynamically would account for the increase in time as the row count is higher. I'm going to run a few tests, and I'll post anything I find to this post. On Feb 18, 3:09 am, Alexey_Tsiunchik alexey.tsiunc...@gmail.com wrote: Hello Nick, Exactly the same issue was in our app. We need to display big lists (100 - 500) records, and FlexTable seems not solution for this. The problem is that FlexTable always checks table bounds (row number, column number) and when you put some value in FlexTable it performs checking for bounds, moreover it not store the colnum and rownum in some variables, but always calculate them dynamically. Moreover it dynamocally adds new rows. Thats why it becomes slower when number of rows increase. We had decided to use Grid rather then FlexTable. We can specify Grid bounds right after creation, and while we put data in cells in the cycle its performance remains the same for different grid size (here I mean speed of adding row). But it also has it's disadvantages. When we need to display another data in the same Grid, and this data has different number of rows, we should call Grod.resize(int, int). And for big grids, this operation is very slow in IE (in our tests resizing grid with 200 rows, 5 columns, takes ~13000 ms in IE). So It seems paging here the only solution. Tuesday, February 17, 2009, 6:40:51 PM, you wrote: Ok, I did some more testing and I was wrong. It's not the inserting and removing from lists that are the bottleneck. I moved the time and log statements around and it had to do with adding to the FlexTable itself. I'm using code like: int row = 1; for (IteratorMyData iter = eventList.iterator(); iter.hasNext(); row+ +) { long sysTime = System.currentTimeMillis(); int column = 0; MyData event = (MyData)iter.next(); table.setText(row, column, event.getNameLast()); column++; table.setText(row, column, event.getNameFirst()); column++; table.setText(row, column, event.getJob()); column++; GWT.log(update time 4: +(System.currentTimeMillis()-sysTime)+ms , null); } Now, you can see I'm logging the time after every row is inserted. The odd thing I'm seeing is that the time per row increase as rows are traversed. For example, row 1 takes about 30ms but as the rows traverse by row 100 each row is taking about 150ms. It's a steady increase. Any insights? -- Best regards,
Re: Translating on the server-side
Hi, Concerning the first question, the solution is simple. I developed a tool class to use on server side. The class GWTI18N permits to obtain dynamically an implementation of the XXXMessage interface (sub interface of gwt Message interface). Here is a link to the class : http://code.google.com/p/gwt-fusionchart/source/browse/trunk/fusionchart_server/src/com/raisepartner/chartfusion/web/server/gwti18n/GWTI18N.java To use it you have to put the i18n interfaces and properties files in your classpath whereas in your code you simple call GWTI18N.create(TotoMessages.class); This class is based on the use of the annotation com.google.gwt.i18n.client.LocalizableResource.Key on methods. This class could be improved to support plural mode. About the second question I think you could use html tag in order to structure your message in several paragraphs. This means your email will be write in HTML, not a simple text. Regards, Seb On 26 fév, 02:52, jbdhl jbirksd...@gmail.com wrote: Consider a case where some RPCs in a GWT application will trigger the server to send an email to the user where the email should be sent in the language used at the requesting client. 1) How should I approach this server-side internationalization (i18n)? Can GWTs i18n be used in this situation? 2) The email will have multiple paragraphs of text, not just one-line messages as the property files are limited to (as far as I know). Similarly, our help-page and about-page have many large paragraphs of text. How can I translate these multi-line texts? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Calling a Java method from handwritten JavaScript
Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
GWT Session
Hello Friends, I was making a simple code of Session for my students. Well, I decided post that code here, because maybe it can serve as a basis for someone. //Main Class package com.javaneses.spring.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.Cookies; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.rpc.ServiceDefTarget; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.ClickListener; import com.google.gwt.user.client.ui.DialogBox; import com.google.gwt.user.client.ui.FlexTable; import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.PasswordTextBox; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.TextBox; import com.google.gwt.user.client.ui.Widget; import com.javaneses.spring.client.rpc.service.LoginService; import com.javaneses.spring.client.rpc.service.LoginServiceAsync; import com.javaneses.spring.client.rpc.service.SessionService; import com.javaneses.spring.client.rpc.service.SessionServiceAsync; /** * Entry point classes define codeonModuleLoad()/code. */ public class Main implements EntryPoint, ClickListener{ /** * This is the entry point method. */ private final SessionId sessionId = new SessionId(); private final DialogBox dialogBox = new DialogBox(); private final Label userLabel = new Label(User); private final Label passwdLabel = new Label(Password); private final TextBox userField = new TextBox(); private final PasswordTextBox passwdField = new PasswordTextBox(); private final Button login = new Button(Login); private final Label welcome = new Label(Welcome); private final User user = new User(); { FlexTable flexTable = new FlexTable(); flexTable.setWidget(0, 0, userLabel); flexTable.setWidget(0, 1, userField); flexTable.setWidget(1, 0, passwdLabel); flexTable.setWidget(1, 1, passwdField); FlowPanel panel = new FlowPanel(); panel.setWidth(100); panel.add(login); flexTable.setWidget(2, 1, panel); dialogBox.setSize(350, 150); dialogBox.add(flexTable); login.addClickListener(this); sessionId.setSessionId(Cookies.getCookie(session)); }//end init block public void onModuleLoad() { validateSession(); }//end onModuleLoad private void validateSession(){ SessionServiceAsync myServiceAsync = (SessionServiceAsync)GWT.create (SessionService.class); ServiceDefTarget serviceDefTarget = (ServiceDefTarget) myServiceAsync; serviceDefTarget.setServiceEntryPoint(session); AsyncCallbackSessionId asyncCallback = new AsyncCallbackSessionId (){ public void onFailure(Throwable caught) { System.out.println(caught); }//end onFailure public void onSuccess(SessionId result) { if(result == null){ RootPanel.get().clear(); RootPanel.get().add(dialogBox); System.out.println(Teste1); }else if(!sessionId.getSessionId().equals(result.getSessionId())){ RootPanel.get().clear(); RootPanel.get().add(dialogBox); System.out.println(Teste2); }else if(sessionId.getSessionId().equals(result.getSessionId())){ RootPanel.get().add(welcome); } }//end onSucess };//end AsyncCallbackString asyncCallback = new AsyncCallbackString() myServiceAsync.session(sessionId, asyncCallback); }//end validateSession public void onClick(Widget sender) { if(sender == login){ user.setUser(userField.getText()); user.setPasswd(passwdField.getText()); LoginServiceAsync loginServiceAsync = (LoginServiceAsync)GWT.create (LoginService.class); ServiceDefTarget serviceDefTarget = (ServiceDefTarget) loginServiceAsync; serviceDefTarget.setServiceEntryPoint(login); AsyncCallbackString asyncCallback = new AsyncCallbackString() { public void onSuccess(String
Error in Application
Hello, Actually I have developed an Application integrating GWT+Spring +Hibernate in the Hosted mode , with the help of the below given links by you - Part One :http://eggsylife.blogspot.com/2007/10/well-this-tutorial- aims-at-helping.html Part Two: http://eggsylife.blogspot.com/2007/11/hibernate-spring-google-web-toolkit.html Part Three: http://eggsylife.blogspot.com/2008/02/hibernate-spring-google-web-toolkit.html Now I am getting many warnings in this application, but the warning I am unable to solve is : [WARN]StandardContext[]Exception while dispatching incoming RPC call com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.util.List com.company.client.rpc.TeacherService.getPupils(java.lang.Integer)' threw an unexpected exception: java.lang.NoClassDefFoundError: org/ springframework/context/ApplicationContext at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure (RPC.java:360) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse (RPC.java:546) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall (RemoteServiceServlet.java:164) at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost (RemoteServiceServlet.java:86) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at com.google.gwt.dev.shell.GWTShellServlet.service (GWTShellServlet.java:289) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal (StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java: 929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java: 160) at org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:799) at org.apache.coyote.http11.Http11Protocol $Http11ConnectionHandler.processConnection(Http11Protocol.java:705) at org.apache.tomcat.util.net.TcpWorkerThread.runIt (PoolTcpEndpoint.java:577) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run (ThreadPool.java:683) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ ApplicationContext at com.company.server.gwt.TeacherServiceImpl.getPupils (TeacherServiceImpl.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse (RPC.java:527) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall (RemoteServiceServlet.java:164) at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost (RemoteServiceServlet.java:86) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at com.google.gwt.dev.shell.GWTShellServlet.service (GWTShellServlet.java:289) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:237) at
Error in Application
Hello, Actually I have developed an Application integrating GWT+Spring +Hibernate in the Hosted mode , with the help of the below given links by you - Part One :http://eggsylife.blogspot.com/2007/10/well-this-tutorial- aims-at-helping.html Part Two: http://eggsylife.blogspot.com/2007/11/hibernate-spring-google-web-toolkit.html Part Three: http://eggsylife.blogspot.com/2008/02/hibernate-spring-google-web-toolkit.html Now I am getting many warnings in this application, but the warning I am unable to solve is : [WARN]StandardContext[]Exception while dispatching incoming RPC call com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.util.List com.company.client.rpc.TeacherService.getPupils(java.lang.Integer)' threw an unexpected exception: java.lang.NoClassDefFoundError: org/ springframework/context/ApplicationContext at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure (RPC.java:360) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse (RPC.java:546) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall (RemoteServiceServlet.java:164) at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost (RemoteServiceServlet.java:86) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at com.google.gwt.dev.shell.GWTShellServlet.service (GWTShellServlet.java:289) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal (StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java: 929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java: 160) at org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:799) at org.apache.coyote.http11.Http11Protocol $Http11ConnectionHandler.processConnection(Http11Protocol.java:705) at org.apache.tomcat.util.net.TcpWorkerThread.runIt (PoolTcpEndpoint.java:577) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run (ThreadPool.java:683) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ ApplicationContext at com.company.server.gwt.TeacherServiceImpl.getPupils (TeacherServiceImpl.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse (RPC.java:527) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall (RemoteServiceServlet.java:164) at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost (RemoteServiceServlet.java:86) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at com.google.gwt.dev.shell.GWTShellServlet.service (GWTShellServlet.java:289) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:237) at
Re: FF vs IE, when dealing with Lists
+1 for the custom hp solution for the best performance at all i suggest a flow panel with inside a list of flowPanels anc custom css styles On 27 Feb, 06:48, Tóth Imre tothi...@gmail.com wrote: I have another solution for this problem.Into a Vertical panel inserted horisontal panel formatted it with css, and it is faster.. 2009/2/19 milind mpaltanw...@gmail.com Hi Nick, Flex table is pretty slow if you want to display 50+ rows in it at a time based on our experience. The slowness also varies for each browser, only realistic way of getting around this problem is to implement pagination, where you display only 20-30 rows on each page and then provide links on the header to navigate through the pages. This way i am able to manage a display of thousands of records in less than 500 milliseconds across the browsers (FF and chrome faster then IE). The application has many views with this approach displaying simple tabluar data and also hierarchical data structures. For displaying hierarchical data structures i initially went with Tree, but that was pretty slow for large no. of rows, so i simulated tree inside FlexTable using Click listener on (+/-) images. This works like a charm. Regards, Milind On Feb 18, 4:21 pm, Nick nickc...@gmail.com wrote: Ok, Results What I’m finding is that the Grid does beat the FlexTable, but not by much with a small data set. Larger sets seem to widen the gap. My guess for this is that since FlexTable has the ability to add rows (Grid is sized from the start) that it works much like how other resizable constructs work such as Java’s ArrayList. My reasoning for this is that the first time the test is run the speed is very slow on the FlexTable (especially in IE). Repeated test runs after the initial are faster and I think this is because the table was being sized the first time as rows were added, and didn’t need to be resized during the following tests. The other thing I’m finding is that performace varies based on browser. I’m seeing FF run reasonably well. With IE the Grid runs about the same as FF but the FlexTable runs considerably slower. I also tested Opera and was stunned as it blew both others out of the water. My full write up is here with times and a test application you can run in your browser. http://whatwouldnickdo.com/wordpress/401/performance-grid-vs-flextable/ On Feb 18, 2:10 pm, Nick nickc...@gmail.com wrote: Thanks for the response, I think you're correct. And it makes sense that adding rows dynamically would account for the increase in time as the row count is higher. I'm going to run a few tests, and I'll post anything I find to this post. On Feb 18, 3:09 am, Alexey_Tsiunchik alexey.tsiunc...@gmail.com wrote: Hello Nick, Exactly the same issue was in our app. We need to display big lists (100 - 500) records, and FlexTable seems not solution for this. The problem is that FlexTable always checks table bounds (row number, column number) and when you put some value in FlexTable it performs checking for bounds, moreover it not store the colnum and rownum in some variables, but always calculate them dynamically. Moreover it dynamocally adds new rows. Thats why it becomes slower when number of rows increase. We had decided to use Grid rather then FlexTable. We can specify Grid bounds right after creation, and while we put data in cells in the cycle its performance remains the same for different grid size (here I mean speed of adding row). But it also has it's disadvantages. When we need to display another data in the same Grid, and this data has different number of rows, we should call Grod.resize(int, int). And for big grids, this operation is very slow in IE (in our tests resizing grid with 200 rows, 5 columns, takes ~13000 ms in IE). So It seems paging here the only solution. Tuesday, February 17, 2009, 6:40:51 PM, you wrote: Ok, I did some more testing and I was wrong. It's not the inserting and removing from lists that are the bottleneck. I moved the time and log statements around and it had to do with adding to the FlexTable itself. I'm using code like: int row = 1; for (IteratorMyData iter = eventList.iterator(); iter.hasNext(); row+ +) { long sysTime = System.currentTimeMillis(); int column = 0; MyData event = (MyData)iter.next(); table.setText(row, column, event.getNameLast()); column++; table.setText(row, column, event.getNameFirst()); column++; table.setText(row, column, event.getJob()); column++; GWT.log(update time 4: +(System.currentTimeMillis()-sysTime)+ms , null); } Now, you can see I'm logging the time after every row is inserted. The odd
[gwt-contrib] Re: Classloader issue running Hosted mode from Eclipse with Maven managed dependencies
I've found an (ugly ?) workaround by adding xercesImpl in the bootstrap classpath and setting the javax.xml.parsers.SAXParserFactory system property. With this config the plugin can assume the SAX parser to be used in hosted mode - not very pleasant as the user can't configure it's own, but fixes the hosted mode lauch issue. Another question about configuring jetty : it expects a web.xml to define the RPC servlets. Many of us will use some more complex server side setup, for example including Spring and Hibernate, DataSources configuration, ... etc Running such complex server side components with hosted mode is easy with noserver, as we can setup the adequate servlet container. But with hosted mode jetty I fall into classloaders issues (jetty expect my libs to be in WEB-INF/lib, but they are set in eclipse launch classpath) The simpliest fix could be to have a dedicated web.xml file for jetty and hosted mode using mock-servlet RPC implementations. This is possible with 1.5 as the module servlet element is not used after compilation into a webapp. Any suggestion of a best-practice ? Any way to configure jetty to use an alternate web.xml ? Cheers, Nicolas On Wed, Feb 25, 2009 at 6:21 PM, Sami Jaber sami.ja...@gmail.com wrote: This is a very important issue. To resolve it, we had to code a custom servlet container launcher, this way : ***/** * Ensures that only Jetty and other server classes can be loaded into the * {...@link WebAppClassLoader}. This forces the user to put any necessary * dependencies into WEB-INF/lib. */* *private* *final* ClassLoader parentClassLoader = *new* ClassLoader(* null*) { *private* *final* ClassLoader delegateTo = Thread.*currentThread* ().getContextClassLoader(); @Override *protected* Class? findClass(String name) *throws* ClassNotFoundException { *if* (webAppClassLoader != *null (webAppClassLoader.isServerPath(name) || webAppClassLoader.isSystemPath(name))) { return delegateTo.loadClass(name); } throw new ClassNotFoundException(); } };* Works with -server MyCustomJettyLauncher This is not very smooth, but that works. Scott, maven is widely used by many folks out there, constraining ressources to be loaded from WEB-INF/lib doesn't make sense in Dev mode. Especially when you have many classes. The hosted mode should be able to use the classes passed from the command line by the Eclipse Maven plugin (kind of -cp %maven_classes%). Sami On Wed, Feb 25, 2009 at 6:04 PM, Scott Blum sco...@google.com wrote: I take your point. In the general case, server side dependencies need to be copied into WEB-INF/lib. Otherwise, the server code won't be able to access it. I can see how an XML parser might be a special case where the servlet container could be reasonably expected to provide it. Toby, do you have any thoughts on this? I think you're familiar with the pattern we're using of isolating Jetty from the system classpath to enforce the rule that server deps have to go into WEB-INF/lib (as opposed to just being on the system classpath). How are things like XML parsers generally treated? Should we special-case this? Thanks, Scott On Wed, Feb 25, 2009 at 11:52 AM, nicolas de loof nicolas.del...@gmail.com wrote: As I said my application has many other libs, including xerces (and spring, hibernate, aspectJ ...) so there is MANY reason for me to have another SAX parser in my classpath. The issue here is that in my case I can manually put the parser in web-inf/lib, but the maven plugin is expected to automagically configure the project, and has no simple way to detect what is the SAX parser used when running the project. Another option (that works) is to force use of the default SAX parser using -Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl JVM option, but this has the side effect to require the SUN JVM. What about Jrockit fans ? Nicolas On Wed, Feb 25, 2009 at 5:46 PM, Scott Blum sco...@google.com wrote: I've seen this before. The workaround is to put a copy of Xerces into your WEB-INF/lib. What's weird is that on my system, the default SAX parser factory is in the com.sun.* namespace, which lives in the bootstrap ClassLoader and works fine. I wonder why your default SAX parser factory is pointing at the raw org.apache version, which lives in gwt-dev and isn't on the bootstrap loader? We could always put an explicit pass-through in WebAppContextWithReload to allow this package. Can you file an issue and write back on this thread with a link to it? On Wed, Feb 25, 2009 at 11:24 AM, nicolas de loof nicolas.del...@gmail.com wrote: Hi I'm testing the Eclipse lauch configuration generated by the gwt-maven-plugin for gwt 1.6. My webapp project has many dependencies managed as an Eclipse classpath-container (thanks to m2eclipse
[gwt-contrib] Re: Classloader issue running Hosted mode from Eclipse with Maven managed dependencies
To make things a little clearer, here is how I understand the way classloader are built by Hosted mode : bootClasspath gwt-dev |_ HostedMode |_ Hosted Browser | |_ Jetty Embedded |_ WebApplicationClassLoader WEB-INF/lib/* How does Jetty access project (service-side classes) ? The maven way to run Hosted Mode would be : bootClasspath |_ Maven laucher UrlClassLoader : full project classpath (sources, classes and libs) |_ HostedMode |_ Hosted Browser | |_ Jetty Embedded |_ WebApplicationClassLoader WEB-INF/lib/ is empty As the Maven Laucher can setup any argument / system variable that may be required, is there any way to configure the way Ebedded Jetty search for web application libs classes ? Another option would be for the plugin to prepare the WEB-INF/lib with project libs - code doing this allready exists - but with more impact on Hosted mode launch speed. Cheers, Nicolas On Thu, Feb 26, 2009 at 11:59 AM, nicolas de loof nicolas.del...@gmail.comwrote: I've found an (ugly ?) workaround by adding xercesImpl in the bootstrap classpath and setting the javax.xml.parsers.SAXParserFactory system property. With this config the plugin can assume the SAX parser to be used in hosted mode - not very pleasant as the user can't configure it's own, but fixes the hosted mode lauch issue. Another question about configuring jetty : it expects a web.xml to define the RPC servlets. Many of us will use some more complex server side setup, for example including Spring and Hibernate, DataSources configuration, ... etc Running such complex server side components with hosted mode is easy with noserver, as we can setup the adequate servlet container. But with hosted mode jetty I fall into classloaders issues (jetty expect my libs to be in WEB-INF/lib, but they are set in eclipse launch classpath) The simpliest fix could be to have a dedicated web.xml file for jetty and hosted mode using mock-servlet RPC implementations. This is possible with 1.5 as the module servlet element is not used after compilation into a webapp. Any suggestion of a best-practice ? Any way to configure jetty to use an alternate web.xml ? Cheers, Nicolas On Wed, Feb 25, 2009 at 6:21 PM, Sami Jaber sami.ja...@gmail.com wrote: This is a very important issue. To resolve it, we had to code a custom servlet container launcher, this way : ***/** * Ensures that only Jetty and other server classes can be loaded into the * {...@link WebAppClassLoader}. This forces the user to put any necessary * dependencies into WEB-INF/lib. */* *private* *final* ClassLoader parentClassLoader = *new* ClassLoader(* null*) { *private* *final* ClassLoader delegateTo = Thread.*currentThread* ().getContextClassLoader(); @Override *protected* Class? findClass(String name) *throws* ClassNotFoundException { *if* (webAppClassLoader != *null (webAppClassLoader.isServerPath(name) || webAppClassLoader.isSystemPath(name))) { return delegateTo.loadClass(name); } throw new ClassNotFoundException(); } };* Works with -server MyCustomJettyLauncher This is not very smooth, but that works. Scott, maven is widely used by many folks out there, constraining ressources to be loaded from WEB-INF/lib doesn't make sense in Dev mode. Especially when you have many classes. The hosted mode should be able to use the classes passed from the command line by the Eclipse Maven plugin (kind of -cp %maven_classes%). Sami On Wed, Feb 25, 2009 at 6:04 PM, Scott Blum sco...@google.com wrote: I take your point. In the general case, server side dependencies need to be copied into WEB-INF/lib. Otherwise, the server code won't be able to access it. I can see how an XML parser might be a special case where the servlet container could be reasonably expected to provide it. Toby, do you have any thoughts on this? I think you're familiar with the pattern we're using of isolating Jetty from the system classpath to enforce the rule that server deps have to go into WEB-INF/lib (as opposed to just being on the system classpath). How are things like XML parsers generally treated? Should we special-case this? Thanks, Scott On Wed, Feb 25, 2009 at 11:52 AM, nicolas de loof nicolas.del...@gmail.com wrote: As I said my application has many other libs, including xerces (and spring, hibernate, aspectJ ...) so there is MANY reason for me to have another SAX parser in my classpath. The issue here is that in my case I can manually put the parser in web-inf/lib, but the maven plugin is expected to automagically configure the project, and has no simple way to detect what is the SAX parser used when running the project. Another option (that works) is to force use of the default SAX
[gwt-contrib] Re: Fix javadoc in MenuItem
LGTM On Wed, Feb 25, 2009 at 7:36 PM, rj...@google.com wrote: Reviewers: bruce, Description: GWT issue 434 Please review this at http://gwt-code-reviews.appspot.com/7803 Affected files: user/src/com/google/gwt/user/client/ui/MenuItem.java Index: user/src/com/google/gwt/user/client/ui/MenuItem.java === --- user/src/com/google/gwt/user/client/ui/MenuItem.java(revision 4874) +++ user/src/com/google/gwt/user/client/ui/MenuItem.java(working copy) @@ -19,7 +19,7 @@ import com.google.gwt.user.client.DOM; /** - * A widget that can be placed in a + * An entry in a * {...@link com.google.gwt.user.client.ui.MenuBar}. Menu items can either fire a * {...@link com.google.gwt.user.client.Command} when they are clicked, or open a * cascading sub-menu. --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Classloader issue running Hosted mode from Eclipse with Maven managed dependencies
I tested the create exploded webapp structure in maven plugin before creating lauch configurations strategy. I can launch the hosted browser but this has serious productivity cost : The /lib folder is not supposed to change often, so this is not an issue to poulate it from maven dependencies. The issue is with the (server-side) classes that I had to copy to /WEB-INF/classes. This must be done before every restart of the Hosted Browser when any Java file has been changed to sync sources and classes executed inside Jetty. As maven (or Eclipse + m2eclipse) compile to target/classes I'd prefer to avoid such costy setup. Nicolas On Thu, Feb 26, 2009 at 2:38 PM, nicolas de loof nicolas.del...@gmail.comwrote: To make things a little clearer, here is how I understand the way classloader are built by Hosted mode : bootClasspath gwt-dev |_ HostedMode |_ Hosted Browser | |_ Jetty Embedded |_ WebApplicationClassLoader WEB-INF/lib/* How does Jetty access project (service-side classes) ? The maven way to run Hosted Mode would be : bootClasspath |_ Maven laucher UrlClassLoader : full project classpath (sources, classes and libs) |_ HostedMode |_ Hosted Browser | |_ Jetty Embedded |_ WebApplicationClassLoader WEB-INF/lib/ is empty As the Maven Laucher can setup any argument / system variable that may be required, is there any way to configure the way Ebedded Jetty search for web application libs classes ? Another option would be for the plugin to prepare the WEB-INF/lib with project libs - code doing this allready exists - but with more impact on Hosted mode launch speed. Cheers, Nicolas On Thu, Feb 26, 2009 at 11:59 AM, nicolas de loof nicolas.del...@gmail.com wrote: I've found an (ugly ?) workaround by adding xercesImpl in the bootstrap classpath and setting the javax.xml.parsers.SAXParserFactory system property. With this config the plugin can assume the SAX parser to be used in hosted mode - not very pleasant as the user can't configure it's own, but fixes the hosted mode lauch issue. Another question about configuring jetty : it expects a web.xml to define the RPC servlets. Many of us will use some more complex server side setup, for example including Spring and Hibernate, DataSources configuration, ... etc Running such complex server side components with hosted mode is easy with noserver, as we can setup the adequate servlet container. But with hosted mode jetty I fall into classloaders issues (jetty expect my libs to be in WEB-INF/lib, but they are set in eclipse launch classpath) The simpliest fix could be to have a dedicated web.xml file for jetty and hosted mode using mock-servlet RPC implementations. This is possible with 1.5 as the module servlet element is not used after compilation into a webapp. Any suggestion of a best-practice ? Any way to configure jetty to use an alternate web.xml ? Cheers, Nicolas On Wed, Feb 25, 2009 at 6:21 PM, Sami Jaber sami.ja...@gmail.com wrote: This is a very important issue. To resolve it, we had to code a custom servlet container launcher, this way : ***/** * Ensures that only Jetty and other server classes can be loaded into the * {...@link WebAppClassLoader}. This forces the user to put any necessary * dependencies into WEB-INF/lib. */* *private* *final* ClassLoader parentClassLoader = *new* ClassLoader( *null*) { *private* *final* ClassLoader delegateTo = Thread.*currentThread* ().getContextClassLoader(); @Override *protected* Class? findClass(String name) *throws* ClassNotFoundException { *if* (webAppClassLoader != *null (webAppClassLoader.isServerPath(name) || webAppClassLoader.isSystemPath(name))) { return delegateTo.loadClass(name); } throw new ClassNotFoundException(); } };* Works with -server MyCustomJettyLauncher This is not very smooth, but that works. Scott, maven is widely used by many folks out there, constraining ressources to be loaded from WEB-INF/lib doesn't make sense in Dev mode. Especially when you have many classes. The hosted mode should be able to use the classes passed from the command line by the Eclipse Maven plugin (kind of -cp %maven_classes%). Sami On Wed, Feb 25, 2009 at 6:04 PM, Scott Blum sco...@google.com wrote: I take your point. In the general case, server side dependencies need to be copied into WEB-INF/lib. Otherwise, the server code won't be able to access it. I can see how an XML parser might be a special case where the servlet container could be reasonably expected to provide it. Toby, do you have any thoughts on this? I think you're familiar with the pattern we're using of isolating Jetty from the system classpath to enforce the rule that server deps have to go into
[gwt-contrib] Re: Classloader issue running Hosted mode from Eclipse with Maven managed dependencies
You may be interested to see how jetty guys integrate with maven : http://www.mortbay.org/jetty/jetty-6/xref/org/mortbay/jetty/plugin/Jetty6MavenConfiguration.html They use a classPathFiles List created by the maven jetty:run goal to setup the jetty webappClassLoader. Maybe some comparable setup could be integrated into hosted mode ? Cheers, Nicolas On Thu, Feb 26, 2009 at 4:55 PM, nicolas de loof nicolas.del...@gmail.comwrote: I tested the create exploded webapp structure in maven plugin before creating lauch configurations strategy. I can launch the hosted browser but this has serious productivity cost : The /lib folder is not supposed to change often, so this is not an issue to poulate it from maven dependencies. The issue is with the (server-side) classes that I had to copy to /WEB-INF/classes. This must be done before every restart of the Hosted Browser when any Java file has been changed to sync sources and classes executed inside Jetty. As maven (or Eclipse + m2eclipse) compile to target/classes I'd prefer to avoid such costy setup. Nicolas On Thu, Feb 26, 2009 at 2:38 PM, nicolas de loof nicolas.del...@gmail.com wrote: To make things a little clearer, here is how I understand the way classloader are built by Hosted mode : bootClasspath gwt-dev |_ HostedMode |_ Hosted Browser | |_ Jetty Embedded |_ WebApplicationClassLoader WEB-INF/lib/* How does Jetty access project (service-side classes) ? The maven way to run Hosted Mode would be : bootClasspath |_ Maven laucher UrlClassLoader : full project classpath (sources, classes and libs) |_ HostedMode |_ Hosted Browser | |_ Jetty Embedded |_ WebApplicationClassLoader WEB-INF/lib/ is empty As the Maven Laucher can setup any argument / system variable that may be required, is there any way to configure the way Ebedded Jetty search for web application libs classes ? Another option would be for the plugin to prepare the WEB-INF/lib with project libs - code doing this allready exists - but with more impact on Hosted mode launch speed. Cheers, Nicolas On Thu, Feb 26, 2009 at 11:59 AM, nicolas de loof nicolas.del...@gmail.com wrote: I've found an (ugly ?) workaround by adding xercesImpl in the bootstrap classpath and setting the javax.xml.parsers.SAXParserFactory system property. With this config the plugin can assume the SAX parser to be used in hosted mode - not very pleasant as the user can't configure it's own, but fixes the hosted mode lauch issue. Another question about configuring jetty : it expects a web.xml to define the RPC servlets. Many of us will use some more complex server side setup, for example including Spring and Hibernate, DataSources configuration, ... etc Running such complex server side components with hosted mode is easy with noserver, as we can setup the adequate servlet container. But with hosted mode jetty I fall into classloaders issues (jetty expect my libs to be in WEB-INF/lib, but they are set in eclipse launch classpath) The simpliest fix could be to have a dedicated web.xml file for jetty and hosted mode using mock-servlet RPC implementations. This is possible with 1.5 as the module servlet element is not used after compilation into a webapp. Any suggestion of a best-practice ? Any way to configure jetty to use an alternate web.xml ? Cheers, Nicolas On Wed, Feb 25, 2009 at 6:21 PM, Sami Jaber sami.ja...@gmail.comwrote: This is a very important issue. To resolve it, we had to code a custom servlet container launcher, this way : ***/** * Ensures that only Jetty and other server classes can be loaded into the * {...@link WebAppClassLoader}. This forces the user to put any necessary * dependencies into WEB-INF/lib. */* *private* *final* ClassLoader parentClassLoader = *new* ClassLoader(*null*) { *private* *final* ClassLoader delegateTo = Thread.*currentThread* ().getContextClassLoader(); @Override *protected* Class? findClass(String name) *throws* ClassNotFoundException { *if* (webAppClassLoader != *null (webAppClassLoader.isServerPath(name) || webAppClassLoader.isSystemPath(name))) { return delegateTo.loadClass(name); } throw new ClassNotFoundException(); } };* Works with -server MyCustomJettyLauncher This is not very smooth, but that works. Scott, maven is widely used by many folks out there, constraining ressources to be loaded from WEB-INF/lib doesn't make sense in Dev mode. Especially when you have many classes. The hosted mode should be able to use the classes passed from the command line by the Eclipse Maven plugin (kind of -cp %maven_classes%). Sami On Wed, Feb 25, 2009 at 6:04 PM, Scott Blum sco...@google.com wrote: I take your point. In the
[gwt-contrib] Re: Classloader issue running Hosted mode from Eclipse with Maven managed dependencies
I finally found an acceptable solution by : - using a test webapp structure in src/test/webapp so that I can register simplified (mock) GWT-RPC servlet implementations and not require my full webapp to test in hosted mode (can still use noserver for that) - creating the exploded WAR structure for jetty WEB-INF/lib when the plugin generates the launch configurations - configuring my maven project to output compiled classes in jetty WEB-INF/classes (the plugin checks this configuration has been set) Please let me know if you find a simplier way to integrate maven with Jetty ;-) On Thu, Feb 26, 2009 at 5:09 PM, nicolas de loof nicolas.del...@gmail.comwrote: You may be interested to see how jetty guys integrate with maven : http://www.mortbay.org/jetty/jetty-6/xref/org/mortbay/jetty/plugin/Jetty6MavenConfiguration.html They use a classPathFiles List created by the maven jetty:run goal to setup the jetty webappClassLoader. Maybe some comparable setup could be integrated into hosted mode ? Cheers, Nicolas On Thu, Feb 26, 2009 at 4:55 PM, nicolas de loof nicolas.del...@gmail.com wrote: I tested the create exploded webapp structure in maven plugin before creating lauch configurations strategy. I can launch the hosted browser but this has serious productivity cost : The /lib folder is not supposed to change often, so this is not an issue to poulate it from maven dependencies. The issue is with the (server-side) classes that I had to copy to /WEB-INF/classes. This must be done before every restart of the Hosted Browser when any Java file has been changed to sync sources and classes executed inside Jetty. As maven (or Eclipse + m2eclipse) compile to target/classes I'd prefer to avoid such costy setup. Nicolas On Thu, Feb 26, 2009 at 2:38 PM, nicolas de loof nicolas.del...@gmail.com wrote: To make things a little clearer, here is how I understand the way classloader are built by Hosted mode : bootClasspath gwt-dev |_ HostedMode |_ Hosted Browser | |_ Jetty Embedded |_ WebApplicationClassLoader WEB-INF/lib/* How does Jetty access project (service-side classes) ? The maven way to run Hosted Mode would be : bootClasspath |_ Maven laucher UrlClassLoader : full project classpath (sources, classes and libs) |_ HostedMode |_ Hosted Browser | |_ Jetty Embedded |_ WebApplicationClassLoader WEB-INF/lib/ is empty As the Maven Laucher can setup any argument / system variable that may be required, is there any way to configure the way Ebedded Jetty search for web application libs classes ? Another option would be for the plugin to prepare the WEB-INF/lib with project libs - code doing this allready exists - but with more impact on Hosted mode launch speed. Cheers, Nicolas On Thu, Feb 26, 2009 at 11:59 AM, nicolas de loof nicolas.del...@gmail.com wrote: I've found an (ugly ?) workaround by adding xercesImpl in the bootstrap classpath and setting the javax.xml.parsers.SAXParserFactory system property. With this config the plugin can assume the SAX parser to be used in hosted mode - not very pleasant as the user can't configure it's own, but fixes the hosted mode lauch issue. Another question about configuring jetty : it expects a web.xml to define the RPC servlets. Many of us will use some more complex server side setup, for example including Spring and Hibernate, DataSources configuration, ... etc Running such complex server side components with hosted mode is easy with noserver, as we can setup the adequate servlet container. But with hosted mode jetty I fall into classloaders issues (jetty expect my libs to be in WEB-INF/lib, but they are set in eclipse launch classpath) The simpliest fix could be to have a dedicated web.xml file for jetty and hosted mode using mock-servlet RPC implementations. This is possible with 1.5 as the module servlet element is not used after compilation into a webapp. Any suggestion of a best-practice ? Any way to configure jetty to use an alternate web.xml ? Cheers, Nicolas On Wed, Feb 25, 2009 at 6:21 PM, Sami Jaber sami.ja...@gmail.comwrote: This is a very important issue. To resolve it, we had to code a custom servlet container launcher, this way : ***/** * Ensures that only Jetty and other server classes can be loaded into the * {...@link WebAppClassLoader}. This forces the user to put any necessary * dependencies into WEB-INF/lib. */* *private* *final* ClassLoader parentClassLoader = *new* ClassLoader(*null*) { *private* *final* ClassLoader delegateTo = Thread.*currentThread *().getContextClassLoader(); @Override *protected* Class? findClass(String name) *throws* ClassNotFoundException { *if* (webAppClassLoader != *null
[gwt-contrib] Re: Classloader issue running Hosted mode from Eclipse with Maven managed dependencies
On Thu, Feb 26, 2009 at 5:59 AM, nicolas de loof nicolas.del...@gmail.comwrote: Another question about configuring jetty : it expects a web.xml to define the RPC servlets. Many of us will use some more complex server side setup, for example including Spring and Hibernate, DataSources configuration, ... etc Running such complex server side components with hosted mode is easy with noserver, as we can setup the adequate servlet container. But with hosted mode jetty I fall into classloaders issues (jetty expect my libs to be in WEB-INF/lib, but they are set in eclipse launch classpath) The intention is that if you need more complex configurations, you setup your server yourself and run with -noserver. While it may or may not be feasible to support your desired behavior with the built-in jetty, there are going to be many unique configurations out there that will not work with it so -noserver is the escape valve needed for those. -- John A. Tamplin Software Engineer (GWT), Google --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Fix javadoc in MenuItem
Committed revision 4880. http://gwt-code-reviews.appspot.com/7803 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Error embedded 1.6 Compiler
On Thu, Feb 26, 2009 at 1:10 AM, BobV b...@google.com wrote: One does not. I can start one next week when I get back. Cool. Another option might be to go straight to create user-facing doc for 1.6. --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Classloader issue running Hosted mode from Eclipse with Maven managed dependencies
I fully agree about the noserver option when some server-side setup is required. I myself consider the hosted-mode server only for UI testing with mock gwt-RPC servlets. The issue here with maven integration is that even the simpliest server setup (only RPC RemoteServlet with no dependency on any other lib) requires to put project classes and gwt-* libs in jetty WEB-INF, that is not the best option for maven as it requires many files to get copied. Take a look at the jetty6 MavenConfiguration to see that jetty guys found an alternate way by building the webapp classpath dynamically from maven dependencies. Cheers, Nicolas On Thu, Feb 26, 2009 at 5:42 PM, John Tamplin j...@google.com wrote: On Thu, Feb 26, 2009 at 5:59 AM, nicolas de loof nicolas.del...@gmail.com wrote: Another question about configuring jetty : it expects a web.xml to define the RPC servlets. Many of us will use some more complex server side setup, for example including Spring and Hibernate, DataSources configuration, ... etc Running such complex server side components with hosted mode is easy with noserver, as we can setup the adequate servlet container. But with hosted mode jetty I fall into classloaders issues (jetty expect my libs to be in WEB-INF/lib, but they are set in eclipse launch classpath) The intention is that if you need more complex configurations, you setup your server yourself and run with -noserver. While it may or may not be feasible to support your desired behavior with the built-in jetty, there are going to be many unique configurations out there that will not work with it so -noserver is the escape valve needed for those. -- John A. Tamplin Software Engineer (GWT), Google --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Classloader issue running Hosted mode from Eclipse with Maven managed dependencies
On Thu, Feb 26, 2009 at 11:53 AM, nicolas de loof nicolas.del...@gmail.comwrote: The issue here with maven integration is that even the simpliest server setup (only RPC RemoteServlet with no dependency on any other lib) requires to put project classes and gwt-* libs in jetty WEB-INF, that is not the best option for maven as it requires many files to get copied. This is where we made a bit of a tough-love decision to conform to the Servlet spec by essentially requiring server side code to go into WEB-INF/lib and /classes. Output locations of .class files are generally quite configurable, for example in Eclipse projects we just literally set the output folder for source compilation to be WEB-INF/classes, and we add classpath entries to the Eclipse project that target WEB-INF/lib directly. While this may cause some friction with some build tools and configurations, the benefits of standardizing on the Servlet spec and exploded war structure seem to far outweigh the costs. It puts everyone on the same page in terms of tooling, documentation, assumptions, etc. Down the road it will enable features like generation of server-side bytecode. RPC for example could be much more efficient on the server if we generated bytecode instead of using reflection so heavily. That being said, I do want to address specific pain points like this XML validation problem. I repro'd this locally and you can trigger the problem in a straight up hosted mode launch merely by putting Xerces on the classpath. This seems pretty bad. :) --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4878 - releases/1.6/dev/core/src/com/google/gwt/dev/js/ast
Author: amitman...@google.com Date: Thu Feb 26 07:54:28 2009 New Revision: 4878 Modified: releases/1.6/dev/core/src/com/google/gwt/dev/js/ast/JsRootScope.java Log: svn merge -r4872:4873 https://google-web-toolkit.googlecode.com/svn/trunk . This patch adds identifiers that cause loading of the java plugin in the browser to the blacklist of identifiers that must not be used in the generated javascript Patch by: amitmanjhi Review by: fabbott (desk review) Modified: releases/1.6/dev/core/src/com/google/gwt/dev/js/ast/JsRootScope.java == --- releases/1.6/dev/core/src/com/google/gwt/dev/js/ast/JsRootScope.java (original) +++ releases/1.6/dev/core/src/com/google/gwt/dev/js/ast/JsRootScope.java Thu Feb 26 07:54:28 2009 @@ -102,6 +102,13 @@ // Functions commonly defined on Object toString, getClass, constructor, prototype, +/* + * These keywords trigger the loading of the java-plugin. For the + * next-generation plugin, this results in starting a new Java process. + */ +java, Packages, netscape, sun, JavaObject, JavaClass, +JavaArray, JavaMember, + // GWT-defined identifiers $wnd, $doc, $moduleName, $moduleBase, $gwt_version, --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4880 - releases/1.6/user/src/com/google/gwt/user/client/ui
Author: rj...@google.com Date: Thu Feb 26 08:45:15 2009 New Revision: 4880 Modified: releases/1.6/user/src/com/google/gwt/user/client/ui/MenuItem.java Log: Fix MenuItem class doc--it's not a widget Issue 434 Review by bruce Modified: releases/1.6/user/src/com/google/gwt/user/client/ui/MenuItem.java == --- releases/1.6/user/src/com/google/gwt/user/client/ui/MenuItem.java (original) +++ releases/1.6/user/src/com/google/gwt/user/client/ui/MenuItem.java Thu Feb 26 08:45:15 2009 @@ -19,7 +19,7 @@ import com.google.gwt.user.client.DOM; /** - * A widget that can be placed in a + * An entry in a * {...@link com.google.gwt.user.client.ui.MenuBar}. Menu items can either fire a * {...@link com.google.gwt.user.client.Command} when they are clicked, or open a * cascading sub-menu. --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] ClippedState not sinking ONERROR event
Hello Using latest build #4880 I can’t reproduce this in a small sample, but in a big project some ImageBundle images have a 3D border… this happenes only on IE, I think the problem is that the ImageBundle is setting an invalid URL and then setting the clear.gif image using the “onerror” event, but the ClippedState() class is sinking 4 events but not the ONERROR event. In class Image.java on line 111: image.sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS | Event.ONMOUSEWHEEL | Event.ONLOAD); it should be image.sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS | Event.ONMOUSEWHEEL | Event.ONLOAD | Event.ONERROR); Thanks --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: ClippedState not sinking ONERROR event
Does this look like an oversight to you guys? There *is* an addErrorHandler() method, so I assume it's meant to fire those events. Is there code somewhere that's supposed to sink the ONERROR event on-demand, perhaps? On Thu, Feb 26, 2009 at 1:20 PM, aris ari09845...@gmail.com wrote: Hello Using latest build #4880 I can’t reproduce this in a small sample, but in a big project some ImageBundle images have a 3D border… this happenes only on IE, I think the problem is that the ImageBundle is setting an invalid URL and then setting the clear.gif image using the “onerror” event, but the ClippedState() class is sinking 4 events but not the ONERROR event. In class Image.java on line 111: image.sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS | Event.ONMOUSEWHEEL | Event.ONLOAD); it should be image.sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS | Event.ONMOUSEWHEEL | Event.ONLOAD | Event.ONERROR); Thanks --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4881 - in changes/jat/runtime-locales/user: src/com/google/gwt/i18n/client/impl src/com/google/g...
Author: j...@google.com Date: Thu Feb 26 11:37:48 2009 New Revision: 4881 Modified: changes/jat/runtime-locales/user/src/com/google/gwt/i18n/client/impl/CurrencyList.java changes/jat/runtime-locales/user/src/com/google/gwt/i18n/rebind/CurrencyListGenerator.java changes/jat/runtime-locales/user/test/com/google/gwt/i18n/server/GwtLocaleTest.java Log: Changes from review feedback. Modified: changes/jat/runtime-locales/user/src/com/google/gwt/i18n/client/impl/CurrencyList.java == --- changes/jat/runtime-locales/user/src/com/google/gwt/i18n/client/impl/CurrencyList.java (original) +++ changes/jat/runtime-locales/user/src/com/google/gwt/i18n/client/impl/CurrencyList.java Thu Feb 26 11:37:48 2009 @@ -159,7 +159,7 @@ * * Generated implementations override this method. */ - native void loadCurrencyMap() /*-{ + protected native void loadCurrencyMap() /*-{ th...@com.google.gwt.i18n.client.impl.currencylist::dataMap = { :USD: [ USD, $, 2 ], :EUR: [ EUR, €, 2 ], @@ -173,7 +173,7 @@ * * Generated implementations override this method. */ - native void loadNamesMap() /*-{ + protected native void loadNamesMap() /*-{ th...@com.google.gwt.i18n.client.impl.currencylist::namesMap = { USD: US Dollar, EUR: Euro, Modified: changes/jat/runtime-locales/user/src/com/google/gwt/i18n/rebind/CurrencyListGenerator.java == --- changes/jat/runtime-locales/user/src/com/google/gwt/i18n/rebind/CurrencyListGenerator.java (original) +++ changes/jat/runtime-locales/user/src/com/google/gwt/i18n/rebind/CurrencyListGenerator.java Thu Feb 26 11:37:48 2009 @@ -102,11 +102,10 @@ } if (runtimeLocales.isEmpty()) { return generateOne(logger, context, targetClass, locale); -} else { - CachedGeneratorContext cachedContext = new CachedGeneratorContext(context); - return generateRuntimeSelection(logger, cachedContext, targetClass, - locale, runtimeLocales); } +CachedGeneratorContext cachedContext = new CachedGeneratorContext(context); +return generateRuntimeSelection(logger, cachedContext, targetClass, locale, +runtimeLocales); } private String generateOne(TreeLogger logger, GeneratorContext context, @@ -149,7 +148,7 @@ MapString, String nameMap = new HashMapString, String(); writer.println(@Override); - writer.println(native void loadCurrencyMap() /*-{); + writer.println(protected native void loadCurrencyMap() /*-{); writer.indent(); writer.println(th...@com.google.gwt.i18n.client.impl.currencylist::dataMap = {); writer.indent(); @@ -342,6 +341,7 @@ writer.println( return;); writer.println(}); } + // TODO(jat): return an instance based on the compile locale instead. writer.println(assert false;); writer.outdent(); writer.println(}); Modified: changes/jat/runtime-locales/user/test/com/google/gwt/i18n/server/GwtLocaleTest.java == --- changes/jat/runtime-locales/user/test/com/google/gwt/i18n/server/GwtLocaleTest.java (original) +++ changes/jat/runtime-locales/user/test/com/google/gwt/i18n/server/GwtLocaleTest.java Thu Feb 26 11:37:48 2009 @@ -35,42 +35,42 @@ ListGwtLocale aliases = zhCN.getAliases(); assertEquals(2, aliases.size()); assertEquals(aliases.get(0), zhCN); -assertContains(aliases, factory.fromString(zh_Hans_CN)); +assertContainsAndGetPosition(aliases, factory.fromString(zh_Hans_CN)); GwtLocale zhHant = factory.fromString(zh_Hant); aliases = zhHant.getAliases(); assertEquals(aliases.get(0), zhHant); -assertContains(aliases, factory.fromString(zh_Hant_TW)); +assertContainsAndGetPosition(aliases, factory.fromString(zh_Hant_TW)); GwtLocale zhHans = factory.fromString(zh_Hans); aliases = zhHans.getAliases(); assertEquals(aliases.get(0), zhHans); -assertContains(aliases, factory.fromString(zh_Hans_CN)); +assertContainsAndGetPosition(aliases, factory.fromString(zh_Hans_CN)); GwtLocale en = factory.fromString(en); aliases = en.getAliases(); assertEquals(aliases.get(0), en); GwtLocale enLatn = factory.fromString(en_Latn); -assertContains(aliases, enLatn); +assertContainsAndGetPosition(aliases, enLatn); assertTrue(en.usesSameScript(enLatn)); assertTrue(enLatn.inheritsFrom(en)); assertFalse(en.inheritsFrom(enLatn)); assertFalse(en.inheritsFrom(en)); GwtLocale pt = factory.fromString(pt); aliases = pt.getAliases(); -assertContains(aliases, factory.fromString(pt_BR)); +assertContainsAndGetPosition(aliases,
[gwt-contrib] [google-web-toolkit commit] r4882 - changes/jat/runtime-locales/user/src/com/google/gwt/i18n/client/constants
Author: j...@google.com Date: Thu Feb 26 11:39:46 2009 New Revision: 4882 Modified: changes/jat/runtime-locales/user/src/com/google/gwt/i18n/client/constants/NumberConstants.java Log: Improve comment directing how to change old code. Modified: changes/jat/runtime-locales/user/src/com/google/gwt/i18n/client/constants/NumberConstants.java == --- changes/jat/runtime-locales/user/src/com/google/gwt/i18n/client/constants/NumberConstants.java (original) +++ changes/jat/runtime-locales/user/src/com/google/gwt/i18n/client/constants/NumberConstants.java Thu Feb 26 11:39:46 2009 @@ -25,7 +25,7 @@ * locale. * * If you previously were using GWT.create on this interface, you should - * use LocaleInfo.getNumberConstants() instead. + * use LocaleInfo.getCurrentLocale().getNumberConstants() instead. */ public interface NumberConstants { String notANumber(); --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4883 - branches/snapshot-2009.02.26
Author: j...@google.com Date: Thu Feb 26 12:22:27 2009 New Revision: 4883 Added: branches/snapshot-2009.02.26/ - copied from r4882, /trunk/ Log: 2009.02.26 Snapshot branch. --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4884 - in changes/jat/runtime-locales: . dev/core/src/com/google/gwt/core/ext/linker dev/core/sr...
Author: j...@google.com Date: Thu Feb 26 12:30:53 2009 New Revision: 4884 Added: changes/jat/runtime-locales/user/test/com/google/gwt/dev/jjs/test/jsoimpls/ - copied from r4882, /trunk/user/test/com/google/gwt/dev/jjs/test/jsoimpls/ changes/jat/runtime-locales/user/test/com/google/gwt/dev/jjs/test/jsoimpls/UnreferencedImplOfJsoInterface.java - copied unchanged from r4882, /trunk/user/test/com/google/gwt/dev/jjs/test/jsoimpls/UnreferencedImplOfJsoInterface.java changes/jat/runtime-locales/user/test/com/google/gwt/dev/jjs/test/jsointfs/ - copied from r4882, /trunk/user/test/com/google/gwt/dev/jjs/test/jsointfs/ changes/jat/runtime-locales/user/test/com/google/gwt/dev/jjs/test/jsointfs/JsoInterfaceWithUnreferencedImpl.java - copied unchanged from r4882, /trunk/user/test/com/google/gwt/dev/jjs/test/jsointfs/JsoInterfaceWithUnreferencedImpl.java Modified: changes/jat/runtime-locales/ (props changed) changes/jat/runtime-locales/common.ant.xml changes/jat/runtime-locales/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java changes/jat/runtime-locales/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardLinkerContext.java changes/jat/runtime-locales/dev/core/src/com/google/gwt/dev/Compiler.java changes/jat/runtime-locales/dev/core/src/com/google/gwt/dev/GWTCompiler.java changes/jat/runtime-locales/dev/core/src/com/google/gwt/dev/Link.java changes/jat/runtime-locales/dev/core/src/com/google/gwt/dev/jdt/WebModeCompilerFrontEnd.java changes/jat/runtime-locales/dev/core/src/com/google/gwt/dev/js/ast/JsRootScope.java changes/jat/runtime-locales/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteSingleJsoImplDispatches.java (props changed) changes/jat/runtime-locales/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerOutDir.java (props changed) changes/jat/runtime-locales/distro-source/linux/src/webAppCreator (props changed) changes/jat/runtime-locales/distro-source/mac/src/webAppCreator (props changed) changes/jat/runtime-locales/distro-source/windows/src/webAppCreator.cmd (props changed) changes/jat/runtime-locales/eclipse/samples/Hello/Hello-gwtc.launch (props changed) changes/jat/runtime-locales/samples/dynatable/war/DynaTable.css (props changed) changes/jat/runtime-locales/samples/dynatable/war/DynaTable.html (props changed) changes/jat/runtime-locales/samples/hello/war/Hello.html (props changed) changes/jat/runtime-locales/samples/i18n/war/I18N.css (props changed) changes/jat/runtime-locales/samples/i18n/war/I18N.html (props changed) changes/jat/runtime-locales/samples/json/war/JSON.css (props changed) changes/jat/runtime-locales/samples/json/war/JSON.html (props changed) changes/jat/runtime-locales/samples/mail/war/Mail.css (props changed) changes/jat/runtime-locales/samples/mail/war/Mail.html (props changed) changes/jat/runtime-locales/samples/simplexml/war/SimpleXML.css (props changed) changes/jat/runtime-locales/samples/simplexml/war/SimpleXML.html (props changed) changes/jat/runtime-locales/user/src/com/google/gwt/user/client/ui/impl/PopupImplMozilla.java changes/jat/runtime-locales/user/src/com/google/gwt/user/tools/WebAppCreator.java (props changed) changes/jat/runtime-locales/user/test/com/google/gwt/dev/jjs/test/SingleJsoImplTest.java Log: Merge up from trunk. Modified: changes/jat/runtime-locales/common.ant.xml == --- changes/jat/runtime-locales/common.ant.xml (original) +++ changes/jat/runtime-locales/common.ant.xml Thu Feb 26 12:30:53 2009 @@ -37,6 +37,7 @@ property name=gwt.build.jni location=${gwt.build}/jni / property name=gwt.build.staging location=${gwt.build}/staging / property name=gwt.build.dist location=${gwt.build}/dist / + property name=gwt.threadsPerProcessor value=1 / property name=project.build location=${gwt.build.out}/${project.tail} / property name=project.lib location=${gwt.build.lib}/gwt-${ant.project.name}.jar / property name=project.jni location=${gwt.build}/${project.tail} / Modified: changes/jat/runtime-locales/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java == --- changes/jat/runtime-locales/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java (original) +++ changes/jat/runtime-locales/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java Thu Feb 26 12:30:53 2009 @@ -35,11 +35,9 @@ * the code that should be run when the application starts up. The remaining * elements are loaded via * {...@link com.google.gwt.core.client.GWT#runAsync(com.google.gwt.core.client.RunAsyncCallback) - * GWT.runAsync}. The linker should provide a function
[gwt-contrib] Re: Associating Data Transfer Objects (DTOs) with Suggestion Objects
I opened issue #3409 for the Suggestion change and issue #3410 for the HasValue change. http://code.google.com/p/google-web-toolkit/issues/detail?id=3409 http://code.google.com/p/google-web-toolkit/issues/detail?id=3410 - Isaac On Wed, Feb 25, 2009 at 9:07 AM, Arthur Kalmenson arthur.k...@gmail.com wrote: On a side note, I found when I was writing this patch that HasValue extends HasValueChangeHandlers in trunk. It occurs to me that this relationship could possibly be backwards. I don't think that something with a value necessarily should be required to broadcast changes. See the implementation of MultiWordSuggestion for an illustration of this. Requiring something that HasValueChangeHandlers to have a value (that value which changes) makes more sense to me on the face of it. This makes more sense to me too. p.s. Thank you, Gmail Labs, for reminding me that I forgot to attach the patch. Handy, ain't it? :) -- Arthur Kalmenson On Tue, Feb 24, 2009 at 6:42 PM, Isaac Truett itru...@gmail.com wrote: I basically agree with John and Ray. In general, I agree that using the most remote parent type possible (without introducing casts) is ideal. But when the subtype exists specifically as a convenience, using the parameterized super class instead and then complaining about it is... let's call it silly. To better illustrate my proposal, I have attached a quick-and-dirty patch against trunk r4850. In this patch Suggestion extends HasValue and TypedSuggestBox is a super class of SuggestBox, as I described above. On a side note, I found when I was writing this patch that HasValue extends HasValueChangeHandlers in trunk. It occurs to me that this relationship could possibly be backwards. I don't think that something with a value necessarily should be required to broadcast changes. See the implementation of MultiWordSuggestion for an illustration of this. Requiring something that HasValueChangeHandlers to have a value (that value which changes) makes more sense to me on the face of it. - Isaac p.s. Thank you, Gmail Labs, for reminding me that I forgot to attach the patch. On Tue, Feb 24, 2009 at 1:03 PM, Emily Crutcher e...@google.com wrote: If that concern doesn't seem like it would be a problem, then I definitely agree with you that creating abstract base classes that have the parametrized types seems like the best solution. On Tue, Feb 24, 2009 at 10:54 AM, Ray Ryan rj...@google.com wrote: That feedback sounds a bit pedantic and impractical to me. And my job title used to be Senior Pedant. On Tue, Feb 24, 2009 at 7:44 AM, Emily Crutcher e...@google.com wrote: It could work, though I found when I used this technique with DatePicker (DatePicker extends AbstractDatePickerMonthSelector, CalandarView), there was some feedback that having that abstract type layer was slightly confusing because good OO practice implied that references should then be typed as AbstractDatePicker, which then brought in the complexity of the generic types back into the lives of the 90% who did not care about the parameterized arguments. On Tue, Feb 24, 2009 at 10:00 AM, Ray Ryan rj...@google.com wrote: How about extracting a parameterized super class: AbstractSuggestionBoxT extends Suggestion SuggestionBox extends AbstractSuggestionBoxSuggestion rjrjr On Mon, Feb 23, 2009 at 7:15 PM, Emily Crutcher e...@google.com wrote: On Mon, Feb 23, 2009 at 7:04 PM, Isaac Truett itru...@gmail.com wrote: The API documentation has this to say on the subject: [...] To send back a DTO with each suggestion, extend the Suggestion interface and define a getter method that has a return value of the DTO's type. Define a class that implements this subinterface and use it to encapsulate each suggestion. To access a suggestion's DTO when the suggestion is selected, add a SuggestionHandler to the SuggestBox (see SuggestBox's documentation for more information). In the SuggestionHandler.onSuggestionSelected(SuggestionEvent event) method, obtain the selected Suggestion object from the SuggestionEvent object, and downcast the Suggestion object to the subinterface. Then, acces the DTO using the DTO getter method that was defined on the subinterface. See http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/SuggestOracle.Suggestion.html (the 1.6 version is similar, but with the new event model) So the endorsed solution is to extend and cast. Fair enough. This probably dates from pre-1.5, and it was good enough for then. But is there a reason not to parameterize SuggestBox with T extends Suggestion (and SuggestOracleT, SelectionEventT, etc.) now that that's an option? Or perhaps make Suggestion implement HasValueT? I have an application that uses many SuggestBoxes and many different Suggestion subclasses and this would simplify things (and eliminate much type-casting). I'm not sure parameterizing SuggestBox itself
[gwt-contrib] Re: Fixes Issue 3378, adding protected getHandlerCount() to widget.
Committed at r4885 On Tue, Feb 24, 2009 at 6:16 PM, Ray Ryan rj...@google.com wrote: LGTM Nah, just rename and submit. On Tue, Feb 24, 2009 at 3:13 PM, Emily Crutcher e...@google.com wrote: Hmm Any reasons I can think of dissolve under the argument of that what I'd look for. Do you want a new patch with the rename? On Tue, Feb 24, 2009 at 6:08 PM, rj...@google.com wrote: Thanks for the quick response. Only one nit: why not just call the test WidgetTest? That's certainly what I'd look for when I wanted to extend it. http://gwt-code-reviews.appspot.com/7802 -- There are only 10 types of people in the world: Those who understand binary, and those who don't -- There are only 10 types of people in the world: Those who understand binary, and those who don't --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4886 - branches/snapshot-2009.02.26
Author: j...@google.com Date: Thu Feb 26 13:12:46 2009 New Revision: 4886 Added: branches/snapshot-2009.02.26/branch-info.txt Log: Adding branch-info.txt. Added: branches/snapshot-2009.02.26/branch-info.txt == --- (empty file) +++ branches/snapshot-2009.02.26/branch-info.txtThu Feb 26 13:12:46 2009 @@ -0,0 +1,7 @@ +branch-info.txt for the 2009.02.26 snapshot branch: +Tracks interactions between this branch and other branches. +See: http://code.google.com/p/google-web-toolkit/wiki/ManagingMerges + +Copies: +/branches/snapshot-2009.02.26/ was created (r4883) as a straight copy from /trunk/@r4877 + --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4885 - in releases/1.6/user: src/com/google/gwt/user/client/ui test/com/google/gwt/user test/com...
Author: e...@google.com Date: Thu Feb 26 13:10:29 2009 New Revision: 4885 Added: releases/1.6/user/test/com/google/gwt/user/client/ui/WidgetTest.java Modified: releases/1.6/user/src/com/google/gwt/user/client/ui/Widget.java releases/1.6/user/test/com/google/gwt/user/UISuite.java Log: Fixes issue 3378 by adding getHandlerCount() Review by:rjrjr Modified: releases/1.6/user/src/com/google/gwt/user/client/ui/Widget.java == --- releases/1.6/user/src/com/google/gwt/user/client/ui/Widget.java (original) +++ releases/1.6/user/src/com/google/gwt/user/client/ui/Widget.java Thu Feb 26 13:10:29 2009 @@ -22,6 +22,7 @@ import com.google.gwt.event.shared.HandlerManager; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.event.shared.HasHandlers; +import com.google.gwt.event.shared.GwtEvent.Type; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.EventListener; @@ -193,6 +194,16 @@ * @see #onDetach() */ protected void doDetachChildren() { + } + + /** + * Gets the number of handlers listening to the event type. + * + * @param type the event type + * @return the number of registered handlers + */ + protected int getHandlerCount(Type? type) { +return handlerManager == null ? 0 : handlerManager.getHandlerCount(type); } /** Modified: releases/1.6/user/test/com/google/gwt/user/UISuite.java == --- releases/1.6/user/test/com/google/gwt/user/UISuite.java (original) +++ releases/1.6/user/test/com/google/gwt/user/UISuite.java Thu Feb 26 13:10:29 2009 @@ -22,6 +22,7 @@ import com.google.gwt.user.client.WindowTest; import com.google.gwt.user.client.ui.AbsolutePanelTest; import com.google.gwt.user.client.ui.AnchorTest; +import com.google.gwt.user.client.ui.WidgetTest; import com.google.gwt.user.client.ui.ButtonTest; import com.google.gwt.user.client.ui.CaptionPanelTest; import com.google.gwt.user.client.ui.CheckBoxTest; @@ -164,6 +165,7 @@ suite.addTestSuite(ClassInitTest.class); suite.addTestSuite(DateChangeEventTest.class); suite.addTestSuite(CreateEventTest.class); +suite.addTestSuite(WidgetTest.class); return suite; } } Added: releases/1.6/user/test/com/google/gwt/user/client/ui/WidgetTest.java == --- (empty file) +++ releases/1.6/user/test/com/google/gwt/user/client/ui/WidgetTest.java Thu Feb 26 13:10:29 2009 @@ -0,0 +1,61 @@ +/* + * Copyright 2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.user.client.ui; + +import com.google.gwt.event.dom.client.ChangeEvent; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.event.shared.HandlerRegistration; +import com.google.gwt.junit.client.GWTTestCase; + +/** + * Tests the basic widget infrastructure. + * + */ +public class WidgetTest extends GWTTestCase { + + ClickHandler handlerA = new ClickHandler() { + +public void onClick(ClickEvent event) { +} + }; + + ClickHandler handlerB = new ClickHandler() { + +public void onClick(ClickEvent event) { +} + }; + + @Override + public String getModuleName() { +return com.google.gwt.user.User; + } + + public void testHandlerCount() { +Widget a = new Widget(); +assertEquals(0, a.getHandlerCount(ClickEvent.getType())); +HandlerRegistration r1 = a.addDomHandler(handlerA, ClickEvent.getType()); +assertEquals(1, a.getHandlerCount(ClickEvent.getType())); +HandlerRegistration r2 = a.addHandler(handlerB, ClickEvent.getType()); +assertEquals(2, a.getHandlerCount(ClickEvent.getType())); + +assertEquals(0, a.getHandlerCount(ChangeEvent.getType())); +r1.removeHandler(); +r2.removeHandler(); +assertEquals(0, a.getHandlerCount(ClickEvent.getType())); + } + +} --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4887 - changes/jat/runtime-locales/user/src/com/google/gwt/i18n/rebind
Author: j...@google.com Date: Thu Feb 26 17:21:29 2009 New Revision: 4887 Modified: changes/jat/runtime-locales/user/src/com/google/gwt/i18n/rebind/CurrencyListGenerator.java Log: Fix bug where use of compile-time locale would result in an infinite loop. Modified: changes/jat/runtime-locales/user/src/com/google/gwt/i18n/rebind/CurrencyListGenerator.java == --- changes/jat/runtime-locales/user/src/com/google/gwt/i18n/rebind/CurrencyListGenerator.java (original) +++ changes/jat/runtime-locales/user/src/com/google/gwt/i18n/rebind/CurrencyListGenerator.java Thu Feb 26 17:21:29 2009 @@ -244,7 +244,7 @@ writer.println(}-*/;); writer.println(); writer.println(@Override); - writer.println(native void loadNamesMap() /*-{); + writer.println(protected native void loadNamesMap() /*-{); writer.indent(); writer.println(th...@com.google.gwt.i18n.client.impl.currencylist::namesMap = {); writer.indent(); @@ -276,7 +276,7 @@ throws UnableToCompleteException { String packageName = targetClass.getPackage().getName(); String className = targetClass.getName().replace('.', '_') + _ -+ compileLocale.getAsString(); ++ compileLocale.getAsString() + _runtimeSelection; PrintWriter pw = context.tryCreate(logger, packageName, className); if (pw != null) { ClassSourceFileComposerFactory factory = new ClassSourceFileComposerFactory( @@ -295,13 +295,13 @@ writer.println(}); writer.println(); writer.println(@Override); - writer.println(void loadCurrencyMap() {); + writer.println(protected void loadCurrencyMap() {); writer.println( ensureInstance();); writer.println( instance.loadCurrencyMap();); writer.println(}); writer.println(); writer.println(@Override); - writer.println(void loadNamesMap() {); + writer.println(protected void loadNamesMap() {); writer.println( ensureInstance();); writer.println( instance.loadNamesMap();); writer.println(}); @@ -312,8 +312,14 @@ writer.println( return;); writer.println(}); boolean fetchedLocale = false; - MapString, SetGwtLocale localeMap = new HashMapString, SetGwtLocale(); - processChildLocale(logger, context, targetClass, localeMap, compileLocale); + MapString, SetGwtLocale localeMap = new HashMapString, + SetGwtLocale(); + String compileLocaleClass = processChildLocale(logger, context, + targetClass, localeMap, compileLocale); + if (compileLocaleClass == null) { +// already gave warning, just use default implementation +return null; + } for (GwtLocale runtimeLocale : locales) { processChildLocale(logger, context, targetClass, localeMap, runtimeLocale); @@ -323,9 +329,13 @@ writer.println(String runtimeLocale = LocaleInfo.getCurrentLocale().getLocaleName();); fetchedLocale = true; } -writer.print(if (); boolean firstLocale = true; String generatedClass = entry.getKey(); +if (compileLocaleClass.equals(generatedClass)) { + // The catch-all will handle this + continue; +} +writer.print(if (); for (GwtLocale locale : entry.getValue()) { if (firstLocale) { firstLocale = false; @@ -341,8 +351,7 @@ writer.println( return;); writer.println(}); } - // TODO(jat): return an instance based on the compile locale instead. - writer.println(assert false;); + writer.println(instance = new + compileLocaleClass + ();); writer.outdent(); writer.println(}); writer.commit(logger); @@ -350,7 +359,7 @@ return packageName + . + className; } - private void processChildLocale(TreeLogger logger, GeneratorContext context, + private String processChildLocale(TreeLogger logger, GeneratorContext context, JClassType targetClass, MapString, SetGwtLocale localeMap, GwtLocale locale) throws UnableToCompleteException { String generatedClass = generateOne(logger, context, @@ -360,7 +369,7 @@ + targetClass.getQualifiedSourceName() + in locale + locale.toString()); // skip failed locale - return; + return null; } SetGwtLocale locales = localeMap.get(generatedClass); if (locales == null) { @@ -368,6 +377,7 @@ localeMap.put(generatedClass, locales); } locales.add(locale); +return generatedClass; } /** --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4888 - in trunk/user/src/com/google/gwt/user: client/rpc/impl rebind/rpc
Author: b...@google.com Date: Thu Feb 26 17:27:47 2009 New Revision: 4888 Modified: trunk/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java trunk/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java Log: Use a local variable to record the RPC request id number instead of using the global variable. This change is intended to help diagnose what looks like (but shouldn't actually be) a race condition in the stats reporting code. Patch by: bobv Review by: spoon (desk) Modified: trunk/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java == --- trunk/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java (original) +++ trunk/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java Thu Feb 26 17:27:47 2009 @@ -79,10 +79,6 @@ return requestId++; } - protected static int getRequestId() { -return requestId; - } - /** * Return codetrue/code if the encoded response contains a value * returned by the method invocation. Modified: trunk/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java == --- trunk/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java (original) +++ trunk/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java Thu Feb 26 17:27:47 2009 @@ -401,7 +401,8 @@ String statsMethodExpr = getProxySimpleName() + . + syncMethod.getName(); String tossName = nameFactory.createName(toss); w.println(boolean + tossName + = isStatsAvailable() stats( -+ timeStat(\ + statsMethodExpr + \, getRequestId(), \begin\));); ++ timeStat(\ + statsMethodExpr + \, + requestIdName ++ , \begin\));); w.print(ClientSerializationStreamWriter.class.getSimpleName()); w.print( ); @@ -464,7 +465,8 @@ + .toString();); w.println(tossName + = isStatsAvailable() stats( + timeStat(\ -+ statsMethodExpr + \, getRequestId(), \requestSerialized\));); ++ statsMethodExpr + \, + requestIdName ++ , \requestSerialized\));); /* * Depending on the return type for the async method, return a @@ -487,7 +489,8 @@ JType returnType = syncMethod.getReturnType(); w.print(ResponseReader. + getResponseReaderFor(returnType).name()); w.println(, \ + getProxySimpleName() + . + syncMethod.getName() -+ \, getRequestId(), + payloadName + , + callbackName + );); ++ \, + requestIdName + , + payloadName + , + callbackName ++ );); w.outdent(); w.println(}); } --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4889 - in trunk/user: src/com/google/gwt/user/client/ui test/com/google/gwt/user/client/ui
Author: j...@google.com Date: Thu Feb 26 18:36:02 2009 New Revision: 4889 Modified: trunk/user/src/com/google/gwt/user/client/ui/FlowPanel.java trunk/user/test/com/google/gwt/user/client/ui/FlowPanelTest.java Log: Fixes FlowPanel.clear() on IE (by making it not use innerHTML). Patch by: jgw Review by: bruce Modified: trunk/user/src/com/google/gwt/user/client/ui/FlowPanel.java == --- trunk/user/src/com/google/gwt/user/client/ui/FlowPanel.java (original) +++ trunk/user/src/com/google/gwt/user/client/ui/FlowPanel.java Thu Feb 26 18:36:02 2009 @@ -15,6 +15,7 @@ */ package com.google.gwt.user.client.ui; +import com.google.gwt.dom.client.Node; import com.google.gwt.user.client.DOM; /** @@ -47,7 +48,13 @@ @Override public void clear() { super.doLogicalClear(); -this.getElement().setInnerHTML(); + +// Remove all existing child nodes. +Node child = getElement().getFirstChild(); +while (child != null) { + getElement().removeChild(child); + child = getElement().getFirstChild(); +} } /** Modified: trunk/user/test/com/google/gwt/user/client/ui/FlowPanelTest.java == --- trunk/user/test/com/google/gwt/user/client/ui/FlowPanelTest.java (original) +++ trunk/user/test/com/google/gwt/user/client/ui/FlowPanelTest.javaThu Feb 26 18:36:02 2009 @@ -15,6 +15,7 @@ */ package com.google.gwt.user.client.ui; +import com.google.gwt.dom.client.Element; import com.google.gwt.junit.client.GWTTestCase; import java.util.ArrayList; @@ -57,5 +58,23 @@ for (Widget child : target) { assertNull(child.getElement().getPropertyString(__listener) == null); } + } + + public void testClearWithNestedChildren() { +FlowPanel target = new FlowPanel(); +FlowPanel child0 = new FlowPanel(); +HTML child1 = new HTML(); +target.add(child0); +child0.add(child1); + +Element child0Elem = child0.getElement(); +Element child1Elem = child1.getElement(); + +assertEquals(child0Elem, target.getElement().getFirstChild()); +assertEquals(child1Elem, child0Elem.getFirstChild()); + +target.clear(); + +assertEquals(child1Elem, child0Elem.getFirstChildElement()); } } --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4891 - branches/snapshot-2009.02.26
Author: j...@google.com Date: Thu Feb 26 18:43:01 2009 New Revision: 4891 Modified: branches/snapshot-2009.02.26/branch-info.txt Log: Updating branch-info.txt. Modified: branches/snapshot-2009.02.26/branch-info.txt == --- branches/snapshot-2009.02.26/branch-info.txt(original) +++ branches/snapshot-2009.02.26/branch-info.txtThu Feb 26 18:43:01 2009 @@ -5,3 +5,6 @@ Copies: /branches/snapshot-2009.02.26/ was created (r4883) as a straight copy from /trunk/@r4877 +Merges: +/tr...@c4889 was merged (r4890) into this branch + --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4890 - in branches/snapshot-2009.02.26/user: src/com/google/gwt/user/client/ui test/com/google/g...
Author: j...@google.com Date: Thu Feb 26 18:42:28 2009 New Revision: 4890 Modified: branches/snapshot-2009.02.26/user/src/com/google/gwt/user/client/ui/FlowPanel.java branches/snapshot-2009.02.26/user/test/com/google/gwt/user/client/ui/FlowPanelTest.java Log: Merging trunk c4889 into this branch. Modified: branches/snapshot-2009.02.26/user/src/com/google/gwt/user/client/ui/FlowPanel.java == --- branches/snapshot-2009.02.26/user/src/com/google/gwt/user/client/ui/FlowPanel.java (original) +++ branches/snapshot-2009.02.26/user/src/com/google/gwt/user/client/ui/FlowPanel.java Thu Feb 26 18:42:28 2009 @@ -15,6 +15,7 @@ */ package com.google.gwt.user.client.ui; +import com.google.gwt.dom.client.Node; import com.google.gwt.user.client.DOM; /** @@ -47,7 +48,13 @@ @Override public void clear() { super.doLogicalClear(); -this.getElement().setInnerHTML(); + +// Remove all existing child nodes. +Node child = getElement().getFirstChild(); +while (child != null) { + getElement().removeChild(child); + child = getElement().getFirstChild(); +} } /** Modified: branches/snapshot-2009.02.26/user/test/com/google/gwt/user/client/ui/FlowPanelTest.java == --- branches/snapshot-2009.02.26/user/test/com/google/gwt/user/client/ui/FlowPanelTest.java (original) +++ branches/snapshot-2009.02.26/user/test/com/google/gwt/user/client/ui/FlowPanelTest.java Thu Feb 26 18:42:28 2009 @@ -15,6 +15,7 @@ */ package com.google.gwt.user.client.ui; +import com.google.gwt.dom.client.Element; import com.google.gwt.junit.client.GWTTestCase; import java.util.ArrayList; @@ -57,5 +58,23 @@ for (Widget child : target) { assertNull(child.getElement().getPropertyString(__listener) == null); } + } + + public void testClearWithNestedChildren() { +FlowPanel target = new FlowPanel(); +FlowPanel child0 = new FlowPanel(); +HTML child1 = new HTML(); +target.add(child0); +child0.add(child1); + +Element child0Elem = child0.getElement(); +Element child1Elem = child1.getElement(); + +assertEquals(child0Elem, target.getElement().getFirstChild()); +assertEquals(child1Elem, child0Elem.getFirstChild()); + +target.clear(); + +assertEquals(child1Elem, child0Elem.getFirstChildElement()); } } --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4894 - trunk/dev/core/src/com/google/gwt/dev/jjs/impl
Author: b...@google.com Date: Thu Feb 26 18:54:09 2009 New Revision: 4894 Modified: trunk/dev/core/src/com/google/gwt/dev/jjs/impl/JavaScriptObjectNormalizer.java Log: Fix aliasing in AST nodes created by JavaScriptObjectNormalizer by calling CloneExpressionVisitor. Patch by: bobv Review by: scottb (TBR) Modified: trunk/dev/core/src/com/google/gwt/dev/jjs/impl/JavaScriptObjectNormalizer.java == --- trunk/dev/core/src/com/google/gwt/dev/jjs/impl/JavaScriptObjectNormalizer.java (original) +++ trunk/dev/core/src/com/google/gwt/dev/jjs/impl/JavaScriptObjectNormalizer.java Thu Feb 26 18:54:09 2009 @@ -148,15 +148,18 @@ x.getTarget()); localCall.getArgs().addAll(x.getArgs()); + // We need a second copy of the arguments for the else expression + CloneExpressionVisitor cloner = new CloneExpressionVisitor(program); + // instance.jsoMethod(arg, arg) - JMethodCall jsoCall = new JMethodCall(program, info, instance, - jsoMethod); - jsoCall.getArgs().addAll(x.getArgs()); + JMethodCall jsoCall = new JMethodCall(program, info, + cloner.cloneExpression(instance), jsoMethod); + jsoCall.getArgs().addAll(cloner.cloneExpressions(x.getArgs())); // Cast.isJavaScriptObject() ? instance.jsoMethod() : // instance.method(); - JConditional newExpr = makeIsJsoConditional(info, instance, - x.getType(), jsoCall, localCall); + JConditional newExpr = makeIsJsoConditional(info, + cloner.cloneExpression(instance), x.getType(), jsoCall, localCall); multi.exprs.add(newExpr); // We may only have the ternary operation if there's no side-effect --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4892 - in releases/1.6/user: src/com/google/gwt/user/client/ui test/com/google/gwt/user/client/ui
Author: j...@google.com Date: Thu Feb 26 18:45:04 2009 New Revision: 4892 Modified: releases/1.6/user/src/com/google/gwt/user/client/ui/FlowPanel.java releases/1.6/user/test/com/google/gwt/user/client/ui/FlowPanelTest.java Log: Merging trunk c4889 into this branch. Modified: releases/1.6/user/src/com/google/gwt/user/client/ui/FlowPanel.java == --- releases/1.6/user/src/com/google/gwt/user/client/ui/FlowPanel.java (original) +++ releases/1.6/user/src/com/google/gwt/user/client/ui/FlowPanel.java Thu Feb 26 18:45:04 2009 @@ -15,6 +15,7 @@ */ package com.google.gwt.user.client.ui; +import com.google.gwt.dom.client.Node; import com.google.gwt.user.client.DOM; /** @@ -47,7 +48,13 @@ @Override public void clear() { super.doLogicalClear(); -this.getElement().setInnerHTML(); + +// Remove all existing child nodes. +Node child = getElement().getFirstChild(); +while (child != null) { + getElement().removeChild(child); + child = getElement().getFirstChild(); +} } /** Modified: releases/1.6/user/test/com/google/gwt/user/client/ui/FlowPanelTest.java == --- releases/1.6/user/test/com/google/gwt/user/client/ui/FlowPanelTest.java (original) +++ releases/1.6/user/test/com/google/gwt/user/client/ui/FlowPanelTest.java Thu Feb 26 18:45:04 2009 @@ -15,6 +15,7 @@ */ package com.google.gwt.user.client.ui; +import com.google.gwt.dom.client.Element; import com.google.gwt.junit.client.GWTTestCase; import java.util.ArrayList; @@ -57,5 +58,23 @@ for (Widget child : target) { assertNull(child.getElement().getPropertyString(__listener) == null); } + } + + public void testClearWithNestedChildren() { +FlowPanel target = new FlowPanel(); +FlowPanel child0 = new FlowPanel(); +HTML child1 = new HTML(); +target.add(child0); +child0.add(child1); + +Element child0Elem = child0.getElement(); +Element child1Elem = child1.getElement(); + +assertEquals(child0Elem, target.getElement().getFirstChild()); +assertEquals(child1Elem, child0Elem.getFirstChild()); + +target.clear(); + +assertEquals(child1Elem, child0Elem.getFirstChildElement()); } } --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4893 - releases/1.6
Author: j...@google.com Date: Thu Feb 26 18:46:51 2009 New Revision: 4893 Modified: releases/1.6/branch-info.txt Log: Updating branch-info.txt. Modified: releases/1.6/branch-info.txt == --- releases/1.6/branch-info.txt(original) +++ releases/1.6/branch-info.txtThu Feb 26 18:46:51 2009 @@ -34,6 +34,7 @@ /releases/1.6/@r4657:4658 was merged (r4662) into trunk /releases/1.6/@r4658:4669 was merged (r4670) into trunk /tr...@c4873 was merged (r4878) into /releases/1.6 +/trunk revision c4889 was merged (r4892) into this branch The next merge into trunk will be: svn merge -r4669:4694 https://google-web-toolkit.googlecode.com/svn/releases/1.6 . --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---