How to intercept ONPASTE events

2010-09-10 Thread jjd
In order to modify what gets pasted to my application, I'm attempting
to intercept ONPASTE events as described by Jim Douglas in this
thread:

http://groups.google.com/group/google-web-toolkit/browse_thread/thread/09a3527707d22be0?fwc=1

The problem is that I'm never seeing the ONPASTE event occur.  I've
tried firefox and safari.

I'm able to see MOUSEDOWN detected and I get "BROWSER EVENT DETECTED"
whenever I move the mouse over the RichTextAreaWithPaste (see code
below), but whether I use Control-V (or Command-V on the Mac) or the
context menu for pasting, I never see "PASTE DETECTED".

I'm wondering if anyone has any clues that might help?

Thanks,

--Jim Dempsey--


Here's my subclass of RichTextArea:

package com.whatever.client;

import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.RichTextArea;

public class RichTextAreaWithPaste extends RichTextArea {

   public RichTextAreaWithPaste() {
   super();
   sinkEvents(Event.ONPASTE);
   sinkEvents(Event.ONMOUSEDOWN);

   }

   @Override
   public void onBrowserEvent(Event event) {
   super.onBrowserEvent(event);
   log("BROWSER EVENT DETECTED");
   switch (event.getTypeInt()) {
   case Event.ONPASTE:
log("PASTE DETECTED");
   break;
   case Event.ONMOUSEDOWN:
   log("MOUSEDOWN DETECTED");
}
   }
}

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Cleaning up threads on GWT application shutdown

2010-06-17 Thread jjd
Jason and jhulford,

Thanks for your advice.  I checked into ServletContextListener and it
looks like it should work fine.  I'm about to give it a try.

Thanks.

--Jim--

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Cleaning up threads on GWT application shutdown

2010-06-09 Thread jjd
I have a GWT application that starts an independent thread and leaves
it running for use by multiple GWT sessions.

It appears that under Tomcat, when I Stop of Undeploy the application,
this thread keeps running.  I can't figure out the right way to manage
shutting down the thread when the application is stopped (but tomcat
keeps running).

I tried adding a ShutdownHook using
Runtime.getRuntime().addShutdownHook(), but that doesn't get called
until Tomcat itself is shutdown.

What is the proper way to manage threads at application shutdown time?

Thanks,

--Jim--

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.