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
Modifier and TypeFieldDescriptionstatic final String
The attribute used to mark image drop zones. -
Constructor Summary
ConstructorDescriptionCmsImageDndController
(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.void
onAnimationStart
(I_CmsDraggable draggable, I_CmsDropTarget target, CmsDNDHandler handler) Executed when end animation starts.boolean
onBeforeDrop
(I_CmsDraggable draggable, I_CmsDropTarget target, CmsDNDHandler handler) Executed before drop.void
onDragCancel
(I_CmsDraggable draggable, I_CmsDropTarget target, CmsDNDHandler handler) Executed on drag cancel.boolean
onDragStart
(I_CmsDraggable draggable, I_CmsDropTarget target, CmsDNDHandler handler) Executed on drag start.void
onDrop
(I_CmsDraggable draggable, I_CmsDropTarget target, CmsDNDHandler handler) Executed on drop.void
onPositionedPlaceholder
(I_CmsDraggable draggable, I_CmsDropTarget target, CmsDNDHandler handler) Executed after the placeholder has been positioned inside a drop target.boolean
onTargetEnter
(I_CmsDraggable draggable, I_CmsDropTarget target, CmsDNDHandler handler) Executed when the helper is dragged into a drop target.void
onTargetLeave
(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, wait
Methods 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_CmsDNDController
Executed when end animation starts.- Specified by:
onAnimationStart
in 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_CmsDNDController
Executed before drop.- Specified by:
onBeforeDrop
in interfaceI_CmsDNDController
- Parameters:
draggable
- the draggable itemtarget
- the current drop targethandler
- the drag and drop handler instance- Returns:
false
to cancel dropping- See Also:
-
onDragCancel
Description copied from interface:I_CmsDNDController
Executed on drag cancel.- Specified by:
onDragCancel
in 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_CmsDNDController
Executed on drag start.- Specified by:
onDragStart
in interfaceI_CmsDNDController
- Parameters:
draggable
- the draggable itemtarget
- the current drop targethandler
- the drag and drop handler instance- Returns:
false
to cancel dragging- See Also:
-
onDrop
Description copied from interface:I_CmsDNDController
Executed on drop.- Specified by:
onDrop
in 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_CmsDNDController
Executed after the placeholder has been positioned inside a drop target.- Specified by:
onPositionedPlaceholder
in 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_CmsDNDController
Executed when the helper is dragged into a drop target.- Specified by:
onTargetEnter
in interfaceI_CmsDNDController
- Parameters:
draggable
- the draggable itemtarget
- the current drop targethandler
- the drag and drop handler instance- Returns:
false
to cancel entering target (placeholder will not positioned inside target)- See Also:
-
onTargetLeave
Description copied from interface:I_CmsDNDController
Executed when the helper is dragged out of a drop target.- Specified by:
onTargetLeave
in 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
-