Re: Using a custom DateFormatProvider in GWT
Thanks, just the information I needed. On 17 Jun., 05:37, John A. Tamplin j...@google.com wrote: GWT uses the data from the Unicode CLDR, and supports ta and ta_LK, so ta_IN should get the ta defaults, which should be appropriate for IN. If you believe there should be a specialization for ta in India, then I suggest filing a bug against CLDR to add it. Aside from that, search for *_ta.* under user/src/com/google/gwt/i18n and make a copy under *_ta_IN.* and edit it as needed. You could put those files in your own project and GWT will use them if they are on the classpath. -- 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.
Using a custom DateFormatProvider in GWT
Hi, since the J2EE runtime seems to revert to some inappropriate standard locale when using the actual locale ta-IN, I've written a customized DateFormatProvider and successfully deployed it to the application server. It looks like this: public class TamilNaduDateFormatProvider extends java.text.spi.DateFormatProvider{ @Override public DateFormat getTimeInstance(int style, Locale locale) { return DateFormat.getTimeInstance(style, Locale.UK); } @Override public DateFormat getDateInstance(int style, Locale locale) { return DateFormat.getDateInstance(style, Locale.UK); } @Override public DateFormat getDateTimeInstance(int dateStyle, int timeStyle, Locale locale) { return DateFormat.getDateTimeInstance(dateStyle, timeStyle, Locale.UK); } @Override public Locale[] getAvailableLocales() { return new Locale[]{new Locale(ta, IN)}; } } It needs to be packed into a jar with some meta information and deployed to the runtime's lib/ext directory. Here is some background: http://download.oracle.com/javase/6/docs/technotes/guides/extensions/index.html For server code, this works fine. However, the GWT-UI in my case still uses that inappropriate default locale (even after doing a recompilation using the extended (by the customized DateFormatProvider) runtime. So my question is: How does GWT determine the proper date formatting for the locale sent from the browser and how could I plug-in into this system to have ta-IN properly supported? Apparently, the standard Java mechanism does not work, or am I wrong? Is it because GWT uses the SDK rather than the runtime? I tried to create the corresponding lib/ext Folder even in the SDK and put the jar there but this also did not help... Regards, panam -- 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: Hierachy of autobean for state serialization
Hm, I am just looking for a way to enocde and persist (webstore) state (some POJO properties) on the client. I have difficulties to see see how the RequestFactory will help me here as my intention is that it is for client server communication. However, it ought to be possible (at least, it has to do serialization to put the data on the wire). As I understand autobeans, they are that part of the bindery framework that is used for this purpose (amongst all by the request factory itself). That's why I am trying to use them here. Regards, panam -- 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.
Hierachy of autobean for state serialization
Hi, I am considering to use autobeans for state serialization, i.e. a hierachy of graphical objects sharing subsets of common properties. Each has its specifics (specific properties, e.g. specific fields that should be serialized), but'd like best to find a common state serialization for them. The basic idea is to create an autobean for the most general type which defines all common methods, e.g. public interface BasicObjectSerialization{ getX(); getY(); } public class BasicObject implements BasicObjectSerialization{ getX(){return this.x}; getY(){return this.y}; } For serialization, the object is wrapped into BasicObjectSerialization and that autobean is then encoded. Restoration is done by passing the autobean to a BasicObject.restore(BasicObjectSerialization state) method which does the restoration after the BasicObject has been instantiated. Now, what to do with each object's specifics (i.e. those of the subtypes)? As an example, consider the class public class SpecialObject extends BasicObject{ getColor(){return this.color}; } I basically see two approaches: 1) Add a method String BasicObject.getCustomState() which encodes the the specifics to string. This must be done separately for each subtype of BasicObject. - Pros: * Definitely seems to work. - Cons: * It is necessesary to provide some kind of extra (de-) serialization in each subtype with spcifics * Overall complicated and a lot of manual things to do. 2) Create an hierachy autobeans : public interface SpecialObjectSerialization extends BasicObjectSerialization{ getColor(); } - Pros: * Put everything in an object tree and serialize once. Would make things simple and clean - Cons: * It seems polymorphism is not possible with autobeans. E.g. if I have a list of ObjectSerializations, how to get the 'specifics' of the subtypes encoded (e.g. color)? All my attempts failed so far. Now some questions: Related to 2): is polymorphism indeed impossible with autobeans so that I lose subtype specifics when serialzing lists of objects with different subypes (but a common supertype of course)? Related to 1): Can the extra serialization necessary in each subtype be avoided somehow? Ideas? Thanks, panam -- 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: Hierachy of autobean for state serialization
Can sombody just comment on this? I have a decision to make Related to 2): is polymorphism indeed impossible with autobeans so that I lose subtype specifics when serialzing lists of objects with different subypes (but a common supertype of course)? Thanks panam -- 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: SimpleEventBus: How to add a handler and fire an event for it when nested in a parent handler?
Hi Jens, thanks for your insights and suggestion. I hoped to had chosen the more flexible and decoupled approach using the SimpleEventBus, but it seems this can lead to problems with the event queue. Now, I pass the handler direcly into the method which gives greater control of the handler invocation time but in general less flexibility because I cannot notify more handlers (which in my case is no problem). Thanks panam On 27 Mai, 20:33, Jens jens.nehlme...@gmail.com wrote: Well I think its not a design flaw in SimpleEventBus because as the name says its just a simple implementation. When you add a handler to the eventbus it has to be stored in a MapEventType, ListHandler. Once an event is fired you will iterate over this list and that means you can not add or remove something to/from it. This will result in a ConcurrentModificationException. SimpleEventBus keeps track of these modifications and applies them after all events have been dispatched. You can try and implement your own EventBus to support your example but I think its not that easy. The code that keeps track of handlers that were added/removed during an event dispatch won't be that easy. I think its easier to change your app code to play nice with SimpleEventBus, e.g.: thisMethodIsCalledBytheParentHandler(){ myService.getMessage( id, new DefaultAsyncCallbackListEventMessageDTO() { public void onSuccess(Message myMessage){ //do something //do something (the code from your onMessageRetrieved()) myEventBus.fireEvent(new MessageRetrievedEvent(id, myMessage)); } }); } -- 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.
SimpleEventBus: How to add a handler and fire an event for it when nested in a parent handler?
In my parent handler, I'd like to initiate an rpc call and react to it when it arrives. Thus in short, the setup is as follows thisMethodIsCalledBytheParentHandler(){ HandlerRegistration messageRetrievedHandlerRegistration = myEventBus.addMessageRetrievedHandler(new MessageRetrievedHandler() { @Override public void onMessagesRetrieved(Message event) { //do something messageRetrievedHandlerRegistration.removeHandler(); } } fetchMessage(); } fetchMessage(){ myService.getMessage(id, new DefaultAsyncCallbackListEventMessageDTO() { public void onSuccess(Message myMessage){ //do someting myEventBus.fireEvent(new messageRetrievedEvent(id, myMessage)); ) } The addMessageRetrievedHandler is actually enqueueAdded in the SimpleEventBus (because firingDepth is 0): SimpleEventBus(line 166.., GWT 2.1.1 ) private H extends EventHandler HandlerRegistration doAdd( final GwtEvent.TypeH type, final Object source, final H handler) { if (firingDepth 0) { enqueueAdd(type, source, handler); } else { doAddNow(type, source, handler); } Problem: The handler is added AFTER the messageRetrievedEvent is actually fired, because both, adding the handler and firing the corresponding event is taking place in the context of a parent handler (i.e. firingDepth is 0). Any ideas on how to get around this? Tried some Scheduler experiments but this did not really seem to help... Thanks panam -- 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.
Differences between development and production mode
Hi, I just noticed some differences in behavior of my code running in development and production mode. In my code, there is a class Vec (to do some Vector calculus) which has an add, diff, and scale method. The first version of these methods created a clone of the instance, did the calculations on it and returned the clone, i.e.: public Vec scale(double factor){ Vec ret = clone(); ret.x *= factor; ret.y *= factor; return ret; } protected Vec clone(int x, int y) { return new Vec(x, y); } For efficiency reasons, the behavior was changed to modify the actual object (and return it for convenience, i.e. public Vec scale(double factor){ x *= factor; y *= factor; return this; } After adapting all algorithms that make use of these methods (some relied on a clone being returned and now have to clone the instance before calling the method) this does not produce any differences in the results of the algorithms between the two versions. However, this is valid only for development mode. In production mode, the change led to differences in the result. Reintroducing the cloning corrected the behavior in production mode. So I wonder whether there are known differences between both modes that would explain this. Thanks panam -- 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-tool...@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: Differences between development and production mode
GWT 2.1, Windows 7 (64) bit, Java 6.0_22 -- 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-tool...@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: Slider Panel like in maps?
Peter thanks, that was exactly what I was looking for :) On 20 Feb., 20:30, Peter Simun si...@seges.sk wrote: you can find Collapsible panel implemented in GWT here:http://code.google.com/p/gwt-incubator-1-5-wiki/wiki/CollapsiblePanel or in GXT just set panel.setCollapsible(true); to the panel. See the demo here:http://www.extjs.com/example Cheers Simon -- 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-tool...@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.
Slider Panel like in maps?
I really love the slider panel that is used with Google maps. Is this (or a very similar) widget somehow available 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-tool...@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.
How to determine frame size?
Is it somehow possible to determine the size of a frame? I'd like a widget (a canvas) to occupy all space that is available in a frame without the need to scroll... 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-tool...@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.