Class DragAndDropWrapper
- java.lang.Object
-
- com.vaadin.server.AbstractClientConnector
-
- com.vaadin.ui.AbstractComponent
-
- com.vaadin.ui.CustomComponent
-
- com.vaadin.ui.DragAndDropWrapper
-
- All Implemented Interfaces:
ConnectorEventListener,ContextClickEvent.ContextClickNotifier,DragSource,DropTarget,MethodEventSource,SerializableEventListener,ClientConnector,Sizeable,VariableOwner,Connector,Component,HasComponents,LegacyComponent,Serializable,Iterable<Component>,EventListener
@Deprecated public class DragAndDropWrapper extends CustomComponent implements DropTarget, DragSource, LegacyComponent
Deprecated.Replaced in 8.1 withDragSourceExtensionandDropTargetExtension.- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDragAndDropWrapper.DragStartModeDeprecated.classDragAndDropWrapper.WrapperTargetDetailsDeprecated.classDragAndDropWrapper.WrapperTransferableDeprecated.Since 8.1, will be replaced by FileDropTargetExtension and FileDropEvent, https://github.com/vaadin/framework/issues/8891-
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
-
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
-
Nested classes/interfaces inherited from interface com.vaadin.ui.HasComponents
HasComponents.ComponentAttachDetachNotifier, HasComponents.ComponentAttachEvent, HasComponents.ComponentAttachListener, HasComponents.ComponentDetachEvent, HasComponents.ComponentDetachListener
-
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable
Sizeable.Unit
-
-
Field Summary
-
Fields inherited from class com.vaadin.ui.AbstractComponent
DESIGN_ATTR_PLAIN_TEXT
-
Fields inherited from interface com.vaadin.server.Sizeable
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
-
-
Constructor Summary
Constructors Constructor Description DragAndDropWrapper()Deprecated.DragAndDropWrapper(Component root)Deprecated.Wraps given component in aDragAndDropWrapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidchangeVariables(Object source, Map<String,Object> variables)Deprecated.Called when one or more variables handled by the implementing class are changed.ComponentgetDragImageComponent()Deprecated.Gets the component that will be used as the drag image.DragAndDropWrapper.DragStartModegetDragStartMode()Deprecated.DropHandlergetDropHandler()Deprecated.protected DragAndDropWrapperStategetState()Deprecated.Returns the shared state bean with information to be sent from the server to the client.protected DragAndDropWrapperStategetState(boolean markAsDirty)Deprecated.Returns the shared state for this connector.TransferablegetTransferable(Map<String,Object> rawVariables)Deprecated.DragSource may convert data added by client side component to meaningful values for server side developer or add other data based on it.voidpaintContent(PaintTarget target)Deprecated.Paints the Paintable into a UIDL stream.voidreadDesign(org.jsoup.nodes.Element design, DesignContext designContext)Deprecated.Reads the component state from the given design.voidsetDragImageComponent(Component dragImageComponent)Deprecated.Sets the component that will be used as the drag image.voidsetDragStartMode(DragAndDropWrapper.DragStartMode dragStartMode)Deprecated.voidsetDropHandler(DropHandler dropHandler)Deprecated.voidsetHTML5DataFlavor(String type, Object value)Deprecated.Sets data flavors available in the DragAndDropWrapper is used to start an HTML5 style drags.TargetDetailstranslateDropTargetDetails(Map<String,Object> clientVariables)Deprecated.Called before theDragAndDropEventis passed toDropHandler.voidwriteDesign(org.jsoup.nodes.Element design, DesignContext designContext)Deprecated.Writes the component state to the given design.-
Methods inherited from class com.vaadin.ui.CustomComponent
getComponentCount, getCompositionRoot, iterator, setCompositionRoot
-
Methods inherited from class com.vaadin.ui.AbstractComponent
addContextClickListener, addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getCustomAttributes, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isReadOnly, isRequiredIndicatorVisible, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeight, setHeightFull, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setReadOnly, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth, setWidthFull, setWidthUndefined
-
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
-
Methods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, addStyleNames, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisible
-
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface com.vaadin.ui.LegacyComponent
markAsDirty
-
Methods inherited from interface com.vaadin.server.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull, setWidthUndefined
-
Methods inherited from interface com.vaadin.server.VariableOwner
isEnabled
-
-
-
-
Constructor Detail
-
DragAndDropWrapper
@Deprecated public DragAndDropWrapper()
Deprecated.This is an internal constructor. UseDragAndDropWrapper(Component)instead.- Since:
- 7.5.0
-
DragAndDropWrapper
public DragAndDropWrapper(Component root)
Deprecated.Wraps given component in aDragAndDropWrapper.- Parameters:
root- the component to be wrapped
-
-
Method Detail
-
setHTML5DataFlavor
public void setHTML5DataFlavor(String type, Object value)
Deprecated.Sets data flavors available in the DragAndDropWrapper is used to start an HTML5 style drags. Most commonly the "Text" flavor should be set. Multiple data types can be set.- Parameters:
type- the string identifier of the drag "payload". E.g. "Text" or "text/html"value- the value
-
changeVariables
public void changeVariables(Object source, Map<String,Object> variables)
Deprecated.Description copied from interface:VariableOwnerCalled when one or more variables handled by the implementing class are changed.- Specified by:
changeVariablesin interfaceVariableOwner- Parameters:
source- the Source of the variable change. This is the origin of the event. For example in Web Adapter this is the request.variables- the Mapping from variable names to new variable values.
-
paintContent
public void paintContent(PaintTarget target) throws PaintException
Deprecated.Description copied from interface:LegacyComponentPaints the Paintable into a UIDL stream. This method creates the UIDL sequence describing it and outputs it to the given UIDL stream.
It is called when the contents of the component should be painted in response to the component first being shown or having been altered so that its visual representation is changed.
- Specified by:
paintContentin interfaceLegacyComponent- Parameters:
target- the target UIDL stream where the component should paint itself to.- Throws:
PaintException- if the paint operation failed.
-
getDropHandler
public DropHandler getDropHandler()
Deprecated.- Specified by:
getDropHandlerin interfaceDropTarget- Returns:
- the drop hanler that will receive the dragged data or null if drops are not currently accepted
-
setDropHandler
public void setDropHandler(DropHandler dropHandler)
Deprecated.
-
translateDropTargetDetails
public TargetDetails translateDropTargetDetails(Map<String,Object> clientVariables)
Deprecated.Description copied from interface:DropTargetCalled before theDragAndDropEventis passed toDropHandler. Implementation may for example translate the drop target details provided by the client side (drop target) to meaningful server side values. If null is returned the terminal implementation will automatically create aTargetDetailswith raw client side data.- Specified by:
translateDropTargetDetailsin interfaceDropTarget- Parameters:
clientVariables- data passed from the DropTargets client side counterpart.- Returns:
- A DropTargetDetails object with the translated data or null to use a default implementation.
- See Also:
DragSource.getTransferable(Map)
-
getTransferable
public Transferable getTransferable(Map<String,Object> rawVariables)
Deprecated.Description copied from interface:DragSourceDragSource may convert data added by client side component to meaningful values for server side developer or add other data based on it.For example Tree converts item identifiers to generated string keys for the client side. Vaadin developer don't and can't know anything about these generated keys, only about item identifiers. When tree node is dragged client puts that key to
Transferables client side counterpart. InTree.getTransferable(Map)the key is converted back to item identifier that the server side developer can use.- Specified by:
getTransferablein interfaceDragSource- Parameters:
rawVariables- the data that client side initially included inTransferables client side counterpart.- Returns:
- the
Transferableinstance that will be passed toDropHandler(and/orAcceptCriterion)
-
setDragStartMode
public void setDragStartMode(DragAndDropWrapper.DragStartMode dragStartMode)
Deprecated.
-
getDragStartMode
public DragAndDropWrapper.DragStartMode getDragStartMode()
Deprecated.
-
setDragImageComponent
public void setDragImageComponent(Component dragImageComponent)
Deprecated.Sets the component that will be used as the drag image. Only used when wrapper is set toDragAndDropWrapper.DragStartMode.COMPONENT_OTHER- Parameters:
dragImageComponent-
-
getDragImageComponent
public Component getDragImageComponent()
Deprecated.Gets the component that will be used as the drag image. Only used when wrapper is set toDragAndDropWrapper.DragStartMode.COMPONENT_OTHER- Returns:
nullif no component is set.
-
readDesign
public void readDesign(org.jsoup.nodes.Element design, DesignContext designContext)Deprecated.Description copied from interface:ComponentReads the component state from the given design.The component is responsible not only for updating its own state but also for ensuring that its children update their state based on the design.
It is assumed that the component is in its default state when this method is called. Reading should only take into consideration attributes specified in the design and not reset any unspecified attributes to their defaults.
This method must not modify the design.
- Specified by:
readDesignin interfaceComponent- Overrides:
readDesignin classAbstractComponent- Parameters:
design- The element to obtain the state fromdesignContext- The DesignContext instance used for parsing the design
-
writeDesign
public void writeDesign(org.jsoup.nodes.Element design, DesignContext designContext)Deprecated.Description copied from interface:ComponentWrites the component state to the given design.The component is responsible not only for writing its own state but also for ensuring that its children write their state to the design.
This method must not modify the component state.
- Specified by:
writeDesignin interfaceComponent- Overrides:
writeDesignin classAbstractComponent- Parameters:
design- The element to write the component state to. Any previous attributes or child nodes are not cleared.designContext- The DesignContext instance used for writing the design
-
getState
protected DragAndDropWrapperState getState()
Deprecated.Description copied from class:AbstractComponentReturns the shared state bean with information to be sent from the server to the client. Subclasses should override this method and set any relevant fields of the state returned by super.getState().- Overrides:
getStatein classCustomComponent- Returns:
- updated component shared state
-
getState
protected DragAndDropWrapperState getState(boolean markAsDirty)
Deprecated.Description copied from class:AbstractClientConnectorReturns the shared state for this connector.- Overrides:
getStatein classCustomComponent- Parameters:
markAsDirty- true if the connector should automatically be marked dirty, false otherwise- Returns:
- The shared state for this connector. Never null.
- See Also:
AbstractClientConnector.getState()
-
-