fredsa / gwt-dnd

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

makeDraggable should not take a Widget but a more specific interface. #103

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?
2.0.0

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

What operating system(s) are you using? Windows? Linux? Mac?
Windows 7

Does the issue occur in web mode, hosted mode, both or don't know?
N/A

What browser(s) do you use? Firefox, IE, Safari, other?
FF, IE, Chrome

What is the browser version (if you know) from Help->About?
FF 3.5.x
IE 8.x
Chrome 5.x (dev)

What steps will reproduce the problem? Please attach sample code if you
can.

// setup 
AbsolutePanel dragArea = new AbsolutePanel();
PickupDragController dragController= new PickupDragController(dragArea, true);
VerticalPanel dropArea = new VerticalPanel();
VerticalPanelDropController dropController = new
VerticalPanelDropController(dropArea);
dragController.registerDropController(dropController);
dragArea.add(dropArea);
RootPanel.get().add(dragArea);

HorizontalPanel cannotBeDragged = new HorizontalPanel();
dragController.makeDraggable(cannotBeDragged);

What is the expected output? What do you see instead?
I expected it to work as it is a Widget I am passing into the makeDraggable
function.

Do you have a workaround?
Yes, My widget now has a getDraggableWidget() function... but this is clumsy.  

Please provide any additional information below.
I think it'd be best if the function was something like:

void makeDraggable(HasDragHandle draggable);
void makeDraggable(HasAllMouseHandlers draggable);

That would be more clear to those using it.

Original issue reported on code.google.com by bes...@gmail.com on 9 Feb 2010 at 9:20

GoogleCodeExporter commented 9 years ago
I would love to be able to drag Elements!

Original comment by johan.ry...@gmail.com on 23 Apr 2010 at 5:07

GoogleCodeExporter commented 9 years ago
Yeah, element support would allow the dragging of Data Presentation Widgets 
(unless there's something I'm not quite understanding about them).

Original comment by antonvon...@gmail.com on 4 Mar 2011 at 5:26

GoogleCodeExporter commented 9 years ago
I also vote for Elements

Original comment by shaman.sir on 7 Sep 2011 at 1:35

GoogleCodeExporter commented 9 years ago
I am upvoting this change because it might help support drag and drop of 
individual cells in cell table / cell trees. If not please correct me.

Original comment by wdts...@google.com on 4 Jan 2012 at 9:49

GoogleCodeExporter commented 9 years ago
Support for Element is not planned. I'm afraid it's only Widget instances.

For a more modern way of doing things, please consider the HTML5 drag and drop 
API, which has support in GWT.

Original comment by fredsa on 31 Jan 2012 at 6:26