DragSourceExtension
and
DropTargetExtension
.@Deprecated public class DragAndDropWrapper extends CustomComponent implements DropTarget, DragSource, LegacyComponent
Modifier and Type | Class and Description |
---|---|
static class |
DragAndDropWrapper.DragStartMode
Deprecated.
|
class |
DragAndDropWrapper.WrapperTargetDetails
Deprecated.
|
class |
DragAndDropWrapper.WrapperTransferable
Deprecated.
Since 8.1, will be replaced by FileDropTargetExtension and
FileDropEvent,
https://github.com/vaadin/framework/issues/8891
|
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
Sizeable.Unit
HasComponents.ComponentAttachDetachNotifier, HasComponents.ComponentAttachEvent, HasComponents.ComponentAttachListener, HasComponents.ComponentDetachEvent, HasComponents.ComponentDetachListener
DESIGN_ATTR_PLAIN_TEXT
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
Constructor and Description |
---|
DragAndDropWrapper()
Deprecated.
|
DragAndDropWrapper(Component root)
Deprecated.
Wraps given component in a
DragAndDropWrapper . |
Modifier and Type | Method and Description |
---|---|
void |
changeVariables(Object source,
Map<String,Object> variables)
Deprecated.
Called when one or more variables handled by the implementing class are
changed.
|
Component |
getDragImageComponent()
Deprecated.
Gets the component that will be used as the drag image.
|
DragAndDropWrapper.DragStartMode |
getDragStartMode()
Deprecated.
|
DropHandler |
getDropHandler()
Deprecated.
|
protected DragAndDropWrapperState |
getState()
Deprecated.
Returns the shared state bean with information to be sent from the server
to the client.
|
protected DragAndDropWrapperState |
getState(boolean markAsDirty)
Deprecated.
Returns the shared state for this connector.
|
Transferable |
getTransferable(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.
|
void |
paintContent(PaintTarget target)
Deprecated.
Paints the Paintable into a UIDL stream.
|
void |
readDesign(org.jsoup.nodes.Element design,
DesignContext designContext)
Deprecated.
Reads the component state from the given design.
|
void |
setDragImageComponent(Component dragImageComponent)
Deprecated.
Sets the component that will be used as the drag image.
|
void |
setDragStartMode(DragAndDropWrapper.DragStartMode dragStartMode)
Deprecated.
|
void |
setDropHandler(DropHandler dropHandler)
Deprecated.
|
void |
setHTML5DataFlavor(String type,
Object value)
Deprecated.
Sets data flavors available in the DragAndDropWrapper is used to start an
HTML5 style drags.
|
TargetDetails |
translateDropTargetDetails(Map<String,Object> clientVariables)
Deprecated.
Called before the
DragAndDropEvent is passed to
DropHandler . |
void |
writeDesign(org.jsoup.nodes.Element design,
DesignContext designContext)
Deprecated.
Writes the component state to the given design.
|
getComponentCount, getCompositionRoot, iterator, setCompositionRoot
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, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setReadOnly, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth, setWidthUndefined
addAttachListener, addDetachListener, addExtension, 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, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
markAsDirty
isEnabled
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
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
getConnectorId
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefined
forEach, spliterator
@Deprecated public DragAndDropWrapper()
DragAndDropWrapper(Component)
instead.public DragAndDropWrapper(Component root)
DragAndDropWrapper
.root
- the component to be wrappedpublic void setHTML5DataFlavor(String type, Object value)
type
- the string identifier of the drag "payload". E.g. "Text" or
"text/html"value
- the valuepublic void changeVariables(Object source, Map<String,Object> variables)
VariableOwner
changeVariables
in interface VariableOwner
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.public void paintContent(PaintTarget target) throws PaintException
LegacyComponent
Paints 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.
paintContent
in interface LegacyComponent
target
- the target UIDL stream where the component should paint itself
to.PaintException
- if the paint operation failed.public DropHandler getDropHandler()
getDropHandler
in interface DropTarget
public void setDropHandler(DropHandler dropHandler)
public TargetDetails translateDropTargetDetails(Map<String,Object> clientVariables)
DropTarget
DragAndDropEvent
is passed to
DropHandler
. 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 a TargetDetails
with raw client side data.translateDropTargetDetails
in interface DropTarget
clientVariables
- data passed from the DropTargets client side counterpart.DragSource.getTransferable(Map)
public Transferable getTransferable(Map<String,Object> rawVariables)
DragSource
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 Transferable
s client side
counterpart. In Tree.getTransferable(Map)
the key is converted
back to item identifier that the server side developer can use.
getTransferable
in interface DragSource
rawVariables
- the data that client side initially included in
Transferable
s client side counterpart.Transferable
instance that will be passed to
DropHandler
(and/or AcceptCriterion
)public void setDragStartMode(DragAndDropWrapper.DragStartMode dragStartMode)
public DragAndDropWrapper.DragStartMode getDragStartMode()
public void setDragImageComponent(Component dragImageComponent)
DragAndDropWrapper.DragStartMode.COMPONENT_OTHER
dragImageComponent
- public Component getDragImageComponent()
DragAndDropWrapper.DragStartMode.COMPONENT_OTHER
null
if no component is set.public void readDesign(org.jsoup.nodes.Element design, DesignContext designContext)
Component
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.
readDesign
in interface Component
readDesign
in class AbstractComponent
design
- The element to obtain the state fromdesignContext
- The DesignContext instance used for parsing the designpublic void writeDesign(org.jsoup.nodes.Element design, DesignContext designContext)
Component
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.
writeDesign
in interface Component
writeDesign
in class AbstractComponent
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 designprotected DragAndDropWrapperState getState()
AbstractComponent
getState
in class CustomComponent
protected DragAndDropWrapperState getState(boolean markAsDirty)
AbstractClientConnector
getState
in class CustomComponent
markAsDirty
- true if the connector should automatically be marked dirty,
false otherwiseAbstractClientConnector.getState()
Copyright © 2018 Vaadin Ltd. All rights reserved.