fredsa / gwt-dnd

Library providing easy to use mouse or touch based drag-and-drop capabilities to GWT
42 stars 41 forks source link

There is no way to programmatically cancel a drag operation #119

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of GWT are you using? 1.3.3? 1.4.60? Other?
GWT 2.0.1

What version of the gwt-dnd jar file or library file are you using?
gwt-dnd-3.0.1

I'd like my GWT app to cancel dragging when user presses Escape key. I was 
looking for a way to programmatically cancel a drag operation.
I would expect a method in DragController that cancels current drag. I tried 
using endDrag();, but since it's a callback method it didn't work.

I looked at the source of gwt-dnd and haven't found any hook which would let me 
do that, therefore I report it as a possible enhancement.

Original issue reported on code.google.com by dsto...@gmail.com on 16 Aug 2010 at 3:12

GoogleCodeExporter commented 9 years ago
You can throw a VetoDragException in your DragHandler

Original comment by fredsa@google.com on 25 Aug 2010 at 11:10

GoogleCodeExporter commented 9 years ago
I tried to add code to throw a VetoDragException in my DragHandler but it seems 
the only place to put VetoDragException is in onPreviewDrop which declares that 
it throws VetoDragException. previewDragEnd catches VetoDragException and 
behaves appropriately. But previewDragEnd is only called on mouse up.

But what I need and what the original post asked for was a way to press the 
Escape key while still dragging (mouse up has yet to happen).

Original comment by ToonT...@gmail.com on 4 May 2013 at 4:59