private void doRequest(DragEventType drop) {
if (currentDropHandler == null) {
return;
}
Paintable paintable = currentDropHandler.getPaintable();
ApplicationConnection client = currentDropHandler
.getApplicationConnection();
/*
* For drag events we are using special id that are routed to
* "drag service" which then again finds the corresponding DropHandler
* on server side.
*
* TODO add rest of the data in Transferable
*
* TODO implement partial updates to Transferable (currently the whole
* Transferable is sent on each request)
*/
visitId++;
client.updateVariable(DD_SERVICE, "visitId", visitId, false);
client.updateVariable(DD_SERVICE, "eventId", currentDrag.getEventId(),
false);
client.updateVariable(DD_SERVICE, "dhowner", paintable, false);
VTransferable transferable = currentDrag.getTransferable();
client.updateVariable(DD_SERVICE, "component",
transferable.getDragSource(), false);
client.updateVariable(DD_SERVICE, "type", drop.ordinal(), false);
if (currentDrag.getCurrentGwtEvent() != null) {
try {
MouseEventDetails mouseEventDetails = new MouseEventDetails(
currentDrag.getCurrentGwtEvent());
currentDrag.getDropDetails().put("mouseEvent",
mouseEventDetails.serialize());
} catch (Exception e) {
// NOP, (at least oophm on Safari) can't serialize html dd event
// to mouseevent
}
} else {
currentDrag.getDropDetails().put("mouseEvent", null);
}
client.updateVariable(DD_SERVICE, "evt", currentDrag.getDropDetails(),
false);
client.updateVariable(DD_SERVICE, "tra", transferable.getVariableMap(),
true);
}