T - Type of the component to be extended.public class FileDropTarget<T extends AbstractComponent> extends DropTargetExtension<T>
Dropped files are handled in the FileDropHandler given in the
constructor. The file details are first sent to the handler, which can then
decide which files to upload to server by setting a StreamVariable
with Html5File.setStreamVariable(StreamVariable).
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener| Constructor and Description |
|---|
FileDropTarget(T target,
FileDropHandler<T> fileDropHandler)
Extends
target component and makes it a file drop target. |
| Modifier and Type | Method and Description |
|---|---|
T |
getParent()
Returns the component this extension is attached to.
|
protected FileDropTargetState |
getState()
Returns the shared state for this connector.
|
protected FileDropTargetState |
getState(boolean markAsDirty)
Returns the shared state for this connector.
|
protected void |
onDrop(Map<String,FileParameters> fileParams)
Invoked when a file or files have been dropped on client side.
|
addDropListener, attach, getDropCriteriaScript, getDropEffect, onDrop, registerDropTargetRpc, setDropCriteria, setDropCriteriaScript, setDropCriterion, setDropCriterion, setDropCriterion, setDropEffectextend, getSupportedParentType, remove, setParentaddAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, beforeClientResponse, createState, detach, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isConnectorEnabled, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstateclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitaddAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, getUI, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandlergetConnectorIdpublic FileDropTarget(T target, FileDropHandler<T> fileDropHandler)
target component and makes it a file drop target. A file
drop handler needs to be added to handle the file drop event.target - Component to be extended.fileDropHandler - File drop handler that handles the file drop event.FileDropEventprotected void onDrop(Map<String,FileParameters> fileParams)
FileDropEvent.fileParams - map from file ids to actual file detailsprotected FileDropTargetState getState()
AbstractClientConnector
As a side effect, marks the connector dirty so any changes done to the
state will be sent to the client. Use getState(false) to avoid
marking the connector as dirty.
getState in class DropTargetExtension<T extends AbstractComponent>protected FileDropTargetState getState(boolean markAsDirty)
AbstractClientConnectorgetState in class DropTargetExtension<T extends AbstractComponent>markAsDirty - true if the connector should automatically be marked dirty,
false otherwiseAbstractClientConnector.getState()public T getParent()
getParent in interface ClientConnectorgetParent in interface ConnectorgetParent in class DropTargetExtension<T extends AbstractComponent>Copyright © 2019 Vaadin Ltd. All rights reserved.