Class DndUtil
java.lang.Object
com.vaadin.flow.component.dnd.internal.DndUtil
Internal class for drag and drop related utility methods. This class is not
meant for external usage and can be removed at any point.
- Since:
- 2.0
- Author:
- Vaadin Ltd
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringResource path for importing dnd connector.static final StringKey for storing server side drag data for aDragSource.static final StringKey for storing server side drag image for aDragSource.static final StringProperty name for storing theDropEffecton element level.static final StringProperty name for storing drop target activity data for an element.static final StringProperty name for storing theEffectAllowedon element level.static final StringKey for storing an internal drag end listener registration for aDragSource.static final StringKey for storing an internal drag start listener registration for aDragSource. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidReports DnD feature usage from mixin interfaces.static <T extends com.vaadin.flow.component.Component>
voidupdateDragSourceActivation(DragSource<T> dragSource) Triggers drag source activation method in JS connector once when the component has been attached.static <T extends com.vaadin.flow.component.Component>
voidupdateDropTargetActivation(DropTarget<T> dropTarget) Triggers drop target activation method in JS connector once when the component has been attached.
-
Field Details
-
DND_CONNECTOR
Resource path for importing dnd connector.- See Also:
-
EFFECT_ALLOWED_ELEMENT_PROPERTY
Property name for storing theEffectAllowedon element level.- See Also:
-
DRAG_SOURCE_DATA_KEY
Key for storing server side drag data for aDragSource.- See Also:
-
DRAG_SOURCE_IMAGE
Key for storing server side drag image for aDragSource.- See Also:
-
START_LISTENER_REGISTRATION_KEY
Key for storing an internal drag start listener registration for aDragSource.- See Also:
-
END_LISTENER_REGISTRATION_KEY
Key for storing an internal drag end listener registration for aDragSource.- See Also:
-
DROP_TARGET_ACTIVE_PROPERTY
Property name for storing drop target activity data for an element.- See Also:
-
DROP_EFFECT_ELEMENT_PROPERTY
Property name for storing theDropEffecton element level.- See Also:
-
-
Method Details
-
updateDragSourceActivation
public static <T extends com.vaadin.flow.component.Component> void updateDragSourceActivation(DragSource<T> dragSource) Triggers drag source activation method in JS connector once when the component has been attached.- Type Parameters:
T- the type of the drag source component- Parameters:
dragSource- the drag source to update active status on
-
updateDropTargetActivation
public static <T extends com.vaadin.flow.component.Component> void updateDropTargetActivation(DropTarget<T> dropTarget) Triggers drop target activation method in JS connector once when the component has been attached. Will make sure the activation in JS is done again when the component is detached and attached again, because otherwise the element will not be a drop target again.- Type Parameters:
T- the type of the drop target component- Parameters:
dropTarget- the drop target to update active status on
-
reportUsage
public static void reportUsage()Reports DnD feature usage from mixin interfaces.
-