Class CmsContainerpageDNDController
java.lang.Object
org.opencms.ade.containerpage.client.CmsContainerpageDNDController
- All Implemented Interfaces:
I_CmsDNDController
The container-page editor drag and drop controller.
- Since:
- 8.0.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The container highlighting offset.protected CmsContainerpageController
The container page controller.protected String
The id of the dragged element.static final String
CSS class.static final String
CSS class.static final String
CSS class.static final String
CSS class.static final String
CSS class.static final String
CSS class.static final String
CSS class.static final String
CSS class.static final String
CSS class.static final String
CSS class.static final int
The bigger size for the placement buttons.static final int
The smaller size for the placement buttons. -
Constructor Summary
ConstructorDescriptionConstructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.static final String
Placement button big.static final String
Placement button small.void
postClear
(I_CmsDraggable draggable, I_CmsDropTarget target) Called after the CSS styles are changed back to normal after a DnD operation.protected void
prepareHelperElements
(org.opencms.ade.containerpage.shared.CmsContainerElementData elementData, CmsDNDHandler handler, I_CmsDraggable draggable) Prepares all helper elements for the different drop targets.static boolean
segmentBefore
(int start, int size, int pos) Checks if a 1D line segment comes before a position.static boolean
segmentIntersect
(int start1, int size1, int start2, int size2) Checks if two 1D line segments with given start positions and sizes intersect.boolean
startPlacementMode
(I_CmsDraggable draggable, CmsDNDHandler handler) Starts placement mode for the given draggable.
-
Field Details
-
HIGHLIGHTING_OFFSET
The container highlighting offset.- See Also:
-
OC_PLACEMENT_BUTTON
CSS class.- See Also:
-
OC_PLACEMENT_BUTTONS_VERTICAL
CSS class.- See Also:
-
OC_PLACEMENT_DOWN
CSS class.- See Also:
-
OC_PLACEMENT_LAYER
CSS class.- See Also:
-
OC_PLACEMENT_LEFT
CSS class.- See Also:
-
OC_PLACEMENT_MODE
CSS class.- See Also:
-
OC_PLACEMENT_PLACEHOLDER
CSS class.- See Also:
-
OC_PLACEMENT_RIGHT
CSS class.- See Also:
-
OC_PLACEMENT_SELECTED_ELEMENT
CSS class.- See Also:
-
OC_PLACEMENT_UP
CSS class.- See Also:
-
PLACEMENT_BUTTON_BIG
The bigger size for the placement buttons.- See Also:
-
PLACEMENT_BUTTON_SMALL
The smaller size for the placement buttons.- See Also:
-
m_controller
The container page controller. -
m_draggableId
The id of the dragged element.
-
-
Constructor Details
-
CmsContainerpageDNDController
Constructor.- Parameters:
controller
- the container page controller
-
-
Method Details
-
placementButtonBig
Placement button big.- Returns:
- the string
-
placementButtonSmall
Placement button small.- Returns:
- the string
-
segmentBefore
Checks if a 1D line segment comes before a position.- Parameters:
start
- the start position of the segmentsize
- the width of the segmentpos
- the position to check- Returns:
- true, if successful
-
segmentIntersect
Checks if two 1D line segments with given start positions and sizes intersect.- Parameters:
start1
- start position of the first segmentsize1
- size of the first segmentstart2
- start position of the second segmentsize2
- size of the second segment- Returns:
- true, if successful
-
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:
-
postClear
Description copied from interface:I_CmsDNDController
Called after the CSS styles are changed back to normal after a DnD operation.- Specified by:
postClear
in interfaceI_CmsDNDController
- Parameters:
draggable
- the draggabletarget
- the drag target (null if drag cancelled)- See Also:
-
startPlacementMode
Starts placement mode for the given draggable.- Specified by:
startPlacementMode
in interfaceI_CmsDNDController
- Parameters:
draggable
- the draggable elementhandler
- the handler- Returns:
- true, if successful
-