com.allen_sauer.gwt.dnd.client.drop
Class AbstractInsertPanelDropController

java.lang.Object
  extended by com.allen_sauer.gwt.dnd.client.drop.AbstractDropController
      extended by com.allen_sauer.gwt.dnd.client.drop.AbstractPositioningDropController
          extended by com.allen_sauer.gwt.dnd.client.drop.AbstractInsertPanelDropController
All Implemented Interfaces:
DropController
Direct Known Subclasses:
FlowPanelDropController, HorizontalPanelDropController, VerticalPanelDropController

public abstract class AbstractInsertPanelDropController
extends AbstractPositioningDropController

A DropController for InsertPanel drop targets.


Field Summary
protected  int dropIndex
           
protected  com.google.gwt.user.client.ui.InsertPanel dropTarget
          Our drop target.
 
Constructor Summary
AbstractInsertPanelDropController(com.google.gwt.user.client.ui.InsertPanel dropTarget)
           
 
Method Summary
protected abstract  LocationWidgetComparator getLocationWidgetComparator()
          Required implementation method which provides the desired comparator strategy.
protected abstract  com.google.gwt.user.client.ui.Widget newPositioner(DragContext context)
          Called by onEnter(DragContext) to create a new positioner widget for this InsertPanel drop target.
 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 onMove(DragContext context)
          Called with each mouse movement while the reference widget is engaging our drop target.
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dropTarget

protected final com.google.gwt.user.client.ui.InsertPanel dropTarget
Our drop target.


dropIndex

protected int dropIndex
Constructor Detail

AbstractInsertPanelDropController

public AbstractInsertPanelDropController(com.google.gwt.user.client.ui.InsertPanel dropTarget)
Parameters:
dropTarget - the insert panel drop target
See Also:
FlowPanelDropController.FlowPanelDropController(com.google.gwt.user.client.ui.FlowPanel)
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)

onMove

public void onMove(DragContext context)
Description copied from interface: DropController
Called with each mouse movement while the reference widget is engaging our drop target. DropController.onEnter(DragContext) is called before this method is called.

Specified by:
onMove in interface DropController
Overrides:
onMove in class AbstractDropController
Parameters:
context - the current drag context
See Also:
DropController.onEnter(DragContext), DropController.onLeave(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

getLocationWidgetComparator

protected abstract LocationWidgetComparator getLocationWidgetComparator()
Required implementation method which provides the desired comparator strategy.

Returns:
the comparator strategy to be used

newPositioner

protected abstract com.google.gwt.user.client.ui.Widget newPositioner(DragContext context)
Called by onEnter(DragContext) to create a new positioner widget for this InsertPanel drop target. Override this method to customize the look and feel of your positioner. The positioner widget may not have any CSS borders or margins, although there are no such restrictions on the children of the positioner widget. If borders and/or margins are desired, wrap that widget in a SimplePanel with a 0px border and margin.

Parameters:
context - The current drag context.
Returns:
a new positioner widget


Copyright © 2011 Sage Software, Inc. All rights reserved.