Re: Background image shows up in hosted mode but not in web mode

2009-06-12 Thread alex.d

Wrong path? Some CSS/browser issues? Who knows. Take firebug and check
your page's styling.

On 11 Jun., 17:15, Manolis Platakis m.plata...@gmail.com wrote:
 Hello,

 I have created the following css style to add a background image to
 the html page of my application.

 .bg {
   background: url(images/bg.gif) 50% 50% no-repeat;

 }

 and in the .java I have:

 RootPanel.get().addStyleName(bg);

 In hosted mode I can see the background image but in web mode (after
 compiling), although the application is up to date, the background
 image does not show up.

 Any ideas on why this might be happening?

 Thanks in advance,
 Manolis
--~--~-~--~~~---~--~~
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: Browser memory usage grows

2009-06-12 Thread David

Hi,

In the general case GWT's design guards against common JS pitfalls
that cause memory leaks.

There are a few known issues though:
When you use IFrames that memory is never decently released after
removing the IFrame.
The FormPanel can also leak.

IE6/IE7 are also consuming a huge amount of memory (half a megabyte
per image sometimes) if you use ImageBundles.
That is caused by the AlphaLoader trick they use to support
transparent PNGs in IE6.
I disabled this trick for IE7 and now everything runs a lot smoother.

All other memory leaks are possible plain old Java leaks caused by not
cleaning up or releasing references to objects in you application (so
your fault!)

David

On Fri, Jun 12, 2009 at 1:41 AM, Craig Sprycraig.s...@gmail.com wrote:
 Hello All,
 We've built an application using GWT 1.5.4 that calls a json server and the
 memory usage for the browser that it is running in keeps going up, I've
 tested this in IE, Firefox and Chrome with the same result.  This
 application is a widget based application, we have a map widget(open street
 maps) and some list widgets but it doesn't seem to matter which widgets that
 we use the memory seems to grow.  I've tried using each widget individually
 with the same result.  The json that is returned is big, Firebug doesn't
 give me a value.  Our application polls for new information.
 I've also tried to use this tool:
 http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector.aspx
 But it didn't detect any leak in javascript.
 Unfortunatley this is an internal application so I can't point you to our
 application.  If it would be helpful I'll try and knock up a test case.
 Has anyone else had this problem?
 If so what was the solution?
 Thanks,
 Craig Spry
 


--~--~-~--~~~---~--~~
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: Browser memory usage grows

2009-06-12 Thread Craig Spry
Hi,
I would just like to clarify your last point.  I thought that GWT took java
code and turned it into javascript, this is what
http://code.google.com/webtoolkit/overview.html seems to indicate, so when I
have deployed my application there is no java running just javascript, have
I missed something?

I suppose what I am trying to ask is do java memory leaks translate into
javascript memory leaks?

Thanks,
Craig Spry

On Fri, Jun 12, 2009 at 4:36 PM, David david.no...@gmail.com wrote:


 Hi,

 In the general case GWT's design guards against common JS pitfalls
 that cause memory leaks.

 There are a few known issues though:
 When you use IFrames that memory is never decently released after
 removing the IFrame.
 The FormPanel can also leak.

 IE6/IE7 are also consuming a huge amount of memory (half a megabyte
 per image sometimes) if you use ImageBundles.
 That is caused by the AlphaLoader trick they use to support
 transparent PNGs in IE6.
 I disabled this trick for IE7 and now everything runs a lot smoother.

 All other memory leaks are possible plain old Java leaks caused by not
 cleaning up or releasing references to objects in you application (so
 your fault!)

 David

 On Fri, Jun 12, 2009 at 1:41 AM, Craig Sprycraig.s...@gmail.com wrote:
  Hello All,
  We've built an application using GWT 1.5.4 that calls a json server and
 the
  memory usage for the browser that it is running in keeps going up, I've
  tested this in IE, Firefox and Chrome with the same result.  This
  application is a widget based application, we have a map widget(open
 street
  maps) and some list widgets but it doesn't seem to matter which widgets
 that
  we use the memory seems to grow.  I've tried using each widget
 individually
  with the same result.  The json that is returned is big, Firebug doesn't
  give me a value.  Our application polls for new information.
  I've also tried to use this tool:
  http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector.aspx
  But it didn't detect any leak in javascript.
  Unfortunatley this is an internal application so I can't point you to our
  application.  If it would be helpful I'll try and knock up a test case.
  Has anyone else had this problem?
  If so what was the solution?
  Thanks,
  Craig Spry
  
 

 


--~--~-~--~~~---~--~~
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: Browser memory usage grows

2009-06-12 Thread David

Hi,

The last type of memory leaks is independent of the language you use.
so yes, these leaks will translate from Java to Javascript.

The reason is because your code is faulty since it keeps hard
references to objects that are no longer necessary.

For example you might have a list of listeners on a Model in an MVC
and you might reuse the model in multiple views. If you remove the
view but you forget to remove it's listener on the Model then you will
have a big memory leak if you keep on using the model. Besides the
memory leak your application might become slower and slower as well.


David

On Fri, Jun 12, 2009 at 8:53 AM, Craig Sprycraig.s...@gmail.com wrote:
 Hi,
 I would just like to clarify your last point.  I thought that GWT took java
 code and turned it into javascript, this is
 what http://code.google.com/webtoolkit/overview.html seems to indicate, so
 when I have deployed my application there is no java running just
 javascript, have I missed something?
 I suppose what I am trying to ask is do java memory leaks translate into
 javascript memory leaks?
 Thanks,
 Craig Spry

 On Fri, Jun 12, 2009 at 4:36 PM, David david.no...@gmail.com wrote:

 Hi,

 In the general case GWT's design guards against common JS pitfalls
 that cause memory leaks.

 There are a few known issues though:
 When you use IFrames that memory is never decently released after
 removing the IFrame.
 The FormPanel can also leak.

 IE6/IE7 are also consuming a huge amount of memory (half a megabyte
 per image sometimes) if you use ImageBundles.
 That is caused by the AlphaLoader trick they use to support
 transparent PNGs in IE6.
 I disabled this trick for IE7 and now everything runs a lot smoother.

 All other memory leaks are possible plain old Java leaks caused by not
 cleaning up or releasing references to objects in you application (so
 your fault!)

 David

 On Fri, Jun 12, 2009 at 1:41 AM, Craig Sprycraig.s...@gmail.com wrote:
  Hello All,
  We've built an application using GWT 1.5.4 that calls a json server and
  the
  memory usage for the browser that it is running in keeps going up, I've
  tested this in IE, Firefox and Chrome with the same result.  This
  application is a widget based application, we have a map widget(open
  street
  maps) and some list widgets but it doesn't seem to matter which widgets
  that
  we use the memory seems to grow.  I've tried using each widget
  individually
  with the same result.  The json that is returned is big, Firebug doesn't
  give me a value.  Our application polls for new information.
  I've also tried to use this tool:
  http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector.aspx
  But it didn't detect any leak in javascript.
  Unfortunatley this is an internal application so I can't point you to
  our
  application.  If it would be helpful I'll try and knock up a test case.
  Has anyone else had this problem?
  If so what was the solution?
  Thanks,
  Craig Spry
  
 




 


--~--~-~--~~~---~--~~
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: Name a function that will not get changed when compliling?

2009-06-12 Thread Shedokan

Thanks, I now realize what was that strange comments in GQuery and
that's what JSNI means.
I will check later the GWT exporter.

thanks.

On 11 יוני, 23:41, Alex Rudnick a...@google.com wrote:
 Hey Shedokan,

 The approach I've used for that is to attach a GWT function to the
 window object ($wnd).

 There's an example in the docs over 
 here:http://code.google.com/webtoolkit/doc/1.6/DevGuideCodingBasics.html#D...

 Check under the subsection Calling a Java Method from Handwritten 
 JavaScript.

 Like Ian said, you could also use GWT Exporter.

 Hope this helps!

 On Thu, Jun 11, 2009 at 1:58 PM, Shedokanshedok...@gmail.com wrote:

  Hello,
  How can I name a function like start() and it will not change while
  compliling so that other javascript can call it?

  thanks.

 --
 Alex Rudnick
 swe, gwt, atl
--~--~-~--~~~---~--~~
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: Event handler for model ?

2009-06-12 Thread mnenchev


Well what exactly you want to do?

Dalla wrote:

 Could you please post some examples will?
 Or maybe send me some code? mnenchevs example was good, but more
 examples never hurt :-)

 On 11 Juni, 14:08, Will wil...@gmail.com wrote:
   
 That's what I use as well.  I created an Abstract Class with
 HashmapEventHander,HandlerRegistration for removing a handler
 (because HandlerManager.removeHandler(..) is depricated) and use that
 for all my UI components that create custom events.  I then create sub-
 Classes of EventHandler for each logical group of events but that's
 just to help keep the project readable.  Doing it once for the base UI
 class didn't seem overweight but we'll see how it performs once I get
 the project into a perf test.

 On Jun 10, 8:40 am, Dalla dalla_man...@hotmail.com wrote:



 
 Hi
   
 I´m having trouble understanding how to implement an event handler for
 my custom objects with the new event handler system. Let´s pretend I
 have a very simple model class like this one:
   
 public class ArrivalData {
 private Date date;
 private boolean processing = false;
   
 public Date getDate() {
 return date;
 }
   
 public void setDate(Date date) {
 this.date = date;
 }
   
 }
   
 When setDate is called, I want to fire an event that my view
 components can listen on, and act on when called for.
 How would you go about doing that? Are there any existing handler
 interfaces that can be used?
 I found this tutorial (see link below), but it seems pretty
 complicated for what I´m trying to 
 acheive.http://www.itsolut.com/chrismusings/2009/04/28/business-events-with-g...
   
 What´s best practice here?
   
 
   


--~--~-~--~~~---~--~~
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: Preventing JavaScript Injection cient/server side solutions

2009-06-12 Thread tamsler

Evaluating user input on the client side and checking for script,
etc.  tags is a good practice, however, there are ways to bypass such
input validation. So the next best line of defense is to validate/re-
validate on the server side where the GWT RPC call terminates. I am
wondering what solutions exists at that end.
-- Thomas

On Jun 11, 5:20 pm, Jeff Chimene jchim...@gmail.com wrote:
 On 06/11/2009 04:18 PM, tamsler wrote:

  I am trying to figure out what the best way is to handle JavaScript
  injection cases. Since any client side input validation handling
  doesn't truly prevent one from injecting JS such as using tools like
  Firebug to re-post RPC calls etc.

  I am wondering if anybody has attempted to intercept JS injection on
  the server side by scanning RPC calls . I could imagine using a
  servlet filter to do this or or some other way.

  Any ideas/feeback is greatly appreciated.

 It's a good question, but it's not really GWT related.
 You're talking about server-side code. The  JS code generated by GWT
 executes in the browser.
 I may be completely missing your point, but perhaps these articles may
 be 
 apropos:http://code.google.com/webtoolkit/articles/using_gwt_for_json_mashups...
 andhttp://code.google.com/webtoolkit/articles/put_your_gwt_app_on_facebo...
--~--~-~--~~~---~--~~
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: LoginSecurityFAQ and sessionID/tokens

2009-06-12 Thread mars1412

as I interpret this article:
http://groups.google.com/group/Google-Web-Toolkit/web/security-for-gwt-applications

then you should do 2 things:
store the session-id in a cookie on the client side + include the
session-id in every RPC call (to prevent XSFR)

and if you call a custom servlet from your application (e.g. we need
this to upload files), you should also include a hidden field with a
copy of the session-id.

anyone please correct me, if that's wrong


On Jun 11, 12:35 pm, Paul Robinson ukcue...@gmail.com wrote:
 If you store the session ID in a cookie so that user logins can persist
 beyond browser refreshes (as suggested in the FAQ), then the session ID
 will end up in the header anyway.

 eags wrote:
  I am implementing user logins and authentication using the model
  presented in the login security FAQ.  In particular I plan on manually
  maintaining a table of {sessionID,User,timeout} values for each active
  session and not using the normal servlet session functionality.

  So, my question is, where do I get the ID that is returned to the
  client?  I know that I can get one from the servlet session using
  HttpServletRequest.getSession().getid() but it seems like I could just
  use any randomly generated key right?  And maybe I if face should not
  use that technique because that sessionID is also in the header where
  it can be easily snooped right?  So, what is a good technique for
  generating the sessionID?  To avoid duplicates I would just check the
  sessionID table before returning the sessionID to the client and if it
  is already in use I just call generateSessionID() again.  So my
  question is what should getSessionID() look like?

  I realize the recommended approach in the LoginSecurityFAQ is
  controversial and I've already read all that debate so I'm not really
  interested in more of that.  I just need specific help regarding these
  questions assuming I am doing what is recommended in the FAQ.

  Thanks in advance for any 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: Preventing JavaScript Injection cient/server side solutions

2009-06-12 Thread mars1412

on the client side, we simply use a html-editor and only enable simple
functions like bold, italics, list...
however, as already pointed out the user may easily work around this -
and if he does, all tags/attributes that we do not allow will silently
be filtered out on the serverside: we use this:
http://www.owasp.org/index.php/Category:OWASP_AntiSamy_Project

On Jun 12, 9:45 am, tamsler tams...@gmail.com wrote:
 Evaluating user input on the client side and checking for script,
 etc.  tags is a good practice, however, there are ways to bypass such
 input validation. So the next best line of defense is to validate/re-
 validate on the server side where the GWT RPC call terminates. I am
 wondering what solutions exists at that end.
 -- Thomas

 On Jun 11, 5:20 pm, Jeff Chimene jchim...@gmail.com wrote:

  On 06/11/2009 04:18 PM, tamsler wrote:

   I am trying to figure out what the best way is to handle JavaScript
   injection cases. Since any client side input validation handling
   doesn't truly prevent one from injecting JS such as using tools like
   Firebug to re-post RPC calls etc.

   I am wondering if anybody has attempted to intercept JS injection on
   the server side by scanning RPC calls . I could imagine using a
   servlet filter to do this or or some other way.

   Any ideas/feeback is greatly appreciated.

  It's a good question, but it's not really GWT related.
  You're talking about server-side code. The  JS code generated by GWT
  executes in the browser.
  I may be completely missing your point, but perhaps these articles may
  be 
  apropos:http://code.google.com/webtoolkit/articles/using_gwt_for_json_mashups...
  andhttp://code.google.com/webtoolkit/articles/put_your_gwt_app_on_facebo...
--~--~-~--~~~---~--~~
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: Eclipse Classic 3.5

2009-06-12 Thread Joakim

Good to hear! Thanks very much. Looking forward to the release!

On Jun 11, 10:24 pm, Rajeev Dayal rda...@google.com wrote:
 Hi,

 We're currently working on this. I don't have a set date for you, but we
 will get it out there as soon as we can.

 Thanks,
 Rajeev

 On Thu, Jun 11, 2009 at 4:15 PM, Joakim sarne...@gmail.com wrote:

  Any news on the progress of the 3.5 support? Can we expect a working
  plugin in time for the final release of Galileo in two weeks?

  On 28 Maj, 20:37, Miguel Méndez mmen...@google.com wrote:
   The plugin code is not open sourced at this time, but we do plan to open
   source it.

   On Tue, May 26, 2009 at 7:50 PM, acabler acab...@gmail.com wrote:

This will be really nice to have.  Is the plugin code available in svn
yet?  I would like to check it out so I can contribute patches for
issues like these.

thanks,
adam

On May 23, 10:40 am, Alex Rudnick a...@google.com wrote:
 Hey LiR,

 The plugin doesn't supportEclipse3.5yet. We're aware of the
 incompatibility, and it'll be fixed in an upcoming release -- likely
 soon before Galileo gets officially released.

 Thanks!

 On Fri, May 22, 2009 at 11:46 PM, LiR kirill...@gmail.com wrote:

 EclipseClassic3.5is available but google plugin (for 3.4 version)
  doesn`t want to install in new version.

  I have a Install Details message in top of window:

  The operation cannot be completed.  See the details.

  And details block:

  Cannot complete the install because one or more required items
  could
  not be found.
  Software being installed:
  com.google.gdt.eclipse.suite.e34.feature.feature.group
  1.0.1.v200905131143
  Missing requirement:
  com.google.gdt.eclipse.suite.e34.feature.feature.group
  1.0.1.v200905131143 requires 'org.eclipse.platform.feature.group
  [3.4.0,3.5.0)' but it could not be found

 --
 Alex Rudnick
 swe, gwt, atl

   --
   Miguel
--~--~-~--~~~---~--~~
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: GAE + GWT + password transfer

2009-06-12 Thread Shane

I really wish I had an answer to this.

On Jun 10, 5:04 pm, Shane shanelstev...@gmail.com wrote:
 Sorry to keep talking to myself here, but I find what other sites are
 doing really interesting, and pertinent to GAE because there doesn't
 seem to be an agreed upon solution.

 Facebook uses a form for their logins that posts to an HTTPS url:

 https://login.facebook.com/login.php?

 So does Google for that matter.

 Twitter also allows forhttp://twitter.comandhttps://twitter.com,
 although the default is plaint http, probably because https is slower
 and more computationally expensive.

 So it looks like https is the most secure way, but I noticed that
 Google App Engine doesn't allow SSL unless you are using a
 *.appspot.com domain.

 http://code.google.com/appengine/docs/python/config/appconfig.html#Se...

 So if I have have my blah.mydomain.com pointing via DNS CNAME, to my
 blah.appspot.com, I can't usehttps://blah.mydomain.com.

 All this just to not send the password to the server plain text.  :|

 Cheers,
 Shane

 On Jun 10, 4:15 pm, Shane shanelstev...@gmail.com wrote:



  I've actually just noticed that Twitter itself uses Basic Auth:

 http://apiwiki.twitter.com/Authentication

  It says OAuth is in development, but that Basic Auth won't be going
  anywhere for the foreseeable future.

  The trouble is, Basic Auth is insecure:

 http://en.wikipedia.org/wiki/Basic_access_authentication

  Although the scheme is easily implemented, it relies on the
  assumption that the connection between the client and server computers
  is secure and can be trusted. Specifically, the credentials are passed
  as plaintext and could be intercepted easily. The scheme also provides
  no protection for the information passed back from the server.

  I am going to look around at other public web API's, but if a site as
  large as Twitter is content to use this system, should I be all that
  worried?

  I would really like to know what experienced web programmers do here,
  either in GAE+GWT, or just generally.

  Cheers,
  Shane

  On Jun 10, 1:02 am, Shane shanelstev...@gmail.com wrote:

   I've seen some pretty heated debates around the discussion boards
   about this, but I haven't seen a solution that people decide on.

   Simply put, any application that I want to write will likely perform
   some sort of mashup between other services, like Twitter.

   For me to do anything interesting, I need the user to enter their
   Twitter username and password into a GWT client-side control on my
   site, which I then send back to my app on running on GAE.  I'll then
   use the password to log into Twitter with their credentials and do
   whatever if is I want to do, all the while not saving the users
   password in plain text anywhere.  I have no interest in holding onto
   anyone's credentials.

   So what is the best way for me to do this?  I am hearing people say
   that anything short of HTTPS is a waste of time.

   I guess this also becomes the larger issue of authentication
   generally, and I'm surprised there are still such heated discussions
   on the subject.  I thought it'd be a done deal by now.

   So, if anyone could point my in the right direction, in the context of
   GWT+GAE, I'd much appreciate it.
--~--~-~--~~~---~--~~
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: Mouse Wheel Handler on a TextBox

2009-06-12 Thread D L H

Ah I wish I had known this before I created a native method to handle
it. haha

Thanks for the info. I was just wondering, are there any major
disadvantages with using the latest svn revisions as opposed to the
latest stable release?

-DLH


On Jun 11, 2:54 pm, Sumit Chandel sumitchan...@google.com wrote:
 Hi D L H,
 I'm guessing the browser you were testing on when you tried this out was
 Firefox 3? There is a known (and fixed) issue for this reported on the Issue
 Tracker. See Issue #2902 (link below). The fix for the issue has been
 committed all will be included in the next release.

 Issue #2902:http://code.google.com/p/google-web-toolkit/issues/detail?id=2902

 If you're working from the GWT trunk, you can pick up and patch the issue
 with r5398.

 Hope that helps,
 -Sumit Chandel

 On Mon, Jun 8, 2009 at 7:09 AM, D L H thed2...@gmail.com wrote:



  hello.

  i'm trying to make a TextBox that will change value when someone
  scrolls the mouse wheel over it. specifically, my goal is for the
  number in the text box to increase when i scroll up, and decrease when
  i scroll down. however, i'm having trouble figuring out the
  MouseWheelHandler. i simplified my code to just change the value to
  UP or DOWN, but it just doesn't work. it compiles though. i also
  tried it with event.preventDefault(), but that didn't seem to have any
  effect.

  private TextBox valueField = new TextBox();
  ...
  ...
  valueField.addMouseWheelHandler(new MouseWheelHandler() {
    public void onMouseWheel(MouseWheelEvent event) {
       //event.preventDefault();
       if(event.isNorth()) {
          valueField.setText(UP);
       } else {
          valueField.setText(DOWN);
       }
    }
  });
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Running GWT with IBM JDK

2009-06-12 Thread ping2ravi

Hi All,
I got into this funny situation that i can not run my GWT application
in IBM JDK(1.5). It seems GWT is using some sun related classes which
are not available in IBM Java version. Can you please advise how can i
deploy such application with IBM java.

10:20:39,309 ERROR [[/SwSupWebTool]] Exception while dispatching
incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method
'public abstract com.citi.client.beans.ApplicationUser
com.citi.client.service.LoginService.login
(java.lang.String,java.lang.String) throws
com.citi.client.exception.ClientAppException' threw an unexpected
exception: java.lang.NoSuchMethodError: sun/security/util/
HostnameChecker.getSubjectX500Name(Ljava/security/cert/
X509Certificate;)Lsun/security/x509/X500Name;
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:166)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
(RemoteServiceServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:
713)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:
806)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:175)
at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke
(DefaultSubjectValve.java:56)
at org.apache.geronimo.tomcat.GeronimoStandardContext
$SystemMethodValve.invoke(GeronimoStandardContext.java:353)
at
org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke
(GeronimoBeforeAfterValve.java:47)
at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:109)
at org.apache.catalina.valves.AccessLogValve.invoke
(AccessLogValve.java:563)
at org.apache.catalina.connector.CoyoteAdapter.service
(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run
(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:810)
Caused by:
java.lang.NoSuchMethodError: sun/security/util/
HostnameChecker.getSubjectX500Name(Ljava/security/cert/
X509Certificate;)Lsun/security/x509/X500Name;
at
com.sun.net.ssl.internal.www.protocol.https.VerifierWrapper.getServername
(DelegateHttpsURLConnection.java:154)
at
com.sun.net.ssl.internal.www.protocol.https.VerifierWrapper.verify
(DelegateHttpsURLConnection.java:104)
at sun.net.www.protocol.https.HttpsClient.checkURLSpoofing
(HttpsClient.java:482)
at sun.net.www.protocol.https.HttpsClient.afterConnect
(HttpsClient.java:415)
at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
(AbstractDelegateHttpsURLConnection.java:170)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream
(HttpURLConnection.java:943)
at
com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl.getInputStream
(HttpsURLConnectionOldImpl.java:204)
at gfinet.desktop.client.AuthValidator.postData
(AuthValidator.java:600)
at
gfinet.desktop.client.AuthValidator.authenticateUserByPassword
(AuthValidator.java:179)
at gfinet.desktop.client.AuthAgent.authenticateUserOnly
(AuthAgent.java:308)
at com.citi.server.service.impl.GWTServiceImpl.login
(GWTServiceImpl.java:121)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
(RPC.java:527)
... 20 more

--~--~-~--~~~---~--~~
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

async code and the callback-chain

2009-06-12 Thread daniel

hi all,

I hope someone can help to find a solution to the following problem:

I have some complex code that may need data from the server. When I
make a request I get the data asynchronous, so I have to provide a
callback to handle the response. Now all the code that use this
function need a callback too. But this leads to very long chains of
nested callbacks. Especially when I need to call async methods in a
loop and every call may depend on the previous, I can`t find a way to
do this without calling the method recursive in the onSuccess of the
callback. But this way I get a StackOverflow very fast.

I can`t request all data first and run the code that needs it after
that, cause which data is needed may depend on the data I already got.

I have really no idea - hopefully you have

thx 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
-~--~~~~--~~--~--~---



Re: Running GWT with IBM JDK

2009-06-12 Thread Thomas Broyer



On 12 juin, 14:49, ping2ravi ping2r...@gmail.com wrote:
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream
 (HttpURLConnection.java:943)
         at
 com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl.getInputStream
 (HttpsURLConnectionOldImpl.java:204)
         at gfinet.desktop.client.AuthValidator.postData
 (AuthValidator.java:600)
         at
 gfinet.desktop.client.AuthValidator.authenticateUserByPassword
 (AuthValidator.java:179)
         at gfinet.desktop.client.AuthAgent.authenticateUserOnly
 (AuthAgent.java:308)
         at com.citi.server.service.impl.GWTServiceImpl.login
 (GWTServiceImpl.java:121)

It actually looks like this is *your* code that throws.
--~--~-~--~~~---~--~~
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 architecture MVP/EventBus (mentioned at Google I/O)

2009-06-12 Thread Thomas Broyer


On 11 juin, 21:34, Benju b...@fastcastmedia.com wrote:
 I did not attend Google I/O but as soon as the video Google I/O 2009
 - Best Practices for Architecting GWT App (http://www.youtube.com/
 watch?v=PDuhR18-EdM) was posted I reviewed it and was a bit confused
 by the idea of an EventBus.

For my part, I was pleased to see it as a best practice, as that's
what I'm thinking about for nearly a year (would require a huuge
refactoring of our app, so it's still just an idea floating in the
air)
(I didn't watch the video, just looked at the slides)

 From what I can tell the idea is that UI widgets requiring data from
 the server are able to fire off requests for some form of data like
 void getTransactionsForAccount(Account acct) then at some unknown
 later time (ms to seconds ussually) when a response comes in from the
 RPC call the eventbus is what actually directly recives the data and
 then it is dispatched

Well, not necessarily, though yes, that's what they said at Google I/
O. One of the reasons is that there are probably more than a single
place where you use that same data in your app (in GMail it could be
the list of mails, the unread count for the box and/or label(s), and
the conversation view of course). That way, all places are informed,
wherever the initial request came from.

 Client UI: Hey call some RPC method with these parameters, my
 AsyncCallback is this EventBus thing

 ...some unknown time passes while the server does magic...

 Client Event Bus: A response came in of type X/Y/Z I should fire an
 event to all interested parties

 Client UI: According to this event I just recieved some of my UI code
 needs to change

 A few things are still very hazy for me...

 1- What is missing here is when would the Client UI typically
 subscribe/unsubscribe from the event bus.  If this were a desktop
 application I would simply use weak reference so I would not have to
 unsubscribe my UI manually to prevent a memory leak.

As with any event, I'd subscribe in the onLoad and unsubscribe in the
onUnload (would be even better if there was a destructor, so that even
when not attached to the DOM, your widget could receive events and
enter a dirty state, so that when it is attached again to the DOM it
knows if it has to refresh or not)

 2- Is there some EventBus code I should be using that already exists
 in the GWT SDK?  Is this the same code that is used for handling
 widget events like clicking a button?

Wasn't the code shown in the slides? (page #73 in the PDF, the event
bus is just a HandlerManager (GWT 1.6 and upwards))

 3- Would you typically have one eventbus code for everything?

If your event bus is just a HandleManager as in the presentation's
sample code, then yes.

You would probably have one event bus (instance) for the whole app,
but you could also use some kind of HMVC (HMVP?) with component-wide
event buses.
(I'd rather have a single event bus though, and just use component-
specific events)

 4- How does this tie in with the MVP pattern?

slide #73, he seems to be injecting the event bus into the presenter
(I'm not used to MVP but it seems pretty logical to me).


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Community announcements on GWT blog

2009-06-12 Thread Miles T.

Hi,

I've read community updates here : 
http://googlewebtoolkit.blogspot.com/2009/06/gwt-community-updates.html.
I just wonder why it is talking about SmartGWT but not ExtGWT ?
--~--~-~--~~~---~--~~
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: Background image shows up in hosted mode but not in web mode

2009-06-12 Thread Manolis Platakis

It was, indeed, a css non-standard that was ignored by Firefox. Thanks
for your answer.

Manolis

On Jun 12, 9:21 am, alex.d alex.dukhov...@googlemail.com wrote:
 Wrong path? Some CSS/browser issues? Who knows. Take firebug and check
 your page's styling.

 On 11 Jun., 17:15, Manolis Platakis m.plata...@gmail.com wrote:

  Hello,

  I have created the following css style to add a background image to
  the html page of my application.

  .bg {
    background: url(images/bg.gif) 50% 50% no-repeat;

  }

  and in the .java I have:

  RootPanel.get().addStyleName(bg);

  In hosted mode I can see the background image but in web mode (after
  compiling), although the application is up to date, the background
  image does not show up.

  Any ideas on why this might be happening?

  Thanks in advance,
  Manolis
--~--~-~--~~~---~--~~
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: Spring Security login forwarding to blank page issue

2009-06-12 Thread El Mentecato Mayor

I'm experiencing the same. So far I'm blaming the problem on the
application not being production ready yet, so it is buggy and
sometimes I see some javascript errors.  As these errors go away and
the application stabilizes, I'll take a look at the problem more
closely.  But of course, if somebody has some clues about how to solve
the problem, I'd like to hear them... (sorry I'm of no help).

On Jun 1, 2:58 pm, tim.clymer tim.cly...@gmail.com wrote:
 Perhaps this may help in providing an answer.  When I log out from my
 app and go to a different browser tab and go to the URL of my app, I'd
 expect to see a login screen.

 Instead, it seems as though the browser is caching the page and
 attempting to make calls to my services.  In the response to these
 services, the server (tomcat) is sending back the login page (since
 I'm not logged in) as a response.

 It seems like the correct approach in this case would be to make sure
 the browser attempts to refresh my entry point every time so that it
 will be redirected to the login.  I've tried adding meta http-
 equiv=Pragma content=no-cache to the top of my html file to force
 this like so:

 html
   head
         meta http-equiv=Pragma content=no-cache
     meta http-equiv=content-type content=text/html;
 charset=UTF-8

 But to no avail.  Any ideas?  I'm in uncharted waters here with this
 caching stuff so your help would be greatly appreciated.

 Tim

 On Jun 1, 1:00 pm, tim.clymer tim.cly...@gmail.com wrote:

  I've done a bit of searching around the forums but haven't seen this
  issue crop up (though there are plenty of blank page issues from what
  I've seen).  I'm having an intermittent issue where when I login to my
  application (I use Spring Security as my security framework), it
  forwards to my app's HTML page (my application's entry point).
  Sometimes it will then load and show the application, other times it
  shows just a blank page.  If I refresh the blank page, my application
  comes up without fail.  This would lend me to believe that this is a
  caching issue.  Has anyone else experienced this and have any advice
  on solving it?

  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: Large Data Set problems

2009-06-12 Thread Tercio

Hi!

The problem is that in your function public void showUsers() { you
create a entry into FlexTable for each user, including the non-visible
ones.

Some browsers have problems displaying a huge data.

To solve this you have 2 options:

Create some kind of pagination into your flextable, creating a set of
your users and display only the possible visible ones(Something like
50), and remove/add the users as the user navigate through it.

Other option as Tom Hjeliming said, is to use some framework like
SmartGWT(http://code.google.com/p/smartgwt/). SmartGWT have a lot of
features and Widgets that makes life easier.
One of them is the Live Grid(http://www.smartclient.com/smartgwt/
showcase/#featured_grid_live), in the example it have around 700
records, but only render the visible ones, so it runs smooth on IE and
Firefox.

SmartGWT can load only a partial set of the data and ask server for
more when needed or load everything, depends on your requirement.

Regards

On Jun 11, 2:13 pm, Tom Hjellming thjellm...@riverglassinc.com
wrote:
 Hi Joe,

 The trick is to not even try to load that much data into the browser.  
 We use the SmartGWT widget library which has very good support for
 virtual pagination of lists and comboboxes.  By default, it only loads
 the first 75 rows and then as the user scrolls down, calls are made back
 to the server to retrieve the desired data - which is then shown to the
 user.  There is an occasional delay when the user sees blank space which
 is then filled in when the data comes in.  But overall, it is a great
 solution -we're viewing tables with thousands of rows and seeing better
 performance than our old Swing-based application.

 Tom



 Joe Larson wrote:
  I am having a performance problem.  I am trying to build a page that
  allows the user to select from a fairly large list of objects (up to
  20,000).  We have filtering capabilities to trim the list so the user
  doesn't have to scroll through all of them.  It's a reasonable UI.

  Unfortunately, I only get decent performance on Safari.  IE6 is
  exceptionally miserable.  It's okay when the list has 100 items, but
  it crashes as we exceed 300.  So I've been experimenting, and I
  haven't found a way around it.

  So I created a sample app.  All I did was populate an
  ArrayListString with 20,000 fairly short strings that I read out of
  the HTML file.  Under Safari 4 on a G5 Mac Pro, this is almost
  instant.  Under IE6 on a similar age Windows box, it's taking 4
  minutes.  Firefox on the G5 runs out of memory.

  Is it possible to store large amounts of data in my GWT applications?
  Or do I have to store fairly small amounts of data and go back and
  forth to the server a lot?  If it's the latter, I may as well just go
  back to what we used to do (WebObjects).

  I'm including my little sample program.  Maybe there's something
  obvious that I can do?

  -Joe

  --- GWTMinimum.java ---
  package com.missionmode.gwtminimum.client;

  import java.util.*;

  import com.google.gwt.core.client.*;
  import com.google.gwt.user.client.*;
  import com.google.gwt.user.client.ui.*;

  /**
   * Entry point classes define codeonModuleLoad()/code.
   */
  public class GWTMinimum implements EntryPoint {
     public FlexTable                        panel;
     public Button                           loadBtn;
     public Button                           displayBtn;
     public ListBox                          listBox;
     public Label                            label;
     public ArrayListString  usernames = new ArrayListString();
     public String[] parts;

     /**
      * This is the entry point method.
      */
     public void onModuleLoad() {
             panel = new FlexTable();
             RootPanel.get(web2).add(panel);

             loadBtn = new Button(Click to start load);
             panel.setWidget(0, 0, loadBtn);

             loadBtn.addClickListener(new ClickListener() {
                     public void onClick(Widget sender) {
                             loadUsers();
                     }
             });
     }

     /**
      * We've loaded the user table.  Set up so they
      * can press another button to display the data.
      */
     public void setupForDisplay() {
             displayBtn = new Button(Click to Display);
             panel.setWidget(0, 1, displayBtn);
             displayBtn.addClickListener(new ClickListener() {
                     public void onClick(Widget sender) {
                             showUsers();
                     }
             });
     }

     /**
      * Load the users from the HTML page.
      */
     public void loadUsers() {
             if (parts == null) {
                     String str = stringFromDocument(users);
                     parts = str.split(===);
                     loadBtn.setText(Click me again);
             }
             else {
                     for (String name : parts) {
                             name = name.trim();
                  

gwt-maven and web service

2009-06-12 Thread net

Hi all,

I'm trying to call and get response from a wsdl service. When I
compile the UI layer with maven, it throws this error:

com.google.gwt.user.client.rpc.SerializationException: Type
'javax.xml.ws.WebServiceException' was not included in the set of
types which can be serialized by this SerializationPolicy or its Class
object could not be loaded. For security purposes, this type will not
be serialized.


I tried to understand the error...but I dont! I found that the class
'javax.xml.ws.WebServiceException' is implemented java.oi.Serializer
but I dont know why GWTSerializer find this call non serializable.

Actually, the first error I got was that Maven couldnt find the class
javax.xml.ws.Service, so I added the dependency of jaxws-api.jar into
pom.xml. After that, I compiled the project and the above error was
thrown.

Please help!

Netty
--~--~-~--~~~---~--~~
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: GAE + GWT + password transfer

2009-06-12 Thread Isaac Truett

I'm not sure what your question is. Do you have a specific question?

You mentioned problems with HTTPS on GAE, which is probably a topic
more appropriate for the GAE group. As far as GWT is concerned, I
think you've already got the gist: HTTPS is a must-have for sending
passwords over a public network in anything that can come close to
being called a secure way.


On Fri, Jun 12, 2009 at 7:46 AM, Shaneshanelstev...@gmail.com wrote:

 I really wish I had an answer to this.

 On Jun 10, 5:04 pm, Shane shanelstev...@gmail.com wrote:
 Sorry to keep talking to myself here, but I find what other sites are
 doing really interesting, and pertinent to GAE because there doesn't
 seem to be an agreed upon solution.

 Facebook uses a form for their logins that posts to an HTTPS url:

 https://login.facebook.com/login.php?

 So does Google for that matter.

 Twitter also allows forhttp://twitter.comandhttps://twitter.com,
 although the default is plaint http, probably because https is slower
 and more computationally expensive.

 So it looks like https is the most secure way, but I noticed that
 Google App Engine doesn't allow SSL unless you are using a
 *.appspot.com domain.

 http://code.google.com/appengine/docs/python/config/appconfig.html#Se...

 So if I have have my blah.mydomain.com pointing via DNS CNAME, to my
 blah.appspot.com, I can't usehttps://blah.mydomain.com.

 All this just to not send the password to the server plain text.  :|

 Cheers,
 Shane

 On Jun 10, 4:15 pm, Shane shanelstev...@gmail.com wrote:



  I've actually just noticed that Twitter itself uses Basic Auth:

 http://apiwiki.twitter.com/Authentication

  It says OAuth is in development, but that Basic Auth won't be going
  anywhere for the foreseeable future.

  The trouble is, Basic Auth is insecure:

 http://en.wikipedia.org/wiki/Basic_access_authentication

  Although the scheme is easily implemented, it relies on the
  assumption that the connection between the client and server computers
  is secure and can be trusted. Specifically, the credentials are passed
  as plaintext and could be intercepted easily. The scheme also provides
  no protection for the information passed back from the server.

  I am going to look around at other public web API's, but if a site as
  large as Twitter is content to use this system, should I be all that
  worried?

  I would really like to know what experienced web programmers do here,
  either in GAE+GWT, or just generally.

  Cheers,
  Shane

  On Jun 10, 1:02 am, Shane shanelstev...@gmail.com wrote:

   I've seen some pretty heated debates around the discussion boards
   about this, but I haven't seen a solution that people decide on.

   Simply put, any application that I want to write will likely perform
   some sort of mashup between other services, like Twitter.

   For me to do anything interesting, I need the user to enter their
   Twitter username and password into a GWT client-side control on my
   site, which I then send back to my app on running on GAE.  I'll then
   use the password to log into Twitter with their credentials and do
   whatever if is I want to do, all the while not saving the users
   password in plain text anywhere.  I have no interest in holding onto
   anyone's credentials.

   So what is the best way for me to do this?  I am hearing people say
   that anything short of HTTPS is a waste of time.

   I guess this also becomes the larger issue of authentication
   generally, and I'm surprised there are still such heated discussions
   on the subject.  I thought it'd be a done deal by now.

   So, if anyone could point my in the right direction, in the context of
   GWT+GAE, I'd much appreciate it.
 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



New Event Handling and Composites

2009-06-12 Thread Buzzterrier

I am just not getting the new Event handling.  I have went over every
example I can find, but it is not clicking. How do you let composite
widgets subscribe to events from other composite widgets? From reading
it sounds like there is a HandlerManager that you register with by
implementing the HasxxHandlers interface, but I cannot piece together
how the Class that creates the event fires it off to the subscribers.

For example I have the following SimpleWidget that extends Composite
that contains a single button. I have another Composite widget that
wishes to be notified when that button is clicked. Can someone fill in
the blanks for me?

(Note I did not attempt to add the event handlers because I do not
want to confuse others who may have the same issue.)

public class SimpleWidget extends Composite{

private Button button;

public SimpleWidget() {
FlowPanel fp = new FlowPanel();
button = new Button(Click me);
//With listeners I would create an anonymous inner class
//that fires the click events to registered listeners.
//I don't know how to fire events for handlers
//button.addClickHandler(handler);???
fp.add(button);
initWidget(fp);
}
}

public class DoSomething extends Composite{

public DoSomething() {
FlowPanel fp = new FlowPanel();
SimpleWidget simple = new SimpleWidget();

fp.add(simple);
initWidget(fp);
}
}
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Flex Table or DIV's for layout

2009-06-12 Thread retro

Which will be lighter size wise if there are too many of them for
laying out components? Suggestions?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Dynamic ImageBundle selection ?

2009-06-12 Thread ciukes

Hi,

My application will by displaying a country flag depending on a locale
selected form list. All the flags are gathered within LocaleFlag
(extends ImageBundle).
I want to be able to get flag image out of LocaleFlag having only a
locale name string in hand.

List selection - Locale name string (e.g. uk) - LocaleFlag -
corresponding com.google.gwt.user.client.ui.Image instance.

So far I came up with a bit brute force spaghetti code solution. I
created LocaleName enumeration with getImage():Image abstract method.
Every enum value implements the method to return corresponding image
instance.
public enum CountryCode {
...
UK() {

@Override
public Image getImage() {
return 
LocaleFlags.Util.create().flagUnitedKingdom().createImage
();
}
};

abstract Image getImage();
...
}

With this enum in hand I can call CountyCode.valueOf(UK).getImage()
and this satisfies my requirement. What I don't like is massive amount
of copy-paste code I have to create ( getImage() implementation have
to be developed for every single enum value).

Can you guys come up with a better solution? Ideally that would be
LocaleFlag.getImage(UK) method that could internally discover,
create and return Image instance.

The constraint is we use ImageBundle. I'm aware of the fact the Image
itself could be used instead with an url created on-fly but that's not
an option. You should not concentrate on the subject itself (Locale
and flags) but on the solution (large enumeration code).

Regards,
Marcin.

--~--~-~--~~~---~--~~
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 in Eclipse spontaneously stopped working

2009-06-12 Thread skeemer

I'm running Leopard with Eclipse 3.4.2 and GWT 1.6.4. I was able
create the first Getting Started app and everything worked fine. I
then started creating the StockMarket app from the tutorial and now
hosted mode won't do anything on either project or a brand new empty
one. There is a crashlog being generated, but I have not clue what it
means.


Process: java [9015]
Path:/System/Library/Frameworks/JavaVM.framework/Versions/
1.5.0/Home/bin/java
Identifier:  java
Version: ??? (???)
Code Type:   X86-64 (Native)
Parent Process:  eclipse [8909]

Date/Time:   2009-06-11 23:18:26.927 -0700
OS Version:  Mac OS X 10.5.7 (9J61)
Report Version:  6
Anonymous UUID:  CEE66248-AC27-40A4-B86B-B4DBBAD18CA7

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: 0x000d, 0x
Crashed Thread:  0

Thread 0 Crashed:
0   ??? 0x0001000111c1 0 + 4295037377
1   ??? 0x00010001276f 0 + 4295042927
2   ??? 0x000100012a1c 0 + 4295043612
3   ??? 0x00010001104d 0 + 4295037005

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0041  rbx: 0x7fff5fbff5d8  rcx:
0x  rdx: 0x0014
  rdi: 0x000100014708  rsi: 0x2f7972617262694c  rbp:
0x7fff5fbff420  rsp: 0x7fff5fbff420
   r8: 0x910c55f2   r9: 0x  r10:
0x  r11: 0x
  r12: 0x0014  r13: 0x000100014708  r14:
0x0015  r15: 0x
  rip: 0x0001000111c1  rfl: 0x00010293  cr2:
0x000100014708

Binary Images:
0x7fff5fc0 - 0x7fff5fc2e643  dyld 97.1 (???)
b40847f1ce1ba2ed13837aeccbf19284 /usr/lib/dyld


Thanks,
Leo

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Can't debug in Eclipse

2009-06-12 Thread Max

Hi!

I just started using the gwt. I followed the instructions in the
getting started tutorial but i cant debug my application in eclipse.
If i click on Debug -  Stockwatcher Eclipse doesnt stop at any
Breakpoint. It doesnt even switch into the debug view. The Hosted Mode
Windows and the client app start but no debugging.

What is my mistake?

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



file importing in gwt

2009-06-12 Thread shalini

I'm new of GWT.I am doing a project using GWT. The project have two
module namely student and Recruiter. I want to import the file from
recruiter module into file of student module.how to do this.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



ClassNotFoundException when have reference to another project

2009-06-12 Thread ailinykh

Hello everybody!
I have simple GWT project. In servlet implementation I use class from
another Java project (it is regular class library).
Both of them are eclipse projects. Main project has reference to
library project, I can compile. But when I run it I get
ClassNotFoundException. If I export my library to jar file and put
that jar into WEB-INF/lib everything is fine. But my library project
is under development, I modify it frequently and wish my main project
picks up classes not jar file.
I tried to add library project to runtime class path, it helps when
run application locally, but if I upload application to google apps
engine I face the same problem.
What is the best way to handle this situation?

Thank you,
  Andrey

--~--~-~--~~~---~--~~
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: Can't debug in Eclipse

2009-06-12 Thread Rajeev Dayal
See http://code.google.com/p/google-web-toolkit/issues/detail?id=3724

Let me know if you have other questions.

On Fri, Jun 12, 2009 at 10:54 AM, Max max.blumena...@googlemail.com wrote:


 Hi!

 I just started using the gwt. I followed the instructions in the
 getting started tutorial but i cant debug my application in eclipse.
 If i click on Debug -  Stockwatcher Eclipse doesnt stop at any
 Breakpoint. It doesnt even switch into the debug view. The Hosted Mode
 Windows and the client app start but no debugging.

 What is my mistake?

 


--~--~-~--~~~---~--~~
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: GAE + GWT + password transfer

2009-06-12 Thread Shane

Maybe the question got lost in my research.

I'm not from a Web background (C++ + video games), so this may be
painfully obvious, but I want to know how people authenticate over non-
HTTPS connections, specifically using GAE (Java).

My point is that any app that stores any sort of user specific data
will need the user to log into their app.  I've had a look around at
various public sites, and watched the data going back and forth over
the wire, and the results are surprising.  A lot of public sites use
basic auth over http, which surprises me.  As I mention above, even
Twitter doesn't use HTTPS in its default state for users loggin in,
and same goes for their REST API.

So, what do people do?  I am going to look into OpenID and OAuth next.

Cheers,
Shane

On Jun 13, 12:57 am, Isaac Truett itru...@gmail.com wrote:
 I'm not sure what your question is. Do you have a specific question?

 You mentioned problems with HTTPS on GAE, which is probably a topic
 more appropriate for the GAE group. As far as GWT is concerned, I
 think you've already got the gist: HTTPS is a must-have for sending
 passwords over a public network in anything that can come close to
 being called a secure way.



 On Fri, Jun 12, 2009 at 7:46 AM, Shaneshanelstev...@gmail.com wrote:

  I really wish I had an answer to this.

  On Jun 10, 5:04 pm, Shane shanelstev...@gmail.com wrote:
  Sorry to keep talking to myself here, but I find what other sites are
  doing really interesting, and pertinent to GAE because there doesn't
  seem to be an agreed upon solution.

  Facebook uses a form for their logins that posts to an HTTPS url:

 https://login.facebook.com/login.php?

  So does Google for that matter.

  Twitter also allows forhttp://twitter.comandhttps://twitter.com,
  although the default is plaint http, probably because https is slower
  and more computationally expensive.

  So it looks like https is the most secure way, but I noticed that
  Google App Engine doesn't allow SSL unless you are using a
  *.appspot.com domain.

 http://code.google.com/appengine/docs/python/config/appconfig.html#Se...

  So if I have have my blah.mydomain.com pointing via DNS CNAME, to my
  blah.appspot.com, I can't usehttps://blah.mydomain.com.

  All this just to not send the password to the server plain text.  :|

  Cheers,
  Shane

  On Jun 10, 4:15 pm, Shane shanelstev...@gmail.com wrote:

   I've actually just noticed that Twitter itself uses Basic Auth:

  http://apiwiki.twitter.com/Authentication

   It says OAuth is in development, but that Basic Auth won't be going
   anywhere for the foreseeable future.

   The trouble is, Basic Auth is insecure:

  http://en.wikipedia.org/wiki/Basic_access_authentication

   Although the scheme is easily implemented, it relies on the
   assumption that the connection between the client and server computers
   is secure and can be trusted. Specifically, the credentials are passed
   as plaintext and could be intercepted easily. The scheme also provides
   no protection for the information passed back from the server.

   I am going to look around at other public web API's, but if a site as
   large as Twitter is content to use this system, should I be all that
   worried?

   I would really like to know what experienced web programmers do here,
   either in GAE+GWT, or just generally.

   Cheers,
   Shane

   On Jun 10, 1:02 am, Shane shanelstev...@gmail.com wrote:

I've seen some pretty heated debates around the discussion boards
about this, but I haven't seen a solution that people decide on.

Simply put, any application that I want to write will likely perform
some sort of mashup between other services, like Twitter.

For me to do anything interesting, I need the user to enter their
Twitter username and password into a GWT client-side control on my
site, which I then send back to my app on running on GAE.  I'll then
use the password to log into Twitter with their credentials and do
whatever if is I want to do, all the while not saving the users
password in plain text anywhere.  I have no interest in holding onto
anyone's credentials.

So what is the best way for me to do this?  I am hearing people say
that anything short of HTTPS is a waste of time.

I guess this also becomes the larger issue of authentication
generally, and I'm surprised there are still such heated discussions
on the subject.  I thought it'd be a done deal by now.

So, if anyone could point my in the right direction, in the context of
GWT+GAE, I'd much appreciate it.
--~--~-~--~~~---~--~~
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 

Getting auto scroll

2009-06-12 Thread RKK

Hi,

I am new to GWT  GWT-EXT

I am using GWT and GWT-EXT. I use absolutepanel inside a GWT-EXT
panel. I use drag and drop. My requirement is to get automatic scroll
when I drop the widgets at the edges of absolutepanel. If I do not set
sizes for GWT-EXT panel (rather mention % size) and no size mentioned
for absolute panel. I do get auto scroll but when drag the drop the
first element I get exception that absolutepanel has zero size.

So as temp solution, I set GWT EXT panel size as 2000, 2000 to
accommodate more number of dnd widgets. Here the problem is when we
scroll absolutepanel towards left or bottom, placing the dropped
widgets at drop location giving me problems.
The way I am calculating x, y coordinates for drop target is, get
screen coordinates from drop event (x, y), deduct absolutepanel
absolute left and absolute  right (say x1 and y2),

I try to place dropped object at x2 = x-x1 and y2=y-y1. This
calculation makes dropped targets placed at wrong position when
absolutepanel is scrolled left.

Any help is appreciated.


--~--~-~--~~~---~--~~
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: async code and the callback-chain

2009-06-12 Thread Ravi

Daniel,
First thing, With Asynchronous call you should never get the Stack
over flow as Asynchronous calls are running in different thread and
your function retursn back before calls finish.
But i think you have genuine problem of asynchronous call
chains...where writing code become too problematic.
I had the same issue and long back i started this discussion that
having synchronous calls will be a good idea too., so that you don't
need to write async callback and leave it up to the developer if they
want to use synchronous calls.

But that time then i had to create a single class with one boolean
variable for each kind of call and correpsonding data.
So whenevr a call finishes i call the function of that class as

MySIngleTonCLass.setLoginCallFNished(true)
MySIngleTonCLass.setUser(User)
MySIngleTonCLass.refresh();

if some other class finishes then i call something like

MySIngleTonCLass.setDataRetrivedCall1(true)
MySIngleTonCLass.setDataRetrived1(someData)
MySIngleTonCLass.refresh();

MySIngleTonCLass.setDataRetrivedCall2(true)
MySIngleTonCLass.setDataRetrived2(someData2)
MySIngleTonCLass.refresh();

and then had to write my login in MySIngletonClass to update UI. ( my
problem area was updating the UI)

so i do something like

if(getLoginCallFNished() and user != null)
create Logout Link
else
create loginLink

if(getDataRetrivedCall1() and data1!= null)
Display the Data
else
Display No Data found

So yopu need to see if such kind of solution will fir to your problem.

But definitely asynchrnous call WILL not give you stack overflow. It
must be your code somewhere.

Ravi



On Jun 12, 2:14 pm, daniel d.brelov...@googlemail.com wrote:
 hi all,

 I hope someone can help to find a solution to the following problem:

 I have some complex code that may need data from the server. When I
 make a request I get the data asynchronous, so I have to provide a
 callback to handle the response. Now all the code that use this
 function need a callback too. But this leads to very long chains of
 nested callbacks. Especially when I need to call async methods in a
 loop and every call may depend on the previous, I can`t find a way to
 do this without calling the method recursive in the onSuccess of the
 callback. But this way I get a StackOverflow very fast.

 I can`t request all data first and run the code that needs it after
 that, cause which data is needed may depend on the data I already got.

 I have really no idea - hopefully you have

 thx 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
-~--~~~~--~~--~--~---



Re: Request after request.

2009-06-12 Thread Rvanlaak

Did you've found a sollution for your case?

And, did you already take a look to GWTEventService? :)

On 27 apr, 06:53, davidst...@gmail.com davidst...@gmail.com wrote:
 I mean this : getThreadLocalRequest().getSession().getId()
 gives me the same id for two different clients that are opened.
 Someone told me that maybe two browsers share a cookie cache/address
 space
 and because of that they see the same cookie.
 I googled this theme about two weeks but i did not find out how to
 separate them .
 So maybe this affects in some way the story with requests, maybe there
 is only one thread openes for two clients.

 On Apr 26, 11:07 pm, Vitali Lovich vlov...@gmail.com wrote:

  On Sun, Apr 26, 2009 at 3:29 PM, davidst...@gmail.com
  davidst...@gmail.comwrote:

Are you sure you're not doing a notify?  Maybe you actually receive an
event?  InterruptedException (from memory, haven't looked at the 
javadoc)
get's called when wait times out - if you call notify, it'll wake up the
thread normally.

   That's exactly what i do there, notifying.
   Forgive my newbieness, i thought notify should cause
   InterruptedException 
   Minus one problem.

   But i still can't understand what is going on with Hosted Mode.
   There is something else, new session does not open for new client.
   Maybe it is something local on my comp, maybe there is something
   to configure ?

  What do you mean by new session (I hate this term in general because so many
  things have sessions that the term loses all meaning).  Is there some
  specific session id you are referring to?  Threads?

   On Apr 24, 6:55 am, Vitali Lovich vlov...@gmail.com wrote:
On Thu, Apr 23, 2009 at 2:05 PM, davidst...@gmail.com
davidst...@gmail.comwrote:

 I tested both FF and IE6 . I'm pretty surprised too of the results, so
 I'm still searching the problem.

 Are you calling getEvents (the one
  that sends of the request to the server) on the client-side more 
  than
 once?

 No, i checked it after you said that two requests is the maximum.
 I call the getEvents  only once, after logging in.
 There is also something weird happens when it runs in browser .
 In the getEvents on server side in this part

I can't imagine a case where the server side behavior will change if you
   use
hosted mode or a browser.  I mean hosted mode runs in the same VM, but
   it's
a different thread.

try

 {
       synchronized( user )
       {
               user.wait( 20*1000 );
       }
 }

 catch ( InterruptedException ignored )
 {
         System.out.println(Server interupted, sending response);

 }

 when interrupted the message is not printed. It does not enter the
 catch clause at all.

Are you sure you're not doing a notify?  Maybe you actually receive an
event?  InterruptedException (from memory, haven't looked at the 
javadoc)
get's called when wait times out - if you call notify, it'll wake up the
thread normally.  Or is the other way around?  In any case, put the 
print
after your catch - that's where it belongs.

But definitely, instrument getEvents something like this on the server
   side:

System.out.println(user +  waiting for events);

try {
   // code for getEvents} finally {

   System.out.println(user +  responding to client);

}

That'll help you figure out what your server is doing.

Also, you can usehttp://
   code.google.com/p/google-web-toolkit/wiki/LightweightMetricsDe...to
inject profiling of your RPC calls to figure out what your browser is
actually doing (in case you miss something).

 I've added some print after wait in the try
 clause,  and when the server interrupted the message in the try clause
 printed.
 Is it magic or something ? )))

 On Apr 23, 12:01 pm, Vitali Lovich vlov...@gmail.com wrote:
  Seriously doubt it's a hosted mode mode issue.  Which browser did 
  you
 test
  web-mode with?  Hosted mode actually launches a version of IE6, so
   using
 FF
  or IE7 may present different issues (for instance they might have a
 raised
  AJAX connection limit)

  The issue is purely on the client side.  Are you calling getEvents
   (the
 one
  that sends of the request to the server) on the client-side more 
  than
 once?

  On Thu, Apr 23, 2009 at 4:44 AM, davidst...@gmail.com
  davidst...@gmail.comwrote:

   Well, it really looks like a bug, cause when i
   compile it to browser it works properly ( meanwhile  ).
   Thanks for your answers.

   On Apr 23, 10:05 am, Salvador Diaz diaz.salva...@gmail.com
   wrote:
As Vitali said, there are some common pitfalls when trying to
implement something along the lines of whatyou're trying to do.
There have been plenty of discussions related to chat
   implementations
   

Re: Can't debug in Eclipse

2009-06-12 Thread Max

Wow! Thx for the fast reply! Now debbuging works perfectly!

On 12 Jun., 17:40, Rajeev Dayal rda...@google.com wrote:
 Seehttp://code.google.com/p/google-web-toolkit/issues/detail?id=3724

 Let me know if you have other questions.

 On Fri, Jun 12, 2009 at 10:54 AM, Max max.blumena...@googlemail.com wrote:

  Hi!

  I just started using the gwt. I followed the instructions in the
  getting started tutorial but i cant debug my application in eclipse.
  If i click on Debug -  Stockwatcher Eclipse doesnt stop at any
  Breakpoint. It doesnt even switch into the debug view. The Hosted Mode
  Windows and the client app start but no debugging.

  What is my mistake?
--~--~-~--~~~---~--~~
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 in Custome browswer.

2009-06-12 Thread sajil

Hi readers,

I want to know how can I run a GWT application in Custom browser in
Hosted mode. Here is what exactly I am looking for:

I have an application which interacts with the client machine through
window.external calls. We are using a IE 6 in a custom container for
getting this done. I am working on a project to convert this
application to a GWT app and want to use the same container inside the
GWT hosted browser. Is it possible to use a custom browser as my
hosted browser in GWT? Please let me know.

Thanks,
Sajil Koroth

--~--~-~--~~~---~--~~
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 architecture MVP/EventBus (mentioned at Google I/O)

2009-06-12 Thread Benju

Thanks for the reply I have some further thoughts...

Looking at the source code for the event handling in GWT 1.6 it seems
the fundamental difference is as follows...

Old way with listeners

I am adding this event listener to this component, when the listener
is triggered I know the source must be this component as it is the
only one added to the listener list

New way with listeners

I am adding this handler to this component, when something happens to
the component firing and event I will receive a notification, the
event itself will contain enough information such as the source or
custom properties which let me determine how to do something.

The more I think about the architecture outlined by the tech talk the
smarter it seems. For example by using this event driven application
you can swap out the UI much easier.  Instead of having a button run
an RPC which on result runs code that that one component you have a
button trigger an RPC request which fires back to a central event
handler which then notifies all interested parties regardless of which
component initiated the request.  When swapping out the UI for
browsers to an iPhone specific  version it would be much much easier
to just have the exact same handlers and events but swap out the
components which render things to the display.

In my readings last night I discovered another term for what is
outlined in the EventBus idea was coined by Martin Fowler as Event
Collaboration http://martinfowler.com/eaaDev/EventCollaboration.html.

In the video at 27:3# Ray Ryan shows some MVP code which seems to tie
in with this it uses methods like HasClickHandlers to define the
interface for the UI.  Does anybody know if this is typical of MVP or
a flavour cooked up by Google?  I am having a hard time finding
quality resources describing MVP in the sort of context appropriate to
GWT.



On Jun 12, 7:39 am, Thomas Broyer t.bro...@gmail.com wrote:
 On 11 juin, 21:34, Benju b...@fastcastmedia.com wrote:

  I did not attend Google I/O but as soon as the video Google I/O 2009
  - Best Practices for Architecting GWT App (http://www.youtube.com/
  watch?v=PDuhR18-EdM) was posted I reviewed it and was a bit confused
  by the idea of an EventBus.

 For my part, I was pleased to see it as a best practice, as that's
 what I'm thinking about for nearly a year (would require a huuge
 refactoring of our app, so it's still just an idea floating in the
 air)
 (I didn't watch the video, just looked at the slides)

  From what I can tell the idea is that UI widgets requiring data from
  the server are able to fire off requests for some form of data like
  void getTransactionsForAccount(Account acct) then at some unknown
  later time (ms to seconds ussually) when a response comes in from the
  RPC call the eventbus is what actually directly recives the data and
  then it is dispatched

 Well, not necessarily, though yes, that's what they said at Google I/
 O. One of the reasons is that there are probably more than a single
 place where you use that same data in your app (in GMail it could be
 the list of mails, the unread count for the box and/or label(s), and
 the conversation view of course). That way, all places are informed,
 wherever the initial request came from.



  Client UI: Hey call some RPC method with these parameters, my
  AsyncCallback is this EventBus thing

  ...some unknown time passes while the server does magic...

  Client Event Bus: A response came in of type X/Y/Z I should fire an
  event to all interested parties

  Client UI: According to this event I just recieved some of my UI code
  needs to change

  A few things are still very hazy for me...

  1- What is missing here is when would the Client UI typically
  subscribe/unsubscribe from the event bus.  If this were a desktop
  application I would simply use weak reference so I would not have to
  unsubscribe my UI manually to prevent a memory leak.

 As with any event, I'd subscribe in the onLoad and unsubscribe in the
 onUnload (would be even better if there was a destructor, so that even
 when not attached to the DOM, your widget could receive events and
 enter a dirty state, so that when it is attached again to the DOM it
 knows if it has to refresh or not)

  2- Is there some EventBus code I should be using that already exists
  in the GWT SDK?  Is this the same code that is used for handling
  widget events like clicking a button?

 Wasn't the code shown in the slides? (page #73 in the PDF, the event
 bus is just a HandlerManager (GWT 1.6 and upwards))

  3- Would you typically have one eventbus code for everything?

 If your event bus is just a HandleManager as in the presentation's
 sample code, then yes.

 You would probably have one event bus (instance) for the whole app,
 but you could also use some kind of HMVC (HMVP?) with component-wide
 event buses.
 (I'd rather have a single event bus though, and just use component-
 specific events)

  4- How does this tie in with the MVP pattern?


Incorporating existing jars without modularizing them?

2009-06-12 Thread watsonta

I'm building a proof-of-concept GWT Google Map application that would
utilize an existing Hibernate business model for data retrieval. As
soon as I reference and use a class from the business model into the
application, the AppEngine server complains about not being able to
find the source code for that class. If I pull the class into the GWT
project, then it begins complaining about all the classes it
references. It's a bottomless rabbit hole.

I'm working in Eclipse. I have tried including the business model as a
project in the build path, as well as referencing it's distributable
jar as an external jar. Same result either way.

What am I doing wrong? I can't rebuild every external resource as a
GWT module.

--~--~-~--~~~---~--~~
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 Component Works in Hosted, but not in Tomcat.

2009-06-12 Thread Patrick

I am new to GWT as of 3 weeks.  I have a component running in hosted
mode.  It is a table.  It works in hosted mode, but not when I deploy
it to tomcat.  My other components work, but it is not visible.  I
tried it in all browsers.  I am deploying the compiled javascript.  I
see the javascript in the web app directory in the right place.  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: 404 error: gwt server can not be found

2009-06-12 Thread Braheem Sikiru

Hi

How about removing the foward slash before searchService i.e. 
something like this instead:

String moduleRelativeURL = GWT.getModuleBaseURL()
+ searchService;


Had similar problems sometimes, and that worked for me.  According to 
the docs, GWT.getModuleBaseURL() if non-empty, is guaranteed to end 
with a slash.


--~--~-~--~~~---~--~~
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: async code and the callback-chain

2009-06-12 Thread daniel

Hi Ravi,

thanks for your reply.

You`re right. ts not the async call itself that leads to the
stackoverflow. its because of the callback chain that comes when a
large amount of code depends directly or indirectly on the callback.

supposed i have some simple code like this:

public Value doSomething(Value v){
 Value newV = getValue();
 //do something with the values
 //e.g. add them
 return newV.add(v);
}

public Value execute(){
  Value v1 = getValue();
  Value v2 = doSomething(v1);
  Value v3 = doSomesting(v2);
  return doSomething(v3);
}



everything is fine with this... but when i decide that getValue()
should request the Value from the Server i have to rewrite the code
to:

private void doSomething(final Value v, final AsyncCallbackValue
callback){
getValue(new AsyncCallbackValue(){
public void onSuccess(Value result) {
//do something with the values
//e.g. add them
callback.onSuccess(result.add(v));
}
public void onFailure(Throwable caught) {
callback.onFailure(caught);
}
});
}

public void execute(final AsyncCallbackValue callback){
getValue(new AsyncCallbackValue(){
public void onSuccess(Value result) {
doSomething(result, new AsyncCallbackValue(){
public void onSuccess(Value result) {
doSomething(result, new 
AsyncCallbackValue(){
public void onSuccess(Value 
result) {
doSomething(result, new 
AsyncCallbackValue(){
public void 
onSuccess(Value result) {

callback.onSuccess(result);
}
public void 
onFailure(Throwable caught) {

callback.onFailure(caught);
}
});
}
public void onFailure(Throwable 
caught) {

callback.onFailure(caught);
}
});
}
public void onFailure(Throwable caught) {
callback.onFailure(caught);
}
});
}
public void onFailure(Throwable caught) {
callback.onFailure(caught);
}
});
}

of course i would not write such code, but it illustrates the problem.
The chain of callbacks gets longer with every call to doSomething.
Imagine it should be called in a loop for 100 times or more ... than a
stackoverflow occures. And even if getValue doesn`t need to aks the
server every time (maybe most values are cached on clientside) the
code must be written in this way. I can reduce the amount of written
code by providing a recursive method for such calls, but i don't find
a way to get rid of the callback chain.

On 12 Jun., 18:06, Ravi ping2r...@gmail.com wrote:
 Daniel,
 First thing, With Asynchronous call you should never get the Stack
 over flow as Asynchronous calls are running in different thread and
 your function retursn back before calls finish.
 But i think you have genuine problem of asynchronous call
 chains...where writing code become too problematic.
 I had the same issue and long back i started this discussion that
 having synchronous calls will be a good idea too., so that you don't
 need to write async callback and leave it up to the developer if they
 want to use synchronous calls.

 But that time then i had to create a single class with one boolean
 variable for each kind of call and correpsonding data.
 So whenevr a call finishes i call the function of that class as

 MySIngleTonCLass.setLoginCallFNished(true)
 MySIngleTonCLass.setUser(User)
 MySIngleTonCLass.refresh();

 if some other class finishes then i call something like

 MySIngleTonCLass.setDataRetrivedCall1(true)
 MySIngleTonCLass.setDataRetrived1(someData)
 MySIngleTonCLass.refresh();

 MySIngleTonCLass.setDataRetrivedCall2(true)
 MySIngleTonCLass.setDataRetrived2(someData2)
 MySIngleTonCLass.refresh();

 and then had to write my login in MySIngletonClass to update UI. ( my
 problem area was updating the UI)

 so i do something like

 if(getLoginCallFNished() and user != null)
 

Re: GWT in Custome browswer.

2009-06-12 Thread Paul Robinson

http://code.google.com/p/google-web-toolkit/wiki/UsingOOPHM

sajil wrote:
 Hi readers,

 I want to know how can I run a GWT application in Custom browser in
 Hosted mode. Here is what exactly I am looking for:

 I have an application which interacts with the client machine through
 window.external calls. We are using a IE 6 in a custom container for
 getting this done. I am working on a project to convert this
 application to a GWT app and want to use the same container inside the
 GWT hosted browser. Is it possible to use a custom browser as my
 hosted browser in GWT? Please let me know.

 Thanks,
 Sajil Koroth

 

   

--~--~-~--~~~---~--~~
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: Dynamic ImageBundle selection ?

2009-06-12 Thread Thomas Broyer


On 12 juin, 12:36, ciukes ciu...@gmail.com wrote:

 My application will by displaying a country flag depending on a locale
 selected form list. All the flags are gathered within LocaleFlag
 (extends ImageBundle).
 I want to be able to get flag image out of LocaleFlag having only a
 locale name string in hand.

Er, let's start by saying that language/locale is distinct from
country. Using a flag to represent a locale is hardly a good idea (it
can be, in cases you're actually selecting a region/country and not a
language, for instance have distinct choices for GB and US).

 List selection - Locale name string (e.g. uk) - LocaleFlag -
 corresponding com.google.gwt.user.client.ui.Image instance.

 So far I came up with a bit brute force spaghetti code solution. I
 created LocaleName enumeration with getImage():Image abstract method.
 Every enum value implements the method to return corresponding image
 instance.
[...]
 With this enum in hand I can call CountyCode.valueOf(UK).getImage()
 and this satisfies my requirement. What I don't like is massive amount
 of copy-paste code I have to create ( getImage() implementation have
 to be developed for every single enum value).

 Can you guys come up with a better solution? Ideally that would be
 LocaleFlag.getImage(UK) method that could internally discover,
 create and return Image instance.

The best way would be to make a new generator (which would extend or
call the ImageBundleGenerator). In this case, I would personally add
an ImageBundleWithLookup interface (extends ImageBundle) and a
corresponding generator, same as how ConstantsWithLookup relates to
Constants.
Basically, the generator would implement the lookup(String) method
(from ImageBundleWithLookup) as (for example):
   private HashMapString,AbstractImagePrototype lookupCache;
   public AbstractImagePrototype lookup(String key) {
  AbstractImagePrototype ret = null;
  if (lookupCache == null) {
 lookupCache = new HashMapString, AbstractImagePrototype();
  } else {
 ret = lookupCache.get(key);
 if (ret != null) {
return ret;
 }
  }
  if (UK.equals(key)) {
 ret = this.UK();
 lookupCache.put(key, ret);
  } else if (...) {
  ...
  }
  return ret; // would return null if not found
   }

--~--~-~--~~~---~--~~
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: New Event Handling and Composites

2009-06-12 Thread Thomas Broyer



On 12 juin, 17:24, Buzzterrier terry.je...@gmail.com wrote:
 I am just not getting the new Event handling.  I have went over every
 example I can find, but it is not clicking. How do you let composite
 widgets subscribe to events from other composite widgets? From reading
 it sounds like there is a HandlerManager that you register with by
 implementing the HasxxHandlers interface, but I cannot piece together
 how the Class that creates the event fires it off to the subscribers.

 For example I have the following SimpleWidget that extends Composite
 that contains a single button. I have another Composite widget that
 wishes to be notified when that button is clicked. Can someone fill in
 the blanks for me?

 (Note I did not attempt to add the event handlers because I do not
 want to confuse others who may have the same issue.)

Using ClickHandler and ClickEvent, because it's easier, but if you
look at the code in com.google.gwt.event.logical.shared.* you'll see
how to make a new event for your specific case.

 public class SimpleWidget extends Composite{

implements HasClickHandlers


         private Button button;

         public SimpleWidget() {
                 FlowPanel fp = new FlowPanel();
                 button = new Button(Click me);
                 //With listeners I would create an anonymous inner class
                 //that fires the click events to registered listeners.
                 //I don't know how to fire events for handlers
                 //button.addClickHandler(handler);???

button.addClickHandler(new ClickHandler() {
   public void onClick(ClickEvent event) {
  SimpleWidget.this.fireEvent(event);
   }
});

                 fp.add(button);
                 initWidget(fp);
         }

public HandlerRegistration addClickHandler(ClickHandler handler) {
   // do not call addDomHandler as it would sinkEvent too
   // with addHandler, only fireEvent can fire the event
   this.addHandler(handler, ClickEvent.getType());
}

 }

 public class DoSomething extends Composite{

                 public DoSomething() {
                         FlowPanel fp = new FlowPanel();
                         SimpleWidget simple = new SimpleWidget();

simple.addClickHandler(my_handler);

                         fp.add(simple);
                         initWidget(fp);
         }



 }
--~--~-~--~~~---~--~~
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 best Practices - JS Library Wrappers Overlay Types

2009-06-12 Thread Bobby

Ok, so time to look at class structure. In the JS API we have for
example:

com.google.gwt.gdata.client.calendar.CalendarFeed
  com.google.gwt.gdata.client.Feed
 com.google.gwt.gdata.client.atom.Feed

We won't be able to implement this structure with overlay types
because all methods are final, so for example CalendarFeed can't
override methods of its parent feed classes - it does need to override
methods to specialize the parameter and return types.

Most of the classes in the following namespaces are only used
internally.
com.google.gwt.gdata.client
com.google.gwt.gdata.client.atom

The approach seems to be to not have any class in those namespaces
used directly. For example, the Calendar namespace does not use
com.google.gwt.gdata.client.Who, instead it specializes that class as
com.google.gwt.gdata.client.calendar.CalendarWho and uses that.

So i have the following options:
1. leave the parent classes around, but remove any methods implemented
by child classes (this leaves polymorphism in place, but it's not of
much use, since these classes will be pretty much empty).
2. convert the parent classes to interfaces (this gives us useful
polymorphism)
3. remove these parent classes from the GWT API.

Option 1 is not very useful.
Option 2 works the best but perhaps adds too many interfaces.
Option 3 removes all of these internal classes, which gets rid of
polymorphism. With this approach, the GWT library would just have the
leaves of the GData API's class tree, which would result in a very
thin interface.

I'm leaning towards Option 2 at this time.

Bobby

On Jun 6, 10:45 pm, Bobby bobbysoa...@gmail.com wrote:
 The GoogleAccounts module is working well and is pretty close to what
 it needs to 
 be:http://code.google.com/p/gwt-gdata/source/browse/trunk/gdata/src/com/...

 I was able to create jUnit test cases that impersonate user
 authentication - the GData JS API AuthSub implementation performs
 authentication by redirecting to a Google Accounts page, performing
 auth and then redirecting back to the referring URL, passing along a
 session token which gets stored in a cookie. To make the
 authentication work i am setting the cookie directly which has the
 same effect but allows the jUnit tests to work 
 smoothly:http://code.google.com/p/gwt-gdata/source/browse/trunk/gdata/test/com...

 Now i can write unit tests for the services which read/write data with
 a test account.

 I'm debating whether i should split the GWT-Gdata module into multiple
 sub modules. For example, instead of having one large GWT module at
 com.google.gwt.gdata, have com.google.gwt.gdata be a base module
 inherited by specialized modules such as:

 com.google.gwt.gdata.calendar
 com.google.gwt.gdata.blogger
 com.google.gwt.gdata.contacts
 com.google.gwt.gdata.finance
 ...etc

 The reason is that, from my experience, you end up using GData to
 interact with either Calendar or Documents for example, rather than
 all of the GData systems, so it seems more natural to have a module
 per GData system.

 Bobby

 On May 30, 10:21 pm, Bobby bobbysoa...@gmail.com wrote:



  I eliminated the Date errors by making use of a 
  DateHelper:http://code.google.com/p/gwt-gdata/source/browse/trunk/gdata/src/com/...

  Here's how i'm using 
  it:http://code.google.com/p/gwt-gdata/source/browse/trunk/gdata/src/com/...

  I convert Dates to milliseconds since 1970 before passing them between
  Java and JS.

  Bobby

  On May 30, 5:04 pm, Eric Ayers zun...@google.com wrote:

   I don't think GWT does anything useful when you pass a Java Date
   object into JSNI.  You may want to pass the # of milliseconds since
   1970 instead.

   On Sat, May 30, 2009 at 2:03 AM, Bobby bobbysoa...@gmail.com wrote:

I'm seeing some weird behavior whenever java.util.Date is used. The
following DateTime class in GData wraps around a date:
   http://code.google.com/p/gwt-gdata/source/browse/trunk/gdata/src/com/...

The newInstance method receives a java.util.Date.:

 public static native DateTime newInstance(Date date, boolean
dateOnly) /*-{
    return new $wnd.google.gdata.DateTime(
      date,
      dateOnly
    );
  }-*/;

Whenever i call this method it fails. If i replace it with the
following, then it works:

 public static native DateTime newInstance(Date date, boolean
dateOnly) /*-{
    return new $wnd.google.gdata.DateTime(
      new Date(), //pass static JS date instead
      dateOnly
    );
  }-*/;

So the date object passed in from Java causes a failure whereas a
regular JS date doesn't. I looked at the Date parameter passed in from
Java and it looked like a regular JS date - when printed, a regular
date string is displayed.
In web mode jUnit hangs on newInstance(new Date(), true/false) because
a JS exception occurs. In hosted mode the following exception is
thrown:

[WARN] Malformed JSNI reference 'getFullYear'; expect subsequent
failures

Re: Passing bag of Serializable objects to RPC

2009-06-12 Thread Daniel Jue

Ah, I figured out what I was doing wrong.  I am using GXT, and my
pojo/bean was being used as a runtime generated class that implemented
gxt's BeanModel.  My ignorance on exactly how this worked prevented me
from refactoring correctly.   I had been trying to make a genericized
form component, extending a FieldSet, and now it works like this:

public class SelectorFieldSetT extends BeanModel, B extends Serializable
extends FieldSet {

private GridT grid;
private CheckBoxSelectionModelT cbsm;

public SelectorFieldSet(String heading, ListColumnConfig 
columnConfigs,
ListStoreT storeIn) {..make a grid, add buttons, 
etc..}
...bunch of stuff...

public ArrayListB getSelectionList() {
final ArrayListB a = new ArrayListB();
for (T model : grid.getSelectionModel().getSelectedItems()) {
if (model != null) {
a.add((B) model.getBean());
}
}
return a;
}
}

So now I have a builder like this:
public static SelectorFieldSetBeanModel, MyBean buildMyBeanSelector() {
...do the Rpc Proxy / list loader stuff
...set up the columns
 return new SelectorFieldSetBeanModel, MyBean(Pick My Beans!,
configs, store);
}


Then in my onSubmit() method, I can do something like this:
ReportPojo report = new ReportPojo(TheNameOfTheReport);
report.set(selectedMyBeans, myBeanSelector.getSelectionList());
ReportServiceAsync.RPC.runReport(report, callback);



On Thu, Jun 11, 2009 at 2:15 PM, Daniel Jueteamp...@gmail.com wrote:
 Hi, I've read some past emails on this subject, but I want to know if
 anyone has a best practice for this.

 Lets say I have MyService(HashMapString,Serializable reportBag) .
 I've read it's advisable to narrow down the Serializable to a type
 that has a smaller set of implementations, such as using GXT2's
 serializable BeanModel or making up a marker like SerializaleDTO (or
 for that matter, the old IsSerializable)  I'd be willing to do this,
 except I'd like to put ArrayListBeanModel in my
 HashMapString,Serializable reportBag

 When I start stuffing things in my bag from widgets like selections
 from grids, etc, these my come back as ArrayListBeanModel.

 This means if I want to do

 reportBag.put(StuffFromWidget1,myGrid.getSelection());
 it won't work unless myGrid.getSelection() is null.

 I tried wrapping ArrayListBeanModel in a new implementation of
 BeanModel, but it still did not work (same error, even after
 cleaning).

 I guess what I'm looking for is a way to sent an object with an
 arbitrary number and combination of beans and lists of beans, where a
 bean is a Serializable object.  I'd prefer to use some sort of map, so
 I can look up the objects in my service impl.

 i.e.
 reportBag = new HashMapString, Serializable();
 reportBag.put(SomeText,JustText);
 reportBag.put(SomeBean,imaSerializableBean);
 reportBag.put(ListOBeans,thatListOBeansFromAWidget);
 reportBag.put(OneMoreBean,forGoodMeasureBean);
 etc etc

 then

 MyServiceAsync.RPC.runReport(reportBag, callback);

 Is this possible?


 I know topics on serialization get hashed and rehashed here and I sure
 don't want to bother people with noob questions.  I must have read 40
 threads on it today!  Now I'm off to google code search to try and
 find something in the wild...


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



How can I add a MouseOutHandler to a FlexTable cell?

2009-06-12 Thread Eduardo Nunes

Well, the subject says everything, I would like to know how can I add
a MouseOutHandler to a FlexTable cell. I tried a lot of things but
none of them with success. I tried a wrap class:

private class FlexTableTd extends Widget implements HasMouseOutHandlers,
HasMouseOverHandlers {

public FlexTableTd(Element element) {
setElement(element);
}

public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) {
return addHandler(handler, MouseOutEvent.getType());
}

public HandlerRegistration
addMouseOverHandler(MouseOverHandler handler) {
return addHandler(handler, MouseOverEvent.getType());
}
}

and I tried

FlexTableTd td = new FlexTableTd(table.getFlexCellFormatter().getElement(0, 0));
td.addMouseOverHandler(...);

but it doesn't work.

-- 
Eduardo S. Nunes
http://e-nunes.com.br

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



no source available

2009-06-12 Thread Peter Kirklewski
Hi Guys

I created an application, it starts and shows the two standard windows 
but there are some errors:

No source is available for type 
org.timepedia.client.browser.Chronoscope; did you forget to inherit 
required module ?

The answer is no - I didn't as my HelloChart.gwt.xml file contains: 
inherits name='org.timepedia.chronoscope.Chronoscope'/

Also I imported Chronoscope.jar which contains 
org.timepedia.client.browser.Chronoscope.class

But why is it looking for source ?

I'm not sure where the problem is.

Can you help please ?

Regards

Peter



--~--~-~--~~~---~--~~
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: Guice 2.0 servlet example

2009-06-12 Thread Arthur Kalmenson

I'd try asking your question on the Google Guice group:
http://groups.google.com/group/google-guice?pli=1

--
Arthur Kalmenson



On Wed, Jun 10, 2009 at 2:40 AM, Dariuszdarius...@gmail.com wrote:

 I'm trying to get the example of guice 2.0 running, but I can't figure
 out why it's not working. I try to do the same thing as on this page:
 http://code.google.com/p/google-guice/wiki/ServletModule


 Here is what I got:

 web.xml

 web-app id=WebApp_ID version=2.4 xmlns=http://java.sun.com/xml/
 ns/j2ee xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
        display-nameguicy/display-name

        filter
                filter-nameguiceFilter/filter-name
                
 filter-classcom.google.inject.servlet.GuiceFilter/filter-class
        /filter

        filter-mapping
                filter-nameguiceFilter/filter-name
                url-pattern/*/url-pattern
        /filter-mapping

        listener
                listener-classcom.test.MyGuiceServletConfig/listener-class
        /listener

 /web-app


 MyGuiceServletConfig.java

 import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.servlet.GuiceServletContextListener;

 public class MyGuiceServletConfig extends GuiceServletContextListener
 {

       �...@override
        protected Injector getInjector() {
                return Guice.createInjector( new MyServletModule() );
        }
 }


 MyServletModule.java

 import com.google.inject.servlet.ServletModule;

 public class MyServletModule extends ServletModule {

       �...@override
        protected void configureServlets() {
                serve(/*).with( MyServlet.class );
        }

 }


 MyServlet.java

 import java.io.IOException;
 import java.io.PrintWriter;

 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;

 import com.google.inject.Singleton;

 @Singleton
 public class MyServlet extends HttpServlet {

   �...@override
    public void doGet(HttpServletRequest req, HttpServletResponse
 resp)
                    throws ServletException, IOException {
        resp.setContentType(text/html);
        PrintWriter writer = resp.getWriter();
        writer.printf(h1Welcome to the application!/h1 );
        System.out.println( ...testing );
        resp.setStatus( HttpServletResponse.SC_OK );
    }

        /**
         * Process the HTTP Post request
         */
        public void doPost( HttpServletRequest request, HttpServletResponse
 response ) throws ServletException, IOException {
                System.out.println( inside MyServlet class );
        }
 }

 I'm not getting anywhere and I don't have anything in my log file. I
 would really appreciate any help. I think th approach of Guice is
 excellent and would love to use it for my applications.

 Thanks a lot 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
-~--~~~~--~~--~--~---



Re: can't run javax adn org/w3c library and bigDecimal in gwt - 1.6 project

2009-06-12 Thread Sumit Chandel
Hi Linda,
The reason why you get the import javax.xml cannot be resolved and other
problematic import resolutions is because these are not supported in the GWT
emulated JRE (see doc link below). As the GWT code you right gets
cross-compiled into JavaScript that will run in the browser, there is no
meaningful equivalent for the types you imported in the JS world.

GWT Emulated JRE:
http://code.google.com/webtoolkit/doc/1.6/RefJreEmulation.html

However, it seems like for the types of things that you wanted to do with
those packages (work directly with the DOM, you can use the equivalent DOM
and XML parsing APIs linked below.

DOM API:
http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/user/client/DOM.html

XMLParser API:
http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/xml/client/XMLParser.html

As for the gwt-math project supporting doubleValue() on the BigDecimal type,
I don't think the team working on the project has had a chance to get around
to adding support for it just yet (see Issue #9 below on the gwt-math issue
tracker).

Issue #9:
http://code.google.com/p/gwt-math/issues/detail?id=9

Hope that helps,
-Sumit Chandel

On Mon, Jun 8, 2009 at 12:22 PM, Linda linda.ctr.c...@faa.gov wrote:


 I and using eclipse to compile my gwt - 1.6 project. From Eclipse I do
 not get any compilation errors. When I run my web application, I get:

 The import javax.xml cannot be resolved
 The import org.w3c cannot be resolved

 And Something about can't regonize BigDecimal as a type.

 I downloaded gwt-math.jar (2.0), but it does not support any double
 functions inside Bigdecimal. For example, I get: The method
 doubleValue() is undefined for the type BigDecimal.

 Any idea I can solve these issues?

 Thanks.

 - Linda
 


--~--~-~--~~~---~--~~
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-maven and web service

2009-06-12 Thread Arthur Kalmenson

Hello Netty,

In order for classes to be serializable, their source code needs to be
available and should be compiled by the GWT compiler. Since the
Service class is not a white listed class, you'll have to add it to
your source and use the super-source tag in your GWT module to get
it compiled.

See the Overriding one package implementation with another section
here: 
http://code.google.com/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html#DevGuideModuleXml

--
Arthur Kalmenson



On Fri, Jun 12, 2009 at 10:53 AM, netnetty...@gmail.com wrote:

 Hi all,

 I'm trying to call and get response from a wsdl service. When I
 compile the UI layer with maven, it throws this error:

 com.google.gwt.user.client.rpc.SerializationException: Type
 'javax.xml.ws.WebServiceException' was not included in the set of
 types which can be serialized by this SerializationPolicy or its Class
 object could not be loaded. For security purposes, this type will not
 be serialized.


 I tried to understand the error...but I dont! I found that the class
 'javax.xml.ws.WebServiceException' is implemented java.oi.Serializer
 but I dont know why GWTSerializer find this call non serializable.

 Actually, the first error I got was that Maven couldnt find the class
 javax.xml.ws.Service, so I added the dependency of jaxws-api.jar into
 pom.xml. After that, I compiled the project and the above error was
 thrown.

 Please help!

 Netty
 


--~--~-~--~~~---~--~~
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: no source available

2009-06-12 Thread Arthur Kalmenson

The inherits tag needs to point to the .gwt.xml module file, not a
class file. Looking at the Chronoscope library, it looks like
Chronoscope.gwt.xml is actually in
org.timepedia.chronoscope.Chronoscope so your inherits tag should
look as follows:

inherits name='org.timepedia.chronoscope.Chronoscope'/

Regards,
--
Arthur Kalmenson



On Fri, Jun 12, 2009 at 2:24 PM, Peter
Kirklewskipkirklew...@gabaedevelopment.com wrote:
 Hi Guys

 I created an application, it starts and shows the two standard windows but
 there are some errors:

 No source is available for type org.timepedia.client.browser.Chronoscope;
 did you forget to inherit required module ?

 The answer is no - I didn't as my HelloChart.gwt.xml file contains:
 inherits name='org.timepedia.chronoscope.Chronoscope'/

 Also I imported Chronoscope.jar which contains
 org.timepedia.client.browser.Chronoscope.class

 But why is it looking for source ?

 I'm not sure where the problem is.

 Can you help please ?

 Regards

 Peter



 


--~--~-~--~~~---~--~~
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: Key events for scrolltable

2009-06-12 Thread Sumit Chandel
Hi vduong,
The plan for the most used and matured widgets in the incubator is to
eventually have them graduate to GWT proper. In the case of the ScrollTable,
part of that transition should involve bringing it into the new GWT 1.6
event architecture and having it implement some of the handlers that make
sense for a ScrollTable (e.g. key handlers).

There isn't an issue created for this in the Issue Tracker just yet, so I
invite you to report it so that we can get it tracked and so that you will
be emailed updates on the issue.

GWT Issue Tracker:
http://code.google.com/p/google-web-toolkit/issues/list

Cheers,
-Sumit Chandel

On Mon, Jun 8, 2009 at 12:57 PM, vduong vdu...@hybridprojects.com wrote:


 Hi all,

 I'm trying to listen for keyboard events (specifically key down) from
 a scrolltable to enable selection of a cell and/or row and moving that
 selection around using the arrow keys. Currently, we have this working
 just by putting the entire scrolltable in a focus panel and adding a
 KeyDownHandler to that focus panel, but then we have to explicitly set
 the focus back on to the focus panel anytime it loses focus (e.g. for
 popups, cell editors), in order to begin handling the key events
 again.

 Is there any better way to listen for key events on the table? I tried
 sinkEvents(Event.ONKEYDOWN) from our subclass of PagingScrollTable,
 but my class doesn't seem to be getting the ONKEYDOWN events in
 onBrowserEvent. Any suggestions?

 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: New Event Handling and Composites

2009-06-12 Thread Buzzterrier

Thx Thomas I really appreciate this.

That worked, but when I handle the event in DoSomething, I need to
know what button was clicked.

e.g.

public class DoSomething extends Composite implements ClickHandler{

private SimpleWidget simpleWidget;

public DoSomething() {
FlowPanel fp = new FlowPanel();
simple = new SimpleWidget();

simple.addClickHandler(this);

fp.add(simpleWidget);
initWidget(fp);
}

public void onClick(ClickEvent event) {
if (event.getSource() == simple.getButton()) {

//do something
}else if(event.getSource() == smiple.getSomeOtherButton(){
  //do something else.
}
}
}


So in the onClick handler event.getSource() sources SimpleWidget, but
I really need to know what button was clicked.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



redirect without loosing state

2009-06-12 Thread michaael_l

Hi guys. I'm not quite new to GWT, but I've recently faced quite
frustrating problem, that I'm unable to solve alone. I have
requirement to integrate my webapp with single sign on system which is
HTTP based. So whilst starting GWT app I have redirect user to
different URL, check retrieved URL and then continue to webapp GUI. I
spent some time figuring out the way to persist state of app before
redirect but all measures that I found (mainly Window.Location
methods) are erasing GWT state. Is there a way to redirect and then go
back to current GWT state?

--~--~-~--~~~---~--~~
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 can I add a MouseOutHandler to a FlexTable cell?

2009-06-12 Thread matthew jones

Try this instead.

addMouseOverHandler(MouseOverHandler handler) {
return addDomHandler(handler, MouseOverEvent.getType());
}

On Jun 12, 12:52 pm, Eduardo Nunes esnu...@gmail.com wrote:
 Well, the subject says everything, I would like to know how can I add
 a MouseOutHandler to a FlexTable cell. I tried a lot of things but
 none of them with success. I tried a wrap class:

     private class FlexTableTd extends Widget implements HasMouseOutHandlers,
             HasMouseOverHandlers {

         public FlexTableTd(Element element) {
             setElement(element);
         }

         public HandlerRegistration addMouseOutHandler(MouseOutHandler 
 handler) {
             return addHandler(handler, MouseOutEvent.getType());
         }

         public HandlerRegistration
 addMouseOverHandler(MouseOverHandler handler) {
             return addHandler(handler, MouseOverEvent.getType());
         }
     }

 and I tried

 FlexTableTd td = new FlexTableTd(table.getFlexCellFormatter().getElement(0, 
 0));
 td.addMouseOverHandler(...);

 but it doesn't work.

 --
 Eduardo S. Nuneshttp://e-nunes.com.br

--~--~-~--~~~---~--~~
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 in Eclipse spontaneously stopped working

2009-06-12 Thread Rajeev Dayal
What JVM is your project using? Can you look at your project properties and
take a look?

On Fri, Jun 12, 2009 at 2:33 AM, skeemer skee...@gmail.com wrote:


 I'm running Leopard with Eclipse 3.4.2 and GWT 1.6.4. I was able
 create the first Getting Started app and everything worked fine. I
 then started creating the StockMarket app from the tutorial and now
 hosted mode won't do anything on either project or a brand new empty
 one. There is a crashlog being generated, but I have not clue what it
 means.


 Process: java [9015]
 Path:/System/Library/Frameworks/JavaVM.framework/Versions/
 1.5.0/Home/bin/java
 Identifier:  java
 Version: ??? (???)
 Code Type:   X86-64 (Native)
 Parent Process:  eclipse [8909]

 Date/Time:   2009-06-11 23:18:26.927 -0700
 OS Version:  Mac OS X 10.5.7 (9J61)
 Report Version:  6
 Anonymous UUID:  CEE66248-AC27-40A4-B86B-B4DBBAD18CA7

 Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
 Exception Codes: 0x000d, 0x
 Crashed Thread:  0

 Thread 0 Crashed:
 0   ??? 0x0001000111c1 0 + 4295037377
 1   ??? 0x00010001276f 0 + 4295042927
 2   ??? 0x000100012a1c 0 + 4295043612
 3   ??? 0x00010001104d 0 + 4295037005

 Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0041  rbx: 0x7fff5fbff5d8  rcx:
 0x  rdx: 0x0014
  rdi: 0x000100014708  rsi: 0x2f7972617262694c  rbp:
 0x7fff5fbff420  rsp: 0x7fff5fbff420
   r8: 0x910c55f2   r9: 0x  r10:
 0x  r11: 0x
  r12: 0x0014  r13: 0x000100014708  r14:
 0x0015  r15: 0x
  rip: 0x0001000111c1  rfl: 0x00010293  cr2:
 0x000100014708

 Binary Images:
0x7fff5fc0 - 0x7fff5fc2e643  dyld 97.1 (???)
 b40847f1ce1ba2ed13837aeccbf19284 /usr/lib/dyld


 Thanks,
 Leo

 


--~--~-~--~~~---~--~~
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 can I add a MouseOutHandler to a FlexTable cell?

2009-06-12 Thread Eduardo Nunes

I already tried it, but it didn't work. I found a solution, but a very ugly one:

private class FlexTableTd extends UIObject implements HasMouseOutHandlers,
HasMouseOverHandlers, EventListener {

public FlexTableTd(Element element) {
this.setElement(element);
DOM.setEventListener(this.getElement(), this);
}

public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) {
this.sinkEvents(Event.ONMOUSEOUT);
return
ensureHandlers().addHandler(MouseOutEvent.getType(), handler);
}

public HandlerRegistration
addMouseOverHandler(MouseOverHandler handler) {
this.sinkEvents(Event.ONMOUSEOVER);
return
ensureHandlers().addHandler(MouseOverEvent.getType(), handler);
}

public void fireEvent(GwtEvent? event) {
ensureHandlers().fireEvent(event);
}

public void onBrowserEvent(Event event) {
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEOVER:
case Event.ONMOUSEOUT:
Element related = event.getRelatedTarget();
if (related != null  getElement().isOrHasChild(related)) {
return;
}
break;
}
DomEvent.fireNativeEvent(event, this, this.getElement());
}
private HandlerManager handlerManager;

HandlerManager ensureHandlers() {
return handlerManager == null ? handlerManager = new
HandlerManager(this)
: handlerManager;
}
}



On Fri, Jun 12, 2009 at 4:46 PM, matthew jonesbigboxe...@gmail.com wrote:

 Try this instead.

 addMouseOverHandler(MouseOverHandler handler) {
            return addDomHandler(handler, MouseOverEvent.getType());
        }

 On Jun 12, 12:52 pm, Eduardo Nunes esnu...@gmail.com wrote:
 Well, the subject says everything, I would like to know how can I add
 a MouseOutHandler to a FlexTable cell. I tried a lot of things but
 none of them with success. I tried a wrap class:

     private class FlexTableTd extends Widget implements HasMouseOutHandlers,
             HasMouseOverHandlers {

         public FlexTableTd(Element element) {
             setElement(element);
         }

         public HandlerRegistration addMouseOutHandler(MouseOutHandler 
 handler) {
             return addHandler(handler, MouseOutEvent.getType());
         }

         public HandlerRegistration
 addMouseOverHandler(MouseOverHandler handler) {
             return addHandler(handler, MouseOverEvent.getType());
         }
     }

 and I tried

 FlexTableTd td = new FlexTableTd(table.getFlexCellFormatter().getElement(0, 
 0));
 td.addMouseOverHandler(...);

 but it doesn't work.

 --
 Eduardo S. Nuneshttp://e-nunes.com.br

 




-- 
Eduardo S. Nunes
http://e-nunes.com.br

--~--~-~--~~~---~--~~
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: ClassNotFoundException when have reference to another project

2009-06-12 Thread Rajeev Dayal
Hi,

Good question! This is a known issue right now. Check this thread out for a
discussion:

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/951499c5773693c9

Post back here if you have any other questions.


Rajeev

On Fri, Jun 12, 2009 at 9:47 AM, ailinykh ailin...@gmail.com wrote:


 Hello everybody!
 I have simple GWT project. In servlet implementation I use class from
 another Java project (it is regular class library).
 Both of them are eclipse projects. Main project has reference to
 library project, I can compile. But when I run it I get
 ClassNotFoundException. If I export my library to jar file and put
 that jar into WEB-INF/lib everything is fine. But my library project
 is under development, I modify it frequently and wish my main project
 picks up classes not jar file.
 I tried to add library project to runtime class path, it helps when
 run application locally, but if I upload application to google apps
 engine I face the same problem.
 What is the best way to handle this situation?

 Thank you,
  Andrey

 


--~--~-~--~~~---~--~~
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 Component Works in Hosted, but not in Tomcat.

2009-06-12 Thread Rajeev Dayal
What version of GWT are you using? What type of error are you seeing?

On Fri, Jun 12, 2009 at 12:20 PM, Patrick www...@gmail.com wrote:


 I am new to GWT as of 3 weeks.  I have a component running in hosted
 mode.  It is a table.  It works in hosted mode, but not when I deploy
 it to tomcat.  My other components work, but it is not visible.  I
 tried it in all browsers.  I am deploying the compiled javascript.  I
 see the javascript in the web app directory in the right place.  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: New Event Handling and Composites

2009-06-12 Thread Buzzterrier

So tracing the fireEvent method, I found that the source does indeed
reference the button, but in HandlerManager, the source gets changed
to SimpleWidget.

Object oldSource = event.getSource(); //event.getSouce is button
event.setSource(source); //here source is SimpleWidget

Not sure why.

the full method.

 /**
   * Fires the given event to the handlers listening to the event's
type.
   *
   * Note, any subclass should be very careful about overriding this
method, as
   * adds/removes of handlers will not be safe except within this
   * implementation.
   *
   * @param event the event
   */
  public void fireEvent(GwtEvent? event) {
// If it not live we should revive it.
if (!event.isLive()) {
  event.revive();
}
Object oldSource = event.getSource();
event.setSource(source);
try {
  firingDepth++;

  registry.fireEvent(event, isReverseOrder);

} finally {
  firingDepth--;
  if (firingDepth == 0) {
handleQueuedAddsAndRemoves();
  }
}
if (oldSource == null) {
  // This was my event, so I should kill it now that I'm done.
  event.kill();
} else {
  // Restoring the source for the next handler to use.
  event.setSource(oldSource);
}
  }

--~--~-~--~~~---~--~~
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: Preventing JavaScript Injection cient/server side solutions

2009-06-12 Thread Jeff Chimene

On 06/11/2009 09:03 PM, Shawn Brown wrote:
 It's a good question, but it's not really GWT related.
  

 Sure it is.


The OP asked: 'I am wondering if anybody has attempted to intercept JS 
injection on the server side by scanning RPC calls'

My interpretation of the phrase on the server side obviously does not 
match yours.

--~--~-~--~~~---~--~~
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: Preventing JavaScript Injection cient/server side solutions

2009-06-12 Thread Jeff Chimene

On 06/12/2009 12:45 AM, tamsler wrote:
 Evaluating user input on the client side and checking for script,
 etc.  tags is a good practice, however, there are ways to bypass such
 input validation. So the next best line of defense is to validate/re-
 validate on the server side where the GWT RPC call terminates. I am
 wondering what solutions exists at that end.
 -- Thomas


Such solutions are probably going to be toolkit-specific, in the sense 
that such a toolkit may have a routines available to sanitize whatever 
arrives from the net and whatever you send to the client. If you are 
using such a toolkit, does that provide anything? Otherwise, you'll have 
to roll your own solution. A search on the keywords mentioned in your 
subject line may reveal some useful Java code (assuming that's what's 
executing on the server).

To reiterate, GWT is a client-side solution; client-side code is the 
focus of this list.  Obviously, a server's involved since the code must 
originate there. However, the details of the other side of an RPC are 
an exercise left to the reader.

 On Jun 11, 5:20�pm, Jeff Chimenejchim...@gmail.com  wrote:

 On 06/11/2009 04:18 PM, tamsler wrote:

  
 I am trying to figure out what the best way is to handle JavaScript
 injection cases. Since any client side input validation handling
 doesn't truly prevent one from injecting JS such as using tools like
 Firebug to re-post RPC calls etc.

 I am wondering if anybody has attempted to intercept JS injection on
 the server side by scanning RPC calls . I could imagine using a
 servlet filter to do this or or some other way.

 Any ideas/feeback is greatly appreciated.

 It's a good question, but it's not really GWT related.
 You're talking about server-side code. The �JS code generated by GWT
 executes in the browser.
 I may be completely missing your point, but perhaps these articles may
 be 
 apropos:http://code.google.com/webtoolkit/articles/using_gwt_for_json_mashups...
 andhttp://code.google.com/webtoolkit/articles/put_your_gwt_app_on_facebo...
  
 



--~--~-~--~~~---~--~~
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: New Event Handling and Composites

2009-06-12 Thread Thomas Broyer



On 12 juin, 21:15, Buzzterrier terry.je...@gmail.com wrote:
 Thx Thomas I really appreciate this.

 That worked, but when I handle the event in DoSomething, I need to
 know what button was clicked.

So you actually need to access an HasClickHandlers from the
SimpleWidget, not make SimpleWidget a HasClickHandlers.

E.g.

public class SimpleWidget extends Composite {
   private Button b1;
   private Button b2;
...
   public HasClickHandlers getButton1() { return b1; }
   public HasClickHandlers getButton2() { return b2; }
}

Then in DoSomething: simpleWidget.getButton1.addClickHandler(...);


Or probably you rather need a HasSelectionHandler or something like
that (have a look into com.google.gwt.event.logical.shared), and in
SimpleWidget, register a ClickHandler on each button to fireEvent a
new SelectionEvent() (instead of fireEvent(event) as in my previous
proposal).


--~--~-~--~~~---~--~~
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 can I add a MouseOutHandler to a FlexTable cell?

2009-06-12 Thread Kelo

Hi Eduardo,

 Here's your solution:

public class BocaJrsTable extends FlexTable implements
HasMouseOutHandlers {

private HandlerManager manager = new HandlerManager(this);

public BocaJrsTable(){
super();
addDomHandler(new MouseOutHandler() {
@Override
public void onMouseOut(MouseOutEvent event) {
fireEvent(event);
}
}, MouseOutEvent.getType());

}

@Override
public HandlerRegistration addMouseOutHandler(MouseOutHandler
handler) {
return manager.addHandler(MouseOutEvent.getType(), handler);
}


@Override
public void fireEvent(GwtEvent? event) {
manager.fireEvent(event);
}

}

Good luck !

On Jun 12, 5:40 pm, Eduardo Nunes esnu...@gmail.com wrote:
 I already tried it, but it didn't work. I found a solution, but a very ugly 
 one:

     private class FlexTableTd extends UIObject implements HasMouseOutHandlers,
             HasMouseOverHandlers, EventListener {

         public FlexTableTd(Element element) {
             this.setElement(element);
             DOM.setEventListener(this.getElement(), this);
         }

         public HandlerRegistration addMouseOutHandler(MouseOutHandler 
 handler) {
             this.sinkEvents(Event.ONMOUSEOUT);
             return
 ensureHandlers().addHandler(MouseOutEvent.getType(), handler);
         }

         public HandlerRegistration
 addMouseOverHandler(MouseOverHandler handler) {
             this.sinkEvents(Event.ONMOUSEOVER);
             return
 ensureHandlers().addHandler(MouseOverEvent.getType(), handler);
         }

         public void fireEvent(GwtEvent? event) {
             ensureHandlers().fireEvent(event);
         }

         public void onBrowserEvent(Event event) {
             switch (DOM.eventGetType(event)) {
                 case Event.ONMOUSEOVER:
                 case Event.ONMOUSEOUT:
                     Element related = event.getRelatedTarget();
                     if (related != null  
 getElement().isOrHasChild(related)) {
                         return;
                     }
                     break;
             }
             DomEvent.fireNativeEvent(event, this, this.getElement());
         }
         private HandlerManager handlerManager;

         HandlerManager ensureHandlers() {
             return handlerManager == null ? handlerManager = new
 HandlerManager(this)
                     : handlerManager;
         }
     }



 On Fri, Jun 12, 2009 at 4:46 PM, matthew jonesbigboxe...@gmail.com wrote:

  Try this instead.

  addMouseOverHandler(MouseOverHandler handler) {
             return addDomHandler(handler, MouseOverEvent.getType());
         }

  On Jun 12, 12:52 pm, Eduardo Nunes esnu...@gmail.com wrote:
  Well, the subject says everything, I would like to know how can I add
  a MouseOutHandler to a FlexTable cell. I tried a lot of things but
  none of them with success. I tried a wrap class:

      private class FlexTableTd extends Widget implements 
  HasMouseOutHandlers,
              HasMouseOverHandlers {

          public FlexTableTd(Element element) {
              setElement(element);
          }

          public HandlerRegistration addMouseOutHandler(MouseOutHandler 
  handler) {
              return addHandler(handler, MouseOutEvent.getType());
          }

          public HandlerRegistration
  addMouseOverHandler(MouseOverHandler handler) {
              return addHandler(handler, MouseOverEvent.getType());
          }
      }

  and I tried

  FlexTableTd td = new 
  FlexTableTd(table.getFlexCellFormatter().getElement(0, 0));
  td.addMouseOverHandler(...);

  but it doesn't work.

  --
  Eduardo S. Nuneshttp://e-nunes.com.br

 --
 Eduardo S. Nuneshttp://e-nunes.com.br
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



3rd parties and GWT-RPC?

2009-06-12 Thread markww

Hi,

I'm wondering what options we have when we want a 3rd party to talk to
our server. For example, I'm using GWT RPC as-is. So my clients
(browsers) talk to the server perfectly, works great.

Now I'd like to make an iPhone app (an actual objective-c compiled
app) that also uses my web service. Normally if I were using PHP, I'd
just call the PHP scripts via a url in the objective-c application.
This does not seem possible when using GWT-RPC. Is there any way to do
it? I know I can just let the user use mobile safari to access my web
app, but would prefer a thick client.

Thanks for any suggestions


--~--~-~--~~~---~--~~
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-contrib] Comment on OverlayTypes in google-web-toolkit

2009-06-12 Thread codesite-noreply

Comment by bobbysoares:

Scottb, I was suggesting for example having new MyObject(...) be replaced  
with MyObject.newInstance(...) automatically (where newInstance would be  
a method supplied by the developer which returns an instance of the class,  
possibly natively, after calling the JS constructor). Maybe it's not a  
great solution.

Rjrjr, the non-JSO implementation would add overhead though, right? That's  
what i wanted to avoid, without giving up constructors, if possible. If  
not, i'll still live.


For more information:
http://code.google.com/p/google-web-toolkit/wiki/OverlayTypes

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r5549 - Remove stale branches.

2009-06-12 Thread codesite-noreply

Author: b...@google.com
Date: Fri Jun 12 12:16:17 2009
New Revision: 5549

Removed:
changes/bobv/clientbundle/
changes/bobv/derpc/

Log:
Remove stale branches.


--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r5550 - Create a branch to publish derpc test code.

2009-06-12 Thread codesite-noreply

Author: b...@google.com
Date: Fri Jun 12 12:26:45 2009
New Revision: 5550

Added:
changes/bobv/derpc/   (props changed)
   - copied from r5549, /trunk/

Log:
Create a branch to publish derpc test code.


--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Allow generators fast access to source path resources

2009-06-12 Thread scottb

Reviewers: bobv, jat,

Description:
This patch adds a new method to GeneratorContext that makes a new
ResourceOracle available specifically to generators.  This
ResourceOracle contains all of the resources on the classpath that are
associated with source files on the sourcepath.  Certain generators,
such as i18n, can use this to operate much more quickly than doing lots
of lookups through ClassLoader.getResourceAsStream().

Please review this at http://gwt-code-reviews.appspot.com/40801

Affected files:
   dev/core/src/com/google/gwt/core/ext/GeneratorContext.java
   dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java
   dev/core/src/com/google/gwt/dev/resource/impl/ResourceOracleImpl.java
   dev/core/src/com/google/gwt/dev/shell/StandardGeneratorContext.java
   dev/core/test/com/google/gwt/dev/shell/StandardGeneratorContextTest.java
   user/src/com/google/gwt/i18n/rebind/CachedGeneratorContext.java



--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: Allow generators fast access to source path resources

2009-06-12 Thread bobv

LGTM.



http://gwt-code-reviews.appspot.com/40801/diff/1/2
File dev/core/src/com/google/gwt/core/ext/GeneratorContext.java (right):

http://gwt-code-reviews.appspot.com/40801/diff/1/2#newcode76
Line 76: * being compiled.
containing all resources in the module's source paths

That it's from the system classpath is irrelevant.
What about super-source?

http://gwt-code-reviews.appspot.com/40801

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: Allow generators fast access to source path resources

2009-06-12 Thread scottb


http://gwt-code-reviews.appspot.com/40801/diff/1/2
File dev/core/src/com/google/gwt/core/ext/GeneratorContext.java (right):

http://gwt-code-reviews.appspot.com/40801/diff/1/2#newcode76
Line 76: * being compiled.
Will clarify doc.

http://gwt-code-reviews.appspot.com/40801

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r5552 - Adds a new method to GeneratorContext that makes a new ResourceOracle available specifica...

2009-06-12 Thread codesite-noreply

Author: sco...@google.com
Date: Fri Jun 12 13:56:52 2009
New Revision: 5552

Modified:
trunk/dev/core/src/com/google/gwt/core/ext/GeneratorContext.java
trunk/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java
trunk/dev/core/src/com/google/gwt/dev/cfg/PublicOracle.java
 
trunk/dev/core/src/com/google/gwt/dev/resource/impl/ResourceOracleImpl.java
trunk/dev/core/src/com/google/gwt/dev/shell/StandardGeneratorContext.java
 
trunk/dev/core/test/com/google/gwt/dev/shell/StandardGeneratorContextTest.java
trunk/user/src/com/google/gwt/i18n/rebind/CachedGeneratorContext.java

Log:
Adds a new method to GeneratorContext that makes a new ResourceOracle  
available specifically to generators.

This ResourceOracle contains all of the resources on the classpath that are  
associated with source files on the sourcepath.  Certain generators, such  
as i18n, can use this to operate much more quickly than doing lots of  
lookups through ClassLoader.getResourceAsStream().

Review by: bobv

Modified: trunk/dev/core/src/com/google/gwt/core/ext/GeneratorContext.java
==
--- trunk/dev/core/src/com/google/gwt/core/ext/GeneratorContext.java 
(original)
+++ trunk/dev/core/src/com/google/gwt/core/ext/GeneratorContext.javaFri  
Jun 12 13:56:52 2009
@@ -18,6 +18,7 @@
  import com.google.gwt.core.ext.linker.Artifact;
  import com.google.gwt.core.ext.linker.GeneratedResource;
  import com.google.gwt.core.ext.typeinfo.TypeOracle;
+import com.google.gwt.dev.resource.ResourceOracle;

  import java.io.OutputStream;
  import java.io.PrintWriter;
@@ -68,6 +69,17 @@
 * use the property oracle to query deferred binding properties.
 */
PropertyOracle getPropertyOracle();
+
+  /**
+   * Returns a resource oracle containing all resources that are mapped  
into the
+   * module's source (or super-source) paths. Conceptually, this resource  
oracle
+   * exposes resources which are siblings to GWT-compatible Java  
classes. For
+   * example, if the module includes  
codecom.google.gwt.core.client/code
+   * as a source package, then a resource at
+   * codecom/google/gwt/core/client/Foo.properties/code would be  
exposed
+   * by this resource oracle.
+   */
+  ResourceOracle getResourcesOracle();

/**
 * Gets the type oracle for the current generator context. Generators  
can use

Modified: trunk/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java
==
--- trunk/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java(original)
+++ trunk/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.javaFri Jun 12  
13:56:52 2009
@@ -23,6 +23,7 @@
  import com.google.gwt.core.ext.typeinfo.TypeOracle;
  import com.google.gwt.dev.javac.CompilationState;
  import com.google.gwt.dev.resource.Resource;
+import com.google.gwt.dev.resource.ResourceOracle;
  import com.google.gwt.dev.resource.impl.DefaultFilters;
  import com.google.gwt.dev.resource.impl.PathPrefix;
  import com.google.gwt.dev.resource.impl.PathPrefixSet;
@@ -48,6 +49,7 @@
   * Represents a module specification. In principle, this could be built  
without
   * XML for unit tests.
   */
+...@suppresswarnings(deprecation)
  public class ModuleDef implements PublicOracle {

private static final ComparatorMap.EntryString, ? REV_NAME_CMP = new  
ComparatorMap.EntryString, ?() {
@@ -82,6 +84,8 @@

private ResourceOracleImpl lazyPublicOracle;

+  private ResourceOracleImpl lazyResourcesOracle;
+
private ResourceOracleImpl lazySourceOracle;

private final MapString, Class? extends Linker linkerTypesByName =  
new LinkedHashMapString, Class? extends Linker();
@@ -277,6 +281,21 @@
  return properties;
}

+  public ResourceOracle getResourcesOracle() {
+if (lazyResourcesOracle == null) {
+  lazyResourcesOracle = new ResourceOracleImpl(TreeLogger.NULL);
+  PathPrefixSet pathPrefixes = lazySourceOracle.getPathPrefixes();
+  PathPrefixSet newPathPrefixes = new PathPrefixSet();
+  for (PathPrefix pathPrefix : pathPrefixes.values()) {
+newPathPrefixes.add(new PathPrefix(pathPrefix.getPrefix(), null,
+pathPrefix.shouldReroot()));
+  }
+  lazyResourcesOracle.setPathPrefixes(newPathPrefixes);
+  lazyResourcesOracle.refresh(TreeLogger.NULL);
+}
+return lazyResourcesOracle;
+  }
+
/**
 * Gets a reference to the internal rules for this module def.
 */
@@ -342,6 +361,10 @@
  // Refresh resource oracles.
  lazyPublicOracle.refresh(logger);
  lazySourceOracle.refresh(logger);
+
+if (lazyResourcesOracle != null) {
+  lazyResourcesOracle.refresh(logger);
+}

  // Update the compilation state to reflect the resource oracle changes.
  if (lazyCompilationState != null) {

Modified: trunk/dev/core/src/com/google/gwt/dev/cfg/PublicOracle.java

[gwt-contrib] Re: Custom tag constructor for HTMLPanel

2009-06-12 Thread rjrjr

[+ contrib]

http://gwt-code-reviews.appspot.com/39802

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: Custom tag constructor for HTMLPanel

2009-06-12 Thread jgw


http://gwt-code-reviews.appspot.com/39802/diff/1/3
File user/src/com/google/gwt/user/client/ui/HTMLPanel.java (right):

http://gwt-code-reviews.appspot.com/39802/diff/1/3#newcode61
Line 61: public HTMLPanel(String tag, String html) {
Could we not force 'tag' to simply be an element, so that we remove one
source of possible errors (i.e. new HTMLPanel('bugger', '...'))?

http://gwt-code-reviews.appspot.com/39802

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: Custom tag constructor for HTMLPanel

2009-06-12 Thread Ray Ryan
That won't really protect anyone from anything, as they could just call
DOM.createElement(bugger) and hand that in. Also, accepting an existing
element is another way to say HTMLPanel.wrap(),  which we haven't provided
so far--you really want to go there?
Anyhow, does any browser not accept bugger
thisforalark/lark/a/for/this/bugger

rjrjr

On Fri, Jun 12, 2009 at 2:11 PM, j...@google.com wrote:


 http://gwt-code-reviews.appspot.com/39802/diff/1/3
 File user/src/com/google/gwt/user/client/ui/HTMLPanel.java (right):

 http://gwt-code-reviews.appspot.com/39802/diff/1/3#newcode61
 Line 61: public HTMLPanel(String tag, String html) {
 Could we not force 'tag' to simply be an element, so that we remove one
 source of possible errors (i.e. new HTMLPanel('bugger', '...'))?


 http://gwt-code-reviews.appspot.com/39802


--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: Custom tag constructor for HTMLPanel

2009-06-12 Thread jgw

Ray:
That won't really protect anyone from anything, as they could just call
DOM.createElement(bugger) and hand that in. Also, accepting an
existing element is another way to say HTMLPanel.wrap(),  which we
haven't provided so far--you really want to go there?

Anyhow, does any browser not accept bugger
thisforalark/lark/a/for/this/bugger

http://gwt-code-reviews.appspot.com/39802

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: Custom tag constructor for HTMLPanel

2009-06-12 Thread jgw

On 2009/06/12 21:20:50, jgw wrote:
 Ray:
 That won't really protect anyone from anything, as they could just
call
 DOM.createElement(bugger) and hand that in. Also, accepting an
existing
 element is another way to say HTMLPanel.wrap(),  which we haven't
provided so
 far--you really want to go there?

 Anyhow, does any browser not accept bugger
 thisforalark/lark/a/for/this/bugger

Well, we *do* have lots of methods to try and keep people 'on the
rails', such as createDivElement(), etc. which I believe reduces the
risk of errors in practice (they can always call
createElement(bugger), but usually don't). But I think I'm ok with it,
as it at least reduces the probability that someone will try and use
this as a back-door wrap() method, which would lead to much wailing and
gnashing of teeth on my part.

LGTM.

http://gwt-code-reviews.appspot.com/39802

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r5553 - Don't be so silly about the event sink constants in RadioButton

2009-06-12 Thread codesite-noreply

Author: rj...@google.com
Date: Fri Jun 12 15:33:13 2009
New Revision: 5553

Modified:
 
trunk/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/DefaultMuseum.java
trunk/user/src/com/google/gwt/user/client/ui/RadioButton.java

Log:
Don't be so silly about the event sink constants in RadioButton
Reviewer: jlabanca



Modified:  
trunk/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/DefaultMuseum.java
==
---  
trunk/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/DefaultMuseum.java

(original)
+++  
trunk/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/DefaultMuseum.java

Fri Jun 12 15:33:13 2009
@@ -65,5 +65,6 @@
  addIssue(new VisualsForWindowEvents());
  addIssue(new VisualsForDialogBox());
  addIssue(new VisualsForSuggestBox());
+addIssue(new VisualsForCheckBoxAndRadioButtonEvents());
}
  }

Modified: trunk/user/src/com/google/gwt/user/client/ui/RadioButton.java
==
--- trunk/user/src/com/google/gwt/user/client/ui/RadioButton.java   
(original)
+++ trunk/user/src/com/google/gwt/user/client/ui/RadioButton.java   Fri Jun 
 
12 15:33:13 2009
@@ -17,10 +17,6 @@

  import com.google.gwt.dom.client.Element;
  import com.google.gwt.dom.client.EventTarget;
-import com.google.gwt.event.dom.client.BlurEvent;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.KeyDownEvent;
-import com.google.gwt.event.dom.client.MouseUpEvent;
  import com.google.gwt.event.logical.shared.ValueChangeEvent;
  import com.google.gwt.user.client.DOM;
  import com.google.gwt.user.client.Event;
@@ -65,10 +61,10 @@
  super(DOM.createInputRadio(name));
  setStyleName(gwt-RadioButton);

-sinkEvents(Event.getTypeInt(ClickEvent.getType().getName()));
-sinkEvents(Event.getTypeInt(MouseUpEvent.getType().getName()));
-sinkEvents(Event.getTypeInt(BlurEvent.getType().getName()));
-sinkEvents(Event.getTypeInt(KeyDownEvent.getType().getName()));
+sinkEvents(Event.ONCLICK);
+sinkEvents(Event.ONMOUSEOUT);
+sinkEvents(Event.ONBLUR);
+sinkEvents(Event.ONKEYDOWN);
}

/**

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Specify the path for translatable code explicitly in new apps created by webAppCreator

2009-06-12 Thread amitmanjhi

Reviewers: Ray Ryan, scottb,

Description:
It will be less confusing for new users. Anyone see any downsides?

Please review this at http://gwt-code-reviews.appspot.com/39803

Affected files:
   user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc


Index: user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc
===
--- user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc(revision 5552)
+++ user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc(working copy)
@@ -14,4 +14,8 @@

!-- Specify the app entry point class. --
entry-point class='@clientpacka...@moduleshortname'/
+
+  !-- Specify the paths for translatable code--
+  source path='client'/
+
  /module



--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r5554 - Allow CompilationResult.getStatementRanges() to return null,

2009-06-12 Thread codesite-noreply

Author: sp...@google.com
Date: Fri Jun 12 15:49:54 2009
New Revision: 5554

Modified:
trunk/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java
trunk/dev/core/src/com/google/gwt/core/linker/IFrameLinker.java
trunk/dev/core/test/com/google/gwt/core/linker/ScriptChunkingTest.java

Log:
Allow CompilationResult.getStatementRanges() to return null,
and have it do so by default.

Review by: jat


Modified:  
trunk/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java
==
---  
trunk/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java
 
(original)
+++  
trunk/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java
 
Fri Jun 12 15:49:54 2009
@@ -51,9 +51,12 @@

/**
 * Returns the statement ranges for the JavaScript returned by
-   * {...@link #getJavaScript()}.
+   * {...@link #getJavaScript()}. Some subclasses return codenull/code, in
+   * which case there is no statement range information available.
 */
-  public abstract StatementRanges[] getStatementRanges();
+  public StatementRanges[] getStatementRanges() {
+return null;
+  }

/**
 * Return a string that uniquely identifies this compilation result.  
Typically

Modified: trunk/dev/core/src/com/google/gwt/core/linker/IFrameLinker.java
==
--- trunk/dev/core/src/com/google/gwt/core/linker/IFrameLinker.java  
(original)
+++ trunk/dev/core/src/com/google/gwt/core/linker/IFrameLinker.java Fri Jun 
 
12 15:49:54 2009
@@ -58,10 +58,16 @@
 * Split a JavaScript string into multiple chunks, at statement  
boundaries.
 * Insert and end-script tag and a start-script tag in between each  
chunk.
 * This method is made default access for testing.
+   *
+   * @param ranges Describes where the statements are located within the
+   *  JavaScript code. If codenull/code, then return  
codejs/code
+   *  unchanged.
+   * @param js The JavaScript code to be split up.
+   * @param charsPerChunk The number of characters to be put in each  
script tag
 */
static String splitPrimaryJavaScript(StatementRanges ranges, String js,
int charsPerChunk) {
-if (charsPerChunk  0) {
+if (charsPerChunk  0 || ranges == null) {
return js;
  }

@@ -72,8 +78,7 @@
int start = ranges.start(i);
int end = ranges.end(i);
int length = end - start;
-  if (bytesInCurrentTag  0
-   bytesInCurrentTag + length  charsPerChunk) {
+  if (bytesInCurrentTag  0  bytesInCurrentTag + length   
charsPerChunk) {
  if (lastChar(sb) != '\n') {
sb.append('\n');
  }

Modified:  
trunk/dev/core/test/com/google/gwt/core/linker/ScriptChunkingTest.java
==
--- trunk/dev/core/test/com/google/gwt/core/linker/ScriptChunkingTest.java  
 
(original)
+++ trunk/dev/core/test/com/google/gwt/core/linker/ScriptChunkingTest.java  
 
Fri Jun 12 15:49:54 2009
@@ -118,4 +118,23 @@
  builder.getJavaScript(), -1);
  assertEquals(builder.getJavaScript(), split);
}
+
+  /**
+   * Test with statement ranges not present, which should disable the  
chunking.
+   */
+  public void testNullStatementRanges() {
+ScriptWithRangesBuilder builder = new ScriptWithRangesBuilder();
+builder.addNonStatement({);
+builder.addNonStatement({);
+builder.addStatement(x=1;);
+builder.addStatement(function x(){x = 2}\n);
+builder.addStatement(x=3);
+builder.addNonStatement(}\n{);
+builder.addStatement(x=5);
+builder.addNonStatement(});
+
+String split = IFrameLinker.splitPrimaryJavaScript(null,
+builder.getJavaScript(), 5);
+assertEquals(builder.getJavaScript(), split);
+  }
  }

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: Specify the path for translatable code explicitly in new apps created by webAppCreator

2009-06-12 Thread Scott Blum
LGTM

On Fri, Jun 12, 2009 at 6:49 PM, amitman...@google.com wrote:

 Reviewers: Ray Ryan, scottb,

 Description:
 It will be less confusing for new users. Anyone see any downsides?

 Please review this at http://gwt-code-reviews.appspot.com/39803

 Affected files:
  user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc


 Index: user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc
 ===
 --- user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc(revision
 5552)
 +++ user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc(working
 copy)
 @@ -14,4 +14,8 @@

   !-- Specify the app entry point class. --
   entry-point class='@clientpacka...@moduleshortname'/
 +
 +  !-- Specify the paths for translatable code--
 +  source path='client'/
 +
  /module




--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: Specify the path for translatable code explicitly in new apps created by webAppCreator

2009-06-12 Thread Ray Ryan
LGTM++

On Fri, Jun 12, 2009 at 4:08 PM, Scott Blum sco...@google.com wrote:

 LGTM


 On Fri, Jun 12, 2009 at 6:49 PM, amitman...@google.com wrote:

 Reviewers: Ray Ryan, scottb,

 Description:
 It will be less confusing for new users. Anyone see any downsides?

 Please review this at http://gwt-code-reviews.appspot.com/39803

 Affected files:
  user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc


 Index: user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc
 ===
 --- user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc(revision
 5552)
 +++ user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc(working
 copy)
 @@ -14,4 +14,8 @@

   !-- Specify the app entry point class. --
   entry-point class='@clientpacka...@moduleshortname'/
 +
 +  !-- Specify the paths for translatable code--
 +  source path='client'/
 +
  /module





--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: Specify the path for translatable code explicitly in new apps created by webAppCreator

2009-06-12 Thread Amit Manjhi
Thanks Scott and Ray. Commited at r.

On Fri, Jun 12, 2009 at 4:11 PM, Ray Ryan rj...@google.com wrote:

 LGTM++


 On Fri, Jun 12, 2009 at 4:08 PM, Scott Blum sco...@google.com wrote:

 LGTM


 On Fri, Jun 12, 2009 at 6:49 PM, amitman...@google.com wrote:

 Reviewers: Ray Ryan, scottb,

 Description:
 It will be less confusing for new users. Anyone see any downsides?

 Please review this at http://gwt-code-reviews.appspot.com/39803

 Affected files:
  user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc


 Index: user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc
 ===
 --- user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc(revision
 5552)
 +++ user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc(working
 copy)
 @@ -14,4 +14,8 @@

   !-- Specify the app entry point class. --
   entry-point class='@clientpacka...@moduleshortname'/
 +
 +  !-- Specify the paths for translatable code--
 +  source path='client'/
 +
  /module






--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r5555 - Specify the path for translatable code explicitly in new apps created by webAppCreator.

2009-06-12 Thread codesite-noreply

Author: amitman...@google.com
Date: Fri Jun 12 16:20:01 2009
New Revision: 

Modified:
trunk/user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc

Log:
Specify the path for translatable code explicitly in new apps created by  
webAppCreator.

Patch by: amitmanjhi
Review by: scottb, rjrjr



Modified: trunk/user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc
==
--- trunk/user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc  (original)
+++ trunk/user/src/com/google/gwt/user/tools/Module.gwt.xmlsrc  Fri Jun 12  
16:20:01 2009
@@ -14,4 +14,8 @@

!-- Specify the app entry point class. --
entry-point class='@clientpacka...@moduleshortname'/
+
+  !-- Specify the paths for translatable code--
+  source path='client'/
+
  /module

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r5556 - Merge trunk r5554 into 6/2 snapshot branch. This fixes a breaking API change

2009-06-12 Thread codesite-noreply

Author: j...@google.com
Date: Fri Jun 12 16:53:06 2009
New Revision: 5556

Modified:
branches/snapshot-2009.06.02-r5498/branch-info.txt
 
branches/snapshot-2009.06.02-r5498/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java
 
branches/snapshot-2009.06.02-r5498/dev/core/src/com/google/gwt/core/linker/IFrameLinker.java
 
branches/snapshot-2009.06.02-r5498/dev/core/test/com/google/gwt/core/linker/ScriptChunkingTest.java

Log:
Merge trunk r5554 into 6/2 snapshot branch.  This fixes a breaking API  
change
by providing default behavior.


r5554 | sp...@google.com | 2009-06-12 18:49:54 -0400 (Fri, 12 Jun 2009) | 5  
lines

Allow CompilationResult.getStatementRanges() to return null,
and have it do so by default.

Review by: jat


svn merge -c5554 https://google-web-toolkit.googlecode.com/svn/trunk .


Modified: branches/snapshot-2009.06.02-r5498/branch-info.txt
==
--- branches/snapshot-2009.06.02-r5498/branch-info.txt  (original)
+++ branches/snapshot-2009.06.02-r5498/branch-info.txt  Fri Jun 12 16:53:06  
2009
@@ -26,3 +26,5 @@
 svn merge -c5532 https://google-web-toolkit.googlecode.com/svn/trunk .
  /trunk 5538 was merged into this branch (final(?) fix from 5523)
 svn merge -c5538 https://google-web-toolkit.googlecode.com/svn/trunk .
+/trunk 5554 was merged into this branch (fix breaking API change)
+   svn merge -c5554 https://google-web-toolkit.googlecode.com/svn/trunk .

Modified:  
branches/snapshot-2009.06.02-r5498/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java
==
---  
branches/snapshot-2009.06.02-r5498/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java

(original)
+++  
branches/snapshot-2009.06.02-r5498/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java

Fri Jun 12 16:53:06 2009
@@ -51,9 +51,12 @@

/**
 * Returns the statement ranges for the JavaScript returned by
-   * {...@link #getJavaScript()}.
+   * {...@link #getJavaScript()}. Some subclasses return codenull/code, in
+   * which case there is no statement range information available.
 */
-  public abstract StatementRanges[] getStatementRanges();
+  public StatementRanges[] getStatementRanges() {
+return null;
+  }

/**
 * Return a string that uniquely identifies this compilation result.  
Typically

Modified:  
branches/snapshot-2009.06.02-r5498/dev/core/src/com/google/gwt/core/linker/IFrameLinker.java
==
---  
branches/snapshot-2009.06.02-r5498/dev/core/src/com/google/gwt/core/linker/IFrameLinker.java
 
(original)
+++  
branches/snapshot-2009.06.02-r5498/dev/core/src/com/google/gwt/core/linker/IFrameLinker.java
 
Fri Jun 12 16:53:06 2009
@@ -58,10 +58,16 @@
 * Split a JavaScript string into multiple chunks, at statement  
boundaries.
 * Insert and end-script tag and a start-script tag in between each  
chunk.
 * This method is made default access for testing.
+   *
+   * @param ranges Describes where the statements are located within the
+   *  JavaScript code. If codenull/code, then return  
codejs/code
+   *  unchanged.
+   * @param js The JavaScript code to be split up.
+   * @param charsPerChunk The number of characters to be put in each  
script tag
 */
static String splitPrimaryJavaScript(StatementRanges ranges, String js,
int charsPerChunk) {
-if (charsPerChunk  0) {
+if (charsPerChunk  0 || ranges == null) {
return js;
  }

@@ -72,8 +78,7 @@
int start = ranges.start(i);
int end = ranges.end(i);
int length = end - start;
-  if (bytesInCurrentTag  0
-   bytesInCurrentTag + length  charsPerChunk) {
+  if (bytesInCurrentTag  0  bytesInCurrentTag + length   
charsPerChunk) {
  if (lastChar(sb) != '\n') {
sb.append('\n');
  }

Modified:  
branches/snapshot-2009.06.02-r5498/dev/core/test/com/google/gwt/core/linker/ScriptChunkingTest.java
==
---  
branches/snapshot-2009.06.02-r5498/dev/core/test/com/google/gwt/core/linker/ScriptChunkingTest.java
  
(original)
+++  
branches/snapshot-2009.06.02-r5498/dev/core/test/com/google/gwt/core/linker/ScriptChunkingTest.java
  
Fri Jun 12 16:53:06 2009
@@ -118,4 +118,23 @@
  builder.getJavaScript(), -1);
  assertEquals(builder.getJavaScript(), split);
}
+
+  /**
+   * Test with statement ranges not present, which should disable the  
chunking.
+   */
+  public void testNullStatementRanges() {
+ScriptWithRangesBuilder builder = new ScriptWithRangesBuilder();
+

[gwt-contrib] Comment on OverlayTypes in google-web-toolkit

2009-06-12 Thread codesite-noreply

Comment by cromwellian:

It would be interesting to consider Constructor() as being rewritten to a  
static method with an implicit call to createObject() and all references to  
this rewritten to this$static. e.g.

public Foo(int x, String y) {
   this.x = x;
   this.y = y;
}

rewritten to

public static Foo consFoo(int x, String y) {
   Foo this$static=createObject.cast();
   this$static.x=x;
   this$static.y=y;
   return this$static;
}

Moreover, you could consider any field declarations on Foo as having  
implicit native methods for getting and assignment. Thus,

public Foo extends JavaScriptObject {
   int x;
}

would implicitly have methods like

native int getX() /*-{ return x; }-*/;
native void setX(int x) /*-{ this.x=x; }-*/;

although these would only exist in the compiler/AST (purely for  
visualization purposes here). That way, needless boilerplate accessors in  
JSOs would be eliminated.

All of the usual JSO restrictions would apply. This is purely syntactic  
sugar. Stuff like field initializers and super calls in the constructor  
would still be banned (for now), although they could be supported via  
additional rewriting logic (like moving initializers into the synthesized  
factory method and super calls invoking super class factory methods which  
take this$static parameters)



For more information:
http://code.google.com/p/google-web-toolkit/wiki/OverlayTypes

--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: Changing JsArrayT extends JavaScriptObject to JsArrayT

2009-06-12 Thread Ray Cromwell

I'm in the process of some final tweaks on GQuery, so I'll look at how
much of my private JSArray class I can move over as a patch.

One possibility for avoiding Iterator object creation without using
flyweights is to introduce a new Iterator type which contains methods
which are parameterized by the collection and which use my Extension
Method/Category method JSO trick.

public class FastIteratorT extends JavaScriptObject {
   protected FastIterator() {}
   public S, T extends ListS FastIteratorS make(TS  list) {
  return (FastIteratorS)(GWT.isScript() ? makeWeb() : makeHosted());
   }

   private final native FastIterator makeWeb() /*-{
  return 0;
   }-*/;

   private final native FastIterator makeHosted() /*-{
 return [0];
   }-*/;

   public final  int value() {
 return GWT.isScript() ? valueWeb() : valueHosted();
   }

   public native int valueWeb() /*-{
 return this;
   }-*/;

   public native int valueHosted() /*-{
 return this[0];
   }-*/;

   public native hasNext(ListT list) {
 return value()  list.size();
   }

   public native T next(ListT list) {
 return list.get(value()++); // unsure if using value() as rvalue
will work here
   }
}

then you should be able to write code like

ListString foo = getList();
FastIteratorString iter = FastIterator.make(foo);

while(iter.hasNext(foo)) {
  String s = iter.next(foo);
}

Why doesn't this create any additional objects? Because
'iter'/FastIterator is actually a native JS number/scalar type, and
what this is really doing is simulating the addition of
hasNext()/next() to the number's prototype.

We could dispense with the need for an additional parameter if GWT had
a magic method for allocating new local variables/symbols in the local
scope. Imagine if writing

VariableT x = GWT.createVariable(0);

was a magic method that just generated a 'var x = 0' declaration, only
it promised to always be inlined and do so in the caller's scope.
'Variable' would be a magic class that never creates fields on the
actual object themselves and are pruned/removed at runtime.

Then you could have FastIterator impersonate a reference to the
underlying ListT, and rewrite hasNext()/next() as:

VariableInt x = GWT.createVariableInt(0);
public boolean hasNext() {
   return x.get()  this.size();
}

public T next() {
   return this.get(x.get()++); // or x.postIncrement()
}

this would produce code that would create no additional objects as
well as maintain Iterator-like interface.

-Ray


On Thu, Jun 11, 2009 at 7:25 AM, Stefan Hausteinhaust...@google.com wrote:
 +1 Ray
 Could you contribute your implementation(s)?

 On Thu, Jun 11, 2009 at 12:51 PM, Joel Webber j...@google.com wrote:

 +1 Ray. Now here's the really tricky question. Is there any way we can
 take advantage of Javascript's for (x in y) { ... } syntax (and should we,
 given its spotty performance)? My intuition tells me that the only way we
 could use it would be through a callback, because there's nothing like .NET
 generators/yield in Javascript.
 On Wed, Jun 10, 2009 at 7:26 PM, Ray Cromwell cromwell...@gmail.com
 wrote:

 My take on this is that there is many places where I'd like to avoid
 JRE collections, but the basic JsArray is too much of a downgrade. I
 don't mind changing it to T if it doesn't effect performance cause
 then I could subclass it, but as an example of the stuff I would like
 in a 'FastArrayList' that is not a collections derivative:

 1) add() instead of just set(length(), item) (e.g. push)
 2) addAll(anotherFastArrayList) (e.g. concat)
 3) splice
 4) toArray() (webmode is reinterpret cast op)
 5) remove
 6) shift/unshift (useful for queue when combined with pop)

 I use the following pattern all over GQuery to avoid JRE collections
 but preserve for-each

 for(Foo f : fooList.elements()) { ... }

 where fooList is my own JsArrayT class, and elements() returns T[]
 via reinterpret cast in webmode.

 -Ray



 On Thu, Jun 11, 2009 at 2:43 AM, Lex Spoonsp...@google.com wrote:
 
  Bah, mis-send.  What I was typing was:
 
 
  I though the point was to get rid of JRE collections?  Anyway, the
  collection in question is used as a queue.  I would hate to see its
  performance get worse when there'
 
  ...when there's a known, straightforward alternative, and when that
  alternative provides a class people have been wanting for separate
  purposes.
 
 
  Lex
 
  
 


 



 --
 Stefan Haustein
 Google UK Limited

 Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W
 9TQ; Registered in England Number: 3977902



--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] [google-web-toolkit commit] r5557 - Ant top-level target rework to allow single-platform use. Not that whereas ant build u...

2009-06-12 Thread codesite-noreply

Author: fabb...@google.com
Date: Fri Jun 12 19:28:21 2009
New Revision: 5557

Modified:
trunk/build.xml
trunk/common.ant.xml
trunk/tools/benchmark-viewer/build.xml
trunk/user/build.xml

Log:
Ant top-level target rework to allow single-platform use.  Not that  
whereas ant build used to imply, by dependence through -do, dist, it is  
now just building (and the default target is changed to dist).  For  
develepment work, consider ant dist-dev to build a single-platform  
distribution without docs or samples.  For single-platform work,  
consider ant dist-one (or ant buildonly, which now does only one  
platform).

Review by: zundel, scottb

Modified: trunk/build.xml
==
--- trunk/build.xml (original)
+++ trunk/build.xml Fri Jun 12 19:28:21 2009
@@ -1,4 +1,4 @@
-project name=GWT default=build basedir=.
+project name=GWT default=dist basedir=.
property name=gwt.root location=. /
property name=project.tail value= /
import file=${gwt.root}/common.ant.xml /
@@ -6,67 +6,99 @@
!-- build is the default when subprojects are directly targetted  --
property name=target value=build /

+  !--
+ Convenience for the descending calls we make.  Use gwt.ant to
+ call into another directory, and this to call in the same build.xml
+--
+  macrodef name=call-subproject
+attribute name=subproject /
+attribute name=subtarget /
+sequential
+  antcall target=@{subproject}
+param name=target value=@{subtarget} /
+  /antcall
+/sequential
+  /macrodef
+
property name=gwt.apicheck.config
  location=tools/api-checker/config/gwt16_20userApi.conf/

-  target name=buildonly depends=dev, user, servlet, jni  
description=Build without docs/samples
-gwt.ant dir=distro-source /
+  target name=buildonly depends=dev-one, user, servlet, jni-one
+  description=Minimal one-platform devel build, without distro  
packaging
/target

-  target name=dist depends=dev, user, servlet, tools, jni, doc,  
samples description=Run the distributions
+  target name=dist depends=build, doc description=Make all the  
distributions
  gwt.ant dir=distro-source /
/target

-  target name=dev depends=buildtools description=Run dev
+  target name=dist-one depends=buildonly, tools, samples, doc  
description=Make only this platform's distribution
+gwt.ant dir=distro-source target=${build.host.platform} /
+  /target
+
+  target name=dist-dev depends=buildonly, tools description=Make  
this platform's distribution, minus doc and samples
+gwt.ant dir=distro-source target=${build.host.platform} /
+  /target
+
+  target name=dev depends=buildtools description=Builds (or runs  
${target} if set) all the dev libraries
  gwt.ant dir=dev /
/target

-  target name=user depends=buildtools, dev description=Run user
+  target name=dev-one depends=buildtools description=Builds only the  
dev library for this platform
+gwt.ant dir=dev target=${build.host.platform}/
+gwt.ant dir=dev target=oophm/
+  /target
+
+  target name=user depends=buildtools, dev-one description=Builds  
(or runs ${target} if set) only the user library
  gwt.ant dir=user /
/target

-  target name=tools depends=buildtools, user description=Run tools
+  target name=tools depends=buildtools, user description=Builds (or  
runs ${target} if set) only the tools
  gwt.ant dir=tools /
/target

-  target name=servlet depends=buildtools, user description=Run  
servlet
+  target name=servlet depends=buildtools, user description=Builds  
(or runs ${target} if set) only the servlet jar
  gwt.ant dir=servlet /
/target

-  target name=jni description=Run jni
+  target name=jni description=Builds (or runs ${target} if set) jni  
for all platforms
  gwt.ant dir=jni /
/target

-  target name=doc depends=buildtools, user description=Build doc
+  target name=jni-one description=Builds jni for only this platform
+gwt.ant dir=jni target=${build.host.platform} /
+  /target
+
+  target name=doc depends=buildtools, user description=Builds (or  
runs ${target} if set) the doc
  gwt.ant dir=doc /
/target

-  target name=samples depends=dev, user description=Build samples
+  target name=samples depends=dev-one, user description=Builds (or  
runs ${target} if set) the samples
  gwt.ant dir=samples /
/target

-  target name=buildtools description=Build the build tools
+  target name=buildtools description=Build (or runs ${target} if set)  
the build tools
  gwt.ant dir=build-tools /
/target

-  target name=-do depends=dist description=Run all subprojects /
-
-  target name=build description=Builds GWT
-antcall target=-do
-  param name=target value=build /
-/antcall
+  target name=build description=Builds GWT, including samples, but  
without distro packaging
+  depends=dev, user, servlet, tools, jni, samples
/target

-  target name=checkstyle 

[gwt-contrib] Re: Changing JsArrayT extends JavaScriptObject to JsArrayT

2009-06-12 Thread Ray Cromwell

BTW, the last proposal is very unsafe with some form of escape
analysis since it is unsafe to pass references to classes which
reference local scope to other scopes. Another possibility is a form
of 'destructuring' of Iterator classes by inlining them completely
into local scope vs escape analysis and then forgoing separate
construction.

A simpler way to maintain for-each with JRE collections without
creating objects is to change the way that for-each deals with
IterableT when T is a List.

The compiler could change:
for(T x : foo) { ... }

where foo is a ListT

into

for(int i=0; ifoo.size(); ++i) {
   T x = foo.get(i);
}

instead of calling foo.iterator() and using Iterator methods.

-Ray

On Fri, Jun 12, 2009 at 7:31 PM, Ray Cromwellcromwell...@gmail.com wrote:
 I'm in the process of some final tweaks on GQuery, so I'll look at how
 much of my private JSArray class I can move over as a patch.

 One possibility for avoiding Iterator object creation without using
 flyweights is to introduce a new Iterator type which contains methods
 which are parameterized by the collection and which use my Extension
 Method/Category method JSO trick.

 public class FastIteratorT extends JavaScriptObject {
   protected FastIterator() {}
   public S, T extends ListS FastIteratorS make(TS  list) {
      return (FastIteratorS)(GWT.isScript() ? makeWeb() : makeHosted());
   }

   private final native FastIterator makeWeb() /*-{
      return 0;
   }-*/;

   private final native FastIterator makeHosted() /*-{
     return [0];
   }-*/;

   public final  int value() {
     return GWT.isScript() ? valueWeb() : valueHosted();
   }

   public native int valueWeb() /*-{
     return this;
   }-*/;

   public native int valueHosted() /*-{
     return this[0];
   }-*/;

   public native hasNext(ListT list) {
     return value()  list.size();
   }

   public native T next(ListT list) {
     return list.get(value()++); // unsure if using value() as rvalue
 will work here
   }
 }

 then you should be able to write code like

 ListString foo = getList();
 FastIteratorString iter = FastIterator.make(foo);

 while(iter.hasNext(foo)) {
  String s = iter.next(foo);
 }

 Why doesn't this create any additional objects? Because
 'iter'/FastIterator is actually a native JS number/scalar type, and
 what this is really doing is simulating the addition of
 hasNext()/next() to the number's prototype.

 We could dispense with the need for an additional parameter if GWT had
 a magic method for allocating new local variables/symbols in the local
 scope. Imagine if writing

 VariableT x = GWT.createVariable(0);

 was a magic method that just generated a 'var x = 0' declaration, only
 it promised to always be inlined and do so in the caller's scope.
 'Variable' would be a magic class that never creates fields on the
 actual object themselves and are pruned/removed at runtime.

 Then you could have FastIterator impersonate a reference to the
 underlying ListT, and rewrite hasNext()/next() as:

 VariableInt x = GWT.createVariableInt(0);
 public boolean hasNext() {
   return x.get()  this.size();
 }

 public T next() {
   return this.get(x.get()++); // or x.postIncrement()
 }

 this would produce code that would create no additional objects as
 well as maintain Iterator-like interface.

 -Ray


 On Thu, Jun 11, 2009 at 7:25 AM, Stefan Hausteinhaust...@google.com wrote:
 +1 Ray
 Could you contribute your implementation(s)?

 On Thu, Jun 11, 2009 at 12:51 PM, Joel Webber j...@google.com wrote:

 +1 Ray. Now here's the really tricky question. Is there any way we can
 take advantage of Javascript's for (x in y) { ... } syntax (and should we,
 given its spotty performance)? My intuition tells me that the only way we
 could use it would be through a callback, because there's nothing like .NET
 generators/yield in Javascript.
 On Wed, Jun 10, 2009 at 7:26 PM, Ray Cromwell cromwell...@gmail.com
 wrote:

 My take on this is that there is many places where I'd like to avoid
 JRE collections, but the basic JsArray is too much of a downgrade. I
 don't mind changing it to T if it doesn't effect performance cause
 then I could subclass it, but as an example of the stuff I would like
 in a 'FastArrayList' that is not a collections derivative:

 1) add() instead of just set(length(), item) (e.g. push)
 2) addAll(anotherFastArrayList) (e.g. concat)
 3) splice
 4) toArray() (webmode is reinterpret cast op)
 5) remove
 6) shift/unshift (useful for queue when combined with pop)

 I use the following pattern all over GQuery to avoid JRE collections
 but preserve for-each

 for(Foo f : fooList.elements()) { ... }

 where fooList is my own JsArrayT class, and elements() returns T[]
 via reinterpret cast in webmode.

 -Ray



 On Thu, Jun 11, 2009 at 2:43 AM, Lex Spoonsp...@google.com wrote:
 
  Bah, mis-send.  What I was typing was:
 
 
  I though the point was to get rid of JRE collections?  Anyway, the
  collection in question is used as a queue.  I would hate to see its