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
FieldsModifier and TypeFieldDescriptionstatic final intThe container highlighting offset.protected CmsContainerpageControllerThe container page controller.protected StringThe id of the dragged element.static final StringCSS class.static final StringCSS class.static final StringCSS class.static final StringCSS class.static final StringCSS class.static final StringCSS class.static final StringCSS class.static final StringCSS class.static final StringCSS class.static final StringCSS class.static final intThe bigger size for the placement buttons.static final intThe smaller size for the placement buttons. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidonAnimationStart(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.static final StringPlacement button big.static final StringPlacement button small.voidpostClear(I_CmsDraggable draggable, I_CmsDropTarget target) Called after the CSS styles are changed back to normal after a DnD operation.protected voidprepareHelperElements(org.opencms.ade.containerpage.shared.CmsContainerElementData elementData, CmsDNDHandler handler, I_CmsDraggable draggable) Prepares all helper elements for the different drop targets.static booleansegmentBefore(int start, int size, int pos) Checks if a 1D line segment comes before a position.static booleansegmentIntersect(int start1, int size1, int start2, int size2) Checks if two 1D line segments with given start positions and sizes intersect.booleanstartPlacementMode(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_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:
-
postClear
Description copied from interface:I_CmsDNDControllerCalled after the CSS styles are changed back to normal after a DnD operation.- Specified by:
postClearin 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:
startPlacementModein interfaceI_CmsDNDController- Parameters:
draggable- the draggable elementhandler- the handler- Returns:
- true, if successful
-