com.allen_sauer.gwt.dnd.demo.client.example.matryoshka
Class MatryoshkaSetWidgetDropController

java.lang.Object
  extended by com.allen_sauer.gwt.dnd.client.drop.AbstractDropController
      extended by com.allen_sauer.gwt.dnd.client.drop.SimpleDropController
          extended by com.allen_sauer.gwt.dnd.demo.client.example.matryoshka.MatryoshkaSetWidgetDropController
All Implemented Interfaces:
DropController

public class MatryoshkaSetWidgetDropController
extends SimpleDropController

DropController which allows a widget to be dropped on a SimplePanel drop target when the drop target does not yet have a child widget. Also pops the parent widget to the top of stack by re-attaching it to the grandparent.


Constructor Summary
MatryoshkaSetWidgetDropController(com.google.gwt.user.client.ui.SimplePanel dropTarget)
           
 
Method Summary
 void onDrop(DragContext context)
          Called when the draggable widget or its proxy is dropped on our drop target.
 void onEnter(DragContext context)
          Called when the draggable widget or its proxy engages our drop target.
 void onLeave(DragContext context)
          Called when the reference widget stops engaging our drop target by leaving the area of the page occupied by our drop target, or after DropController.onDrop(DragContext) to allow for any cleanup.
 void onPreviewDrop(DragContext context)
          Called just prior to DropController.onDrop(DragContext) to allow the drop operation to be cancelled by throwing a VetoDragException.
 
Methods inherited from class com.allen_sauer.gwt.dnd.client.drop.AbstractDropController
getDropTarget, onMove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatryoshkaSetWidgetDropController

public MatryoshkaSetWidgetDropController(com.google.gwt.user.client.ui.SimplePanel dropTarget)
Method Detail

onDrop

public void onDrop(DragContext context)
Description copied from interface: DropController
Called when the draggable widget or its proxy is dropped on our drop target. Implementing classes must attach the draggable widget to our drop target in a suitable manner.

Specified by:
onDrop in interface DropController
Overrides:
onDrop in class AbstractDropController
Parameters:
context - the current drag context
See Also:
DropController.onPreviewDrop(DragContext)

onEnter

public void onEnter(DragContext context)
Description copied from interface: DropController
Called when the draggable widget or its proxy engages our drop target. This occurs when the widget area and the drop target area intersect and there are no drop targets which are descendants of our drop target which also intersect with the widget. If there are, the widget engages with the descendant drop target instead.

Specified by:
onEnter in interface DropController
Overrides:
onEnter in class AbstractDropController
Parameters:
context - the current drag context
See Also:
DropController.onLeave(DragContext)

onLeave

public void onLeave(DragContext context)
Description copied from interface: DropController
Called when the reference widget stops engaging our drop target by leaving the area of the page occupied by our drop target, or after DropController.onDrop(DragContext) to allow for any cleanup.

Specified by:
onLeave in interface DropController
Overrides:
onLeave in class AbstractDropController
Parameters:
context - the current drag context
See Also:
DropController.onEnter(DragContext)

onPreviewDrop

public void onPreviewDrop(DragContext context)
                   throws VetoDragException
Description copied from interface: DropController
Called just prior to DropController.onDrop(DragContext) to allow the drop operation to be cancelled by throwing a VetoDragException.

Specified by:
onPreviewDrop in interface DropController
Overrides:
onPreviewDrop in class AbstractDropController
Parameters:
context - the current drag context
Throws:
VetoDragException - if the proposed operation is unacceptable