ch.unifr.pai.twice.dragndrop.client.intf
Interface DropTargetHandler

All Known Implementing Classes:
DropTargetHandlerAdapter, HighlightDropTargetHandler

public interface DropTargetHandler

The handler defining the logic for drop targets

Author:
Oliver Schmid

Method Summary
 DropTargetHandlerFactory.Priority getPriority()
           
 boolean onDrop(java.lang.String deviceId, com.google.gwt.user.client.ui.Widget widget, com.google.gwt.dom.client.Element dragProxy, com.google.gwt.user.client.Event event, java.lang.Double intersectionPercentage, java.lang.Double intersectionPercentageWithTarget)
          Invoked when a widget is dropped above the drop target
 void onHover(java.lang.String deviceId, com.google.gwt.user.client.ui.Widget widget, com.google.gwt.dom.client.Element dragProxy, com.google.gwt.user.client.Event event, java.lang.Double intersectionPercentage, java.lang.Double intersectionPercentageWithTarget)
          Invoked when a widget hovers the drop target
 void onHoverEnd(java.lang.String deviceId, com.google.gwt.user.client.ui.Widget widget, com.google.gwt.dom.client.Element dragProxy, com.google.gwt.user.client.Event event)
          Invoked when a widget leaves the region of the drop target
 

Method Detail

onDrop

boolean onDrop(java.lang.String deviceId,
               com.google.gwt.user.client.ui.Widget widget,
               com.google.gwt.dom.client.Element dragProxy,
               com.google.gwt.user.client.Event event,
               java.lang.Double intersectionPercentage,
               java.lang.Double intersectionPercentageWithTarget)
Invoked when a widget is dropped above the drop target

Parameters:
deviceId - - the identifier of the device that triggered the drop
widget - - the widget which is dragged (this is the original widget and not the dragging proxy!)
dragProxy - - the HTML element of the proxy
event - - the event that has caused the invocation of the onEndOfDrop (e.g. a mouse up event)
intersectionPercentage - - the percentage of intersection with the drop target
intersectionPercentageWithTarget -
Returns:
true if the drop shall be accepted, false if the drop shall be rejected

onHover

void onHover(java.lang.String deviceId,
             com.google.gwt.user.client.ui.Widget widget,
             com.google.gwt.dom.client.Element dragProxy,
             com.google.gwt.user.client.Event event,
             java.lang.Double intersectionPercentage,
             java.lang.Double intersectionPercentageWithTarget)
Invoked when a widget hovers the drop target

Parameters:
deviceId - - the identifier of the device that triggered the drop
widget - - the widget which is dragged (this is the original widget and not the dragging proxy!)
dragProxy - - the HTML element of the proxy
event - - the event that has caused the invocation of the onEndOfDrop (e.g. a mouse up event)
intersectionPercentage - - the percentage of intersection with the drop target
intersectionPercentageWithTarget -

onHoverEnd

void onHoverEnd(java.lang.String deviceId,
                com.google.gwt.user.client.ui.Widget widget,
                com.google.gwt.dom.client.Element dragProxy,
                com.google.gwt.user.client.Event event)
Invoked when a widget leaves the region of the drop target

Parameters:
deviceId - - the identifier of the device that triggered the drop
widget - - the widget which is dragged (this is the original widget and not the dragging proxy!)
dragProxy - - the HTML element of the proxy
event - - the event that has caused the invocation of the onEndOfDrop (e.g. a mouse up event)

getPriority

DropTargetHandlerFactory.Priority getPriority()
Returns:
the DropTargetHandlerFactory.Priority of the drop target