Package org.opencms.gwt.client.dnd
Interface I_CmsDropTarget
-
- All Known Subinterfaces:
I_CmsDropContainer
,I_CmsNestedDropTarget
- All Known Implementing Classes:
CmsContainerPageContainer
,CmsGroupContainerElementPanel
,CmsLazyTree
,CmsList
,CmsTree
,CmsValuePanel
public interface I_CmsDropTarget
Interface defining all methods needed for a drag and drop target. These will mostly be called by the drag and drop handler.- Since:
- 8.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
checkPosition(int x, int y, CmsDNDHandler.Orientation orientation)
Returns true if the given cursor position is over the drop target.com.google.gwt.dom.client.Element
getElement()
Returns the drop target element.int
getPlaceholderIndex()
Returns the index of the placeholder or -1 if no placeholder is attached.void
insertPlaceholder(com.google.gwt.dom.client.Element placeholder, int x, int y, CmsDNDHandler.Orientation orientation)
Inserts a new placeholder.void
onDrop(I_CmsDraggable draggable)
Executed on drop.void
removePlaceholder()
Removes the placeholder.void
repositionPlaceholder(int x, int y, CmsDNDHandler.Orientation orientation)
Repositions the placeholder.
-
-
-
Method Detail
-
checkPosition
boolean checkPosition(int x, int y, CmsDNDHandler.Orientation orientation)
Returns true if the given cursor position is over the drop target.- Parameters:
x
- the cursor client x positiony
- the cursor client y positionorientation
- the drag and drop orientation- Returns:
true
if the given cursor position is over the drop target
-
getElement
com.google.gwt.dom.client.Element getElement()
Returns the drop target element.This must be the element, where all children will be attached.
- Returns:
- the element
-
getPlaceholderIndex
int getPlaceholderIndex()
Returns the index of the placeholder or -1 if no placeholder is attached.- Returns:
- the index
-
insertPlaceholder
void insertPlaceholder(com.google.gwt.dom.client.Element placeholder, int x, int y, CmsDNDHandler.Orientation orientation)
Inserts a new placeholder.- Parameters:
placeholder
- the placeholder elementx
- the cursor client x positiony
- the cursor client y positionorientation
- the drag and drop orientation
-
onDrop
void onDrop(I_CmsDraggable draggable)
Executed on drop.- Parameters:
draggable
- the draggable being dropped
-
removePlaceholder
void removePlaceholder()
Removes the placeholder.
-
repositionPlaceholder
void repositionPlaceholder(int x, int y, CmsDNDHandler.Orientation orientation)
Repositions the placeholder.- Parameters:
x
- the cursor client x positiony
- the cursor client y positionorientation
- the drag and drop orientation
-
-