My favorites | Sign in
Project Logo
                
Search
for
Updated Dec 15, 2007 by fredsa
Labels: Featured
APIMigrationGuide_v1_to_v2  
API Migration Guide from 1.x to 2.x

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

// PLEASE NOTE: A lot has changed from 1.x to 2.x //

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Changes for gwt-dnd-2.0.2.jar

Category 1.x API 2.x API Comments
Java pacakges com.allen_sauer.gwt.dragdrop.client.... com.allen_sauer.gwt.dnd.client.... Allows for coexistance of 1.x and 2.x APIs in a single project.
Jar file gwt-dragdrop-<version>.jar gwt-dnd-<version>.jar Consistency with gwt-dnd project name.
GWT Module name com.allen_sauer.gwt.dragdrop.DragAndDrop com.allen_sauer.gwt.dnd.gwt-dnd Consistency with gwt-dnd project name.
Your GWT Module XML File <inherits name='com.allen_sauer.gwt.dragdrop.DragAndDrop'/> <inherits name='com.allen_sauer.gwt.dnd.gwt-dnd'/> Reflects new module name.

Class CSS Style Name Comments
AbstractDropController dragdrop-engage The legacy CSS style name dragdrop-engage is no longer applied. However, dragdrop-dropTarget and dragdrop-dropTarget-engage are still applied.
AbsolutePositionDropController dragdrop-absolute-positioning-drop-target No longer applied.
GridConstrainedDropController dragdrop-grid-constrained-drop-target No longer applied.
NoOverlapDropController dragdrop-no-overlap-drop-target No longer applied.

Class Method Signature Comments
DragController interface void resetCache() Reset the internal drop controller (drop target) cache which is initialized by dragStart(Widget). This method should be called when a drop target's size and/or location changes, or when drop target eligibility changes.
DragController interface boolean getBehaviorBoundaryPanelDrop(), void setBehaviorBoundaryPanelDrop(boolean) Whether dropping on the boundary panel is permitted. Was setConstrainWidgetToBoundaryPanel(boolean) in previously releases.
DragController interface boolean getBehaviorConstrainedToBoundaryPanel(), void setBehaviorConstrainedToBoundaryPanel(boolean) Whether the draggable should be constrained to the boundary panel during dragging.
DragController interface int getBehaviorDragStartSensitivity(), void setBehaviorDragStartSensitivity(int) Number of pixels the mouse must be moved either horizontally or vertically before dragging begins.
DragController interface boolean getBehaviorMultipleSelection(), setBehaviorMultipleSelection(boolean), void clearSelection(), void toggleSelection(Widget) Enabled/Disable/control multiple selections via CTRL/META-click.
DragController interface void dragMove() Called during dragging when the mouse is moved.
PickupDragController boolean getBehaviorDragProxy(), void setBehaviorDragProxy(boolean) Whether a drag proxy should be used.
AbstractIndexedDropController protected abstract LocationWidgetComparator getLocationWidgetComparator() See implementing classes for examples.

Where possible, the old method has been marked as deprecated, then implementation in the first implementing abstract base class has been made final, and the method body throws UnsupportedOperationException. The latter ensures that existing subclasses are updated to use the new 2.x API.

Class Old Signature New Signature Comments
DragController interface void previewDragStart(Widget) void previewDragStart() Information is available via the current DragContext.
DragController interface void dragStart(Widget) void dragStart() Information is available via the current DragContext.
DragController interface void previewDragEnd(Widget, Widget) void previewDragEnd() Information is available via the current DragContext.
DragController interface void dragEnd(Widget, Widget) void dragEnd() Information is available via the current DragContext.
PickupDragController Widget maybeNewDraggableProxy(Widget) Widget newDragProxy(DragContext) Now only called when getBehaviorDragProxy() returns true.
DropControler interface void onEnter(Widget, Widget, DragController) void onEnter(DragContext) Information is available via the current DragContext.
DropControler interface void onMove(Widget, Widget, DragController) void onMove(DragContext) Information is available via the current DragContext.
DropControler interface void onPreviewDrop(Widget, Widget, DragController) void onPreviewDrop(DragContext) Information is available via the current DragContext.
DropControler interface void onDrop(Widget, Widget, DragController) void onDrop(DragContext) Information is available via the current DragContext.
DropControler interface void onLeave(Widget, DragController) void onLeave(DragContext) Information is available via the current DragContext.

Old Location New Location Old Signature New Signature Comments
DragController interface PickupDragController BoundaryDropController newBoundaryDropController(AbsolutePanel, boolean) protected BoundaryDropController newBoundaryDropController(AbsolutePanel, boolean) Note: Method visibility changed in addition to the relocation.
DragController interface PickupDragController void registerDropController(DropController) (unchanged) Drag-and-drop behavior is represented by PickupDragController whereas DragController may be used for resizing of widgets, activating slider widgets, etc.
DragController interface PickupDragController void unregisterDropController(DropController) (unchanged) Drag-and-drop behavior is represented by PickupDragController whereas DragController may be used for resizing of widgets, activating slider widgets, etc.
DragController interface PickupDragController void restoreDraggableLocation(Widget) protected void restoreSelectedWidgetsLocation() New method restores locations of all currently selected widgets.
DragController interface PickupDragController void restoreDraggableStyle(Widget) protected void restoreSelectedWidgetsStyle() New method restores style for all currently selected widgets.
DragController interface PickupDragController void saveDraggableLocationAndStyle(Widget) protected void saveSelectedWidgetsLocationAndStyle() New method saves information for all currently selected widgets.

Class Method Signature Comments
DragController interface Widget getMovableWidget() No longer part of the API due to much of the MouseDragHandler implementation having moved to PickupDragController.
DragController interface void notifyDragEnd(DragEndEvent) No longer part of the API. Notifications are now sent directly by AbstractDragController#dragEnd.
DragController interface DropController getIntersectDropController(Widget) This implementation detail is no longer exposed.
AbstractDragController protected DropControllerCollection getDropControllerCollection() This implementation detail is no longer exposed. To alter drop target selection behavior, subclasses should override registerDropController(DropController), unregisterDropController(DropController), resetCache(). They may wish to implement their own version of a DropControllerCollection, to be used in these overridden methods.
DropController interface String getDropTargetStyleName() No longer part of the API. Selectively apply your own CSS style names instead.
AbstractDropController public DragController getCurrentDragController() No longer part of the API. See the current DragContext for this information.
AbstractDropController DragEndEvent makeDragEndEvent(Widget, Widget, DragController) No longer part of the API as DragEndEvent now always simply wraps the current DragContext.
AbstractPositioningDropController Widget getPositioner() No longer a part of the API. Multiple positioners are handled internally by the DropController.
AbstractPositioningDropController Widget newPositioner(Widget) No longer a part of the API. Multiple positioners are handled internally by the DropController.
AbsolutePositionDropController DropTargetInfo getDropTargetInfo() No longer part of the API. You may find the current DragContext useful.
AbsolutePositionDropController Location getConstrainedLocation(Widget, Widget, Widget) This implementation detail is no longer part of the API.

Class Comments
IndexedDragEndEvent Use DragEndEvent instead.
AbsolutePositionDragEndEvent Use DragEndEvent instead.
MouseDragHandler Implemention class is no longer exposed.
DeferredMoveCommand Implemention class is no longer exposed.
DropControllerCollection Implemention class is no longer exposed.
DropTargetInfo Obsolete implementation class.
NoOverlapDropController This somewhat contrived example has been removed.
VetoDropException Use VetoDragException instead.

Use cases involving these deprecated constants probably included selectively removing selected CSS style names at runtime under specific drag conditions. The recommended alternative approach is to selectively add your own CSS style names at runtime.

Class Constant Comments
AbstractDragController protected static final String CSS_DRAGGABLE = "dragdrop-draggable" This constant is now deprecated and will no longer be exposed in a future release.
AbstractDragController protected static final String CSS_DRAGGING = "dragdrop-dragging" This constant is now deprecated and will no longer be exposed in a future release.
AbstractDragController protected static final String CSS_HANDLE = "dragdrop-handle" This constant is now deprecated and will no longer be exposed in a future release.
AbstractDropController protected static final String CSS_DROP_TARGET_ENGAGE = "dragdrop-dropTarget-engage" This constant is now deprecated and will no longer be exposed in a future release.
PickupDragController protected static final String CSS_MOVABLE_PANEL = "dragdrop-movable-panel" This constant is now deprecated and will no longer be exposed in a future release.
PickupDragController protected static final String CSS_PROXY = "dragdrop-proxy" This constant is now deprecated and will no longer be exposed in a future release.

These methods have been deprecated and delegate to their new counterparts.

Class Old Method (deprecated) New Method Comments
DragController interface void setConstrainWidgetToBoundaryPanel(boolean) void setBehaviorConstrainedToBoundaryPanel(boolean) Modified method name to align multiple setBehavior*() configuration methods.
PickupDragController public boolean isDragProxyEnabled() public boolean getBehaviorDragProxy() Modified method name to align multiple getBehvaior*() configuration methods.
PickupDragController public void setDragProxyEnabled(boolean) public void setBehaviorDragProxy(boolean) Modified method name to align multiple setBehvaior*() configuration methods.

Hosted by Google Code