fredsa / gwt-dnd

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

Make AbstractDragController implement isDraggable(Widget) #161

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of GWT are you using? 1.4.60? 2.0.4? Other?
2.4

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

Description
If somebody calls AbstractDragController.makeDraggable(...) multiple times on 
the same widget, then there is a memory leak because multiple mouse handlers 
get registered on the widget. In some circumstances, it can therefore be 
necessary to track which widgets have been made draggable and which have not.

An alternative would be for AbstractDragController to implement a method like 
this:
  public boolean isDraggable(Widget w) {
    return dragHandles.containsKey(w);
  }

Do you have a workaround?
Have your app track widgets itself. This does mean increased memory load 
though, since AbstractDragController already stores a map containing all the 
draggable widgets, so has everything needed to provide this method.

Original issue reported on code.google.com by ukcue...@gmail.com on 29 May 2012 at 2:10

GoogleCodeExporter commented 9 years ago

Original comment by fredsa@google.com on 28 Mar 2013 at 10:06