am relatively very new to gwt n dnd.. i have created a composite widget.. when i try to make the object of the composite widget draggable it throws an exception "dragHandle must implement HasMouseDownHandlers, HasMouseUpHandlers, HasMouseMoveHandlers and HasMouseOutHandlers to be draggable" am i missing something very importand?
Thanks, sindhu
This takes three parameters: BuildContext: Context of a Widget. candidateData: It contains the list of draggable data which will be accepted by DragTarget. rejectedData: It contains the list of Draggable data which will not be accepted by DragTarget.
Draggable is a Flutter widget that you can drag or move around. As soon as the user click and starts dragging the Draggable widget, a new feedback widget appears and follows the user's finger or mouse pointer. When the user lifts the finger or mouse pointer, the feedback widget disappears.
You can implement them like this:
public class MyWidget extends Composite implements HasAllMouseHandlers, HasClickHandlers {
...
public HandlerRegistration addClickHandler(ClickHandler handler) {
return addDomHandler(handler, ClickEvent.getType());
}
public HandlerRegistration addMouseDownHandler(MouseDownHandler handler) {
return addDomHandler(handler, MouseDownEvent.getType());
}
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
return addDomHandler(handler, MouseMoveEvent.getType());
}
public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) {
return addDomHandler(handler, MouseOutEvent.getType());
}
public HandlerRegistration addMouseOverHandler(MouseOverHandler handler) {
return addDomHandler(handler, MouseOverEvent.getType());
}
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
return addDomHandler(handler, MouseUpEvent.getType());
}
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
return addDomHandler(handler, MouseWheelEvent.getType());
}
}
To get your widget d'n'd working, see this http://groups.google.com/group/gwt-dnd/browse_thread/thread/85039aaa229d53cf/f5ad10ff9a37ab9d?lnk=gst&q=custom+widget#f5ad10ff9a37ab9d
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With