Class CmsImageDndController
java.lang.Object
org.opencms.ade.containerpage.client.CmsImageDndController
- All Implemented Interfaces:
I_CmsDNDController
DND controller for drag/drop of images from the gallery menu.
Since the image drag and drop logic is mostly separate from the container drag and drop logic, the container page DND controller delegates most of the drag and drop logic to this class if it detects that an image is being dragged.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe attribute used to mark image drop zones. -
Constructor Summary
ConstructorsConstructorDescriptionCmsImageDndController(CmsContainerpageController controller) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected List<org.opencms.ade.containerpage.client.CmsImageDndController.ImageDropTarget> Collects the valid drop targets for images from the page and initializes them.voidonAnimationStart(I_CmsDraggable draggable, I_CmsDropTarget target, CmsDNDHandler handler) Executed when end animation starts.booleanonBeforeDrop(I_CmsDraggable draggable, I_CmsDropTarget target, CmsDNDHandler handler) Executed before drop.voidonDragCancel(I_CmsDraggable draggable, I_CmsDropTarget target, CmsDNDHandler handler) Executed on drag cancel.booleanonDragStart(I_CmsDraggable draggable, I_CmsDropTarget target, CmsDNDHandler handler) Executed on drag start.voidonDrop(I_CmsDraggable draggable, I_CmsDropTarget target, CmsDNDHandler handler) Executed on drop.voidonPositionedPlaceholder(I_CmsDraggable draggable, I_CmsDropTarget target, CmsDNDHandler handler) Executed after the placeholder has been positioned inside a drop target.booleanonTargetEnter(I_CmsDraggable draggable, I_CmsDropTarget target, CmsDNDHandler handler) Executed when the helper is dragged into a drop target.voidonTargetLeave(I_CmsDraggable draggable, I_CmsDropTarget target, CmsDNDHandler handler) Executed when the helper is dragged out of a drop target.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opencms.gwt.client.dnd.I_CmsDNDController
postClear, startPlacementMode
-
Field Details
-
ATTR_DATA_IMAGEDND
The attribute used to mark image drop zones.- See Also:
-
-
Constructor Details
-
CmsImageDndController
Creates a new instance.- Parameters:
controller- the container page controller
-
-
Method Details
-
onAnimationStart
public void onAnimationStart(I_CmsDraggable draggable, I_CmsDropTarget target, CmsDNDHandler handler) Description copied from interface:I_CmsDNDControllerExecuted when end animation starts.- Specified by:
onAnimationStartin interfaceI_CmsDNDController- Parameters:
draggable- the draggable itemtarget- the current drop targethandler- the drag and drop handler instance- See Also:
-
onBeforeDrop
public boolean onBeforeDrop(I_CmsDraggable draggable, I_CmsDropTarget target, CmsDNDHandler handler) Description copied from interface:I_CmsDNDControllerExecuted before drop.- Specified by:
onBeforeDropin interfaceI_CmsDNDController- Parameters:
draggable- the draggable itemtarget- the current drop targethandler- the drag and drop handler instance- Returns:
falseto cancel dropping- See Also:
-
onDragCancel
Description copied from interface:I_CmsDNDControllerExecuted on drag cancel.- Specified by:
onDragCancelin interfaceI_CmsDNDController- Parameters:
draggable- the draggable itemtarget- the current drop targethandler- the drag and drop handler instance- See Also:
-
onDragStart
Description copied from interface:I_CmsDNDControllerExecuted on drag start.- Specified by:
onDragStartin interfaceI_CmsDNDController- Parameters:
draggable- the draggable itemtarget- the current drop targethandler- the drag and drop handler instance- Returns:
falseto cancel dragging- See Also:
-
onDrop
Description copied from interface:I_CmsDNDControllerExecuted on drop.- Specified by:
onDropin interfaceI_CmsDNDController- Parameters:
draggable- the draggable itemtarget- the current drop targethandler- the drag and drop handler instance- See Also:
-
onPositionedPlaceholder
public void onPositionedPlaceholder(I_CmsDraggable draggable, I_CmsDropTarget target, CmsDNDHandler handler) Description copied from interface:I_CmsDNDControllerExecuted after the placeholder has been positioned inside a drop target.- Specified by:
onPositionedPlaceholderin interfaceI_CmsDNDController- Parameters:
draggable- the draggable itemtarget- the current drop targethandler- the drag and drop handler instance- See Also:
-
onTargetEnter
public boolean onTargetEnter(I_CmsDraggable draggable, I_CmsDropTarget target, CmsDNDHandler handler) Description copied from interface:I_CmsDNDControllerExecuted when the helper is dragged into a drop target.- Specified by:
onTargetEnterin interfaceI_CmsDNDController- Parameters:
draggable- the draggable itemtarget- the current drop targethandler- the drag and drop handler instance- Returns:
falseto cancel entering target (placeholder will not positioned inside target)- See Also:
-
onTargetLeave
Description copied from interface:I_CmsDNDControllerExecuted when the helper is dragged out of a drop target.- Specified by:
onTargetLeavein interfaceI_CmsDNDController- Parameters:
draggable- the draggable itemtarget- the current drop targethandler- the drag and drop handler instance- See Also:
-
findImageTargets
protected List<org.opencms.ade.containerpage.client.CmsImageDndController.ImageDropTarget> findImageTargets()Collects the valid drop targets for images from the page and initializes them.- Returns:
- the list of drop targets
-