com.vaadin.server.
Class DragAndDropService
- java.lang.Object
-
- com.vaadin.server.DragAndDropService
-
All Implemented Interfaces:
@Deprecated public class DragAndDropService extends Object implements VariableOwner, ClientConnector
Deprecated.Since 8.1, no direct replacement, seeDragSourceExtension
andDropTargetExtension
.Author:
Vaadin Ltd
See Also:
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
-
-
Constructor Summary
Constructors Constructor Description DragAndDropService(VaadinSession session)
Deprecated.
-
Method Summary
All Methods Modifier and Type Method Description Registration
addAttachListener(ClientConnector.AttachListener listener)
Deprecated.
Add a listener for connector attach events.
Registration
addDetachListener(ClientConnector.DetachListener listener)
Deprecated.
Add a listener for connector detach events.
void
attach()
Deprecated.
Notifies the connector that it is connected to a VaadinSession (and therefore also to a UI).
void
beforeClientResponse(boolean initial)
Deprecated.
Called before the shared state and RPC invocations are sent to the client.
void
changeVariables(Object source, Map<String,Object> variables)
Deprecated.
Called when one or more variables handled by the implementing class are changed.
void
detach()
Deprecated.
Notifies the connector that it is detached from its VaadinSession.
elemental.json.JsonObject
encodeState()
Deprecated.
Called by the framework to encode the state to a JSONObject.
String
getConnectorId()
Deprecated.
Returns the id for this connector.
ErrorHandler
getErrorHandler()
Deprecated.
Gets the error handler for the connector.
Collection<Extension>
getExtensions()
Deprecated.
Get a read-only collection of all extensions attached to this connector.
ClientConnector
getParent()
Deprecated.
Gets the parent connector of this connector, or
null
if the connector is not attached to any parent.ServerRpcManager<?>
getRpcManager(String interfaceName)
Deprecated.
Returns the RPC manager instance to use when receiving calls for an RPC interface.
Class<? extends SharedState>
getStateType()
Deprecated.
Returns the type of the shared state for this connector.
UI
getUI()
Deprecated.
Returns the UI this connector is attached to.
boolean
handleConnectorRequest(VaadinRequest request, VaadinResponse response, String path)
Deprecated.
Handle a request directed to this connector.
boolean
isAttached()
Deprecated.
Checks if the connector is attached to a VaadinSession.
boolean
isConnectorEnabled()
Deprecated.
Checks if the communicator is enabled.
boolean
isEnabled()
Deprecated.
Tests if the variable owner is enabled or not.
void
markAsDirty()
Deprecated.
Marks that this connector's state might have changed.
void
markAsDirtyRecursive()
Deprecated.
Causes this connector and all connectors below it to be marked as dirty.
void
printJSONResponse(Writer outWriter)
Deprecated.
void
removeAttachListener(ClientConnector.AttachListener listener)
Deprecated.
void
removeDetachListener(ClientConnector.DetachListener listener)
Deprecated.
void
removeExtension(Extension extension)
Deprecated.
Remove an extension from this connector.
void
requestRepaint()
Deprecated.
void
requestRepaintAll()
Deprecated.
List<ClientMethodInvocation>
retrievePendingRpcCalls()
Deprecated.
Returns the list of pending server to client RPC calls and clears the list.
void
setErrorHandler(ErrorHandler errorHandler)
Deprecated.
Sets the error handler for the connector.
-
-
-
Constructor Detail
-
DragAndDropService
public DragAndDropService(VaadinSession session)
Deprecated.
-
-
Method Detail
-
changeVariables
public void changeVariables(Object source, Map<String,Object> variables)
Deprecated.Description copied from interface:
VariableOwner
Called when one or more variables handled by the implementing class are changed.
Specified by:
changeVariables
in 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.
-
isEnabled
public boolean isEnabled()
Deprecated.Tests if the variable owner is enabled or not. The terminal should not send any variable changes to disabled variable owners.
Implementation detail: this method is originally from the VariableOwner class, which has been removed in Vaadin 8.Specified by:
isEnabled
in interfaceVariableOwner
Returns:
true
if the variable owner is enabled,false
if not
-
printJSONResponse
public void printJSONResponse(Writer outWriter) throws IOException
Deprecated.Throws:
-
getConnectorId
public String getConnectorId()
Deprecated.Description copied from interface:
Connector
Returns the id for this connector. This is set by the framework and does not change during the lifetime of a connector.
Specified by:
getConnectorId
in interfaceConnector
Returns:
The id for the connector.
-
isConnectorEnabled
public boolean isConnectorEnabled()
Deprecated.Description copied from interface:
ClientConnector
Checks if the communicator is enabled. An enabled communicator is allowed to receive messages from its counter-part.
Specified by:
isConnectorEnabled
in interfaceClientConnector
Returns:
true if the connector can receive messages, false otherwise
-
retrievePendingRpcCalls
public List<ClientMethodInvocation> retrievePendingRpcCalls()
Deprecated.Description copied from interface:
ClientConnector
Returns the list of pending server to client RPC calls and clears the list.
Specified by:
retrievePendingRpcCalls
in interfaceClientConnector
Returns:
an unmodifiable ordered list of pending server to client method calls (not null)
-
getRpcManager
public ServerRpcManager<?> getRpcManager(String interfaceName)
Deprecated.Description copied from interface:
ClientConnector
Returns the RPC manager instance to use when receiving calls for an RPC interface.
Specified by:
getRpcManager
in interfaceClientConnector
Parameters:
interfaceName
- name of the interface for which the call was madeReturns:
ServerRpcManager or null if none found for the interface
-
getStateType
public Class<? extends SharedState> getStateType()
Deprecated.Description copied from interface:
ClientConnector
Returns the type of the shared state for this connector.
Specified by:
getStateType
in interfaceClientConnector
Returns:
The type of the state. Must never return null.
-
requestRepaint
@Deprecated public void requestRepaint()
Deprecated.Specified by:
requestRepaint
in interfaceClientConnector
-
markAsDirty
public void markAsDirty()
Deprecated.Description copied from interface:
ClientConnector
Marks that this connector's state might have changed. When the framework is about to send new data to the client-side, it will run
ClientConnector.beforeClientResponse(boolean)
followed byClientConnector.encodeState()
for all connectors that are marked as dirty and send any updated state info to the client.Specified by:
markAsDirty
in interfaceClientConnector
-
getParent
public ClientConnector getParent()
Deprecated.Description copied from interface:
Connector
Gets the parent connector of this connector, or
null
if the connector is not attached to any parent.Specified by:
getParent
in interfaceClientConnector
Specified by:
getParent
in interfaceConnector
Returns:
the parent connector, or
null
if there is no parent.
-
requestRepaintAll
@Deprecated public void requestRepaintAll()
Deprecated.Specified by:
requestRepaintAll
in interfaceClientConnector
-
markAsDirtyRecursive
public void markAsDirtyRecursive()
Deprecated.Description copied from interface:
ClientConnector
Causes this connector and all connectors below it to be marked as dirty.
This should only be used in special cases, e.g when the state of a descendant depends on the state of an ancestor.
Specified by:
markAsDirtyRecursive
in interfaceClientConnector
See Also:
-
attach
public void attach()
Deprecated.Description copied from interface:
ClientConnector
Notifies the connector that it is connected to a VaadinSession (and therefore also to a UI).
The caller of this method is
Component.setParent(HasComponents)
if the parent is itself already attached to the session. If not, the parent will call theClientConnector.attach()
for all its children when it is attached to the session. This method is always called before the connector's data is sent to the client-side for the first time.The attachment logic is implemented in
AbstractClientConnector
.Specified by:
attach
in interfaceClientConnector
-
detach
public void detach()
Deprecated.Description copied from interface:
ClientConnector
Notifies the connector that it is detached from its VaadinSession.
The caller of this method is
Component.setParent(HasComponents)
if the parent is in the session. When the parent is detached from the session it is its responsibility to callClientConnector.detach()
for each of its children.Specified by:
detach
in interfaceClientConnector
-
getExtensions
public Collection<Extension> getExtensions()
Deprecated.Description copied from interface:
ClientConnector
Get a read-only collection of all extensions attached to this connector.
Specified by:
getExtensions
in interfaceClientConnector
Returns:
a collection of extensions
-
removeExtension
public void removeExtension(Extension extension)
Deprecated.Description copied from interface:
ClientConnector
Remove an extension from this connector.
Specified by:
removeExtension
in interfaceClientConnector
Parameters:
extension
- the extension to remove.
-
getUI
public UI getUI()
Deprecated.Description copied from interface:
ClientConnector
Returns the UI this connector is attached to.
Specified by:
getUI
in interfaceClientConnector
Returns:
The UI this connector is attached to or null if it is not attached to any UI
-
beforeClientResponse
public void beforeClientResponse(boolean initial)
Deprecated.Description copied from interface:
ClientConnector
Called before the shared state and RPC invocations are sent to the client. Gives the connector an opportunity to set computed/dynamic state values or to invoke last minute RPC methods depending on other component features.
Specified by:
beforeClientResponse
in interfaceClientConnector
Parameters:
initial
-true
if the client-side connector will be created and initialized after this method has been invoked.false
if there is already an initialized client-side connector.
-
encodeState
public elemental.json.JsonObject encodeState()
Deprecated.Description copied from interface:
ClientConnector
Called by the framework to encode the state to a JSONObject. This is typically done by calling the static method
LegacyCommunicationManager.encodeState(ClientConnector, SharedState)
.Specified by:
encodeState
in interfaceClientConnector
Returns:
a JSON object with the encoded connector state
-
handleConnectorRequest
public boolean handleConnectorRequest(VaadinRequest request, VaadinResponse response, String path) throws IOException
Deprecated.Description copied from interface:
ClientConnector
Handle a request directed to this connector. This can be used by connectors to dynamically generate a response and it is also used internally when serving
ConnectorResource
s.Requests to
/APP/connector/[ui id]/[connector id]/
are routed to this method with the remaining part of the requested path available in the path parameter.NOTE that the session is not locked when this method is called. It is the responsibility of the connector to ensure that the session is locked while handling state or other session related data. For best performance the session should be unlocked before writing a large response to the client.
Specified by:
handleConnectorRequest
in interfaceClientConnector
Parameters:
request
- the request that should be handledresponse
- the response object to which the response should be writtenpath
- the requested relative pathReturns:
true
if the request has been handled,false
if no response has been written.Throws:
IOException
- if there is a problem generating a response.
-
getErrorHandler
public ErrorHandler getErrorHandler()
Deprecated.Description copied from interface:
ClientConnector
Gets the error handler for the connector. The error handler is dispatched whenever there is an error processing the data coming from the client to this connector.
Specified by:
getErrorHandler
in interfaceClientConnector
Returns:
The error handler or null if not set
-
setErrorHandler
public void setErrorHandler(ErrorHandler errorHandler)
Deprecated.Description copied from interface:
ClientConnector
Sets the error handler for the connector. The error handler is dispatched whenever there is an error processing the data coming from the client for this connector.
Specified by:
setErrorHandler
in interfaceClientConnector
Parameters:
errorHandler
- The error handler for this connector
-
addAttachListener
public Registration addAttachListener(ClientConnector.AttachListener listener)
Deprecated.Description copied from interface:
ClientConnector
Add a listener for connector attach events.
Specified by:
addAttachListener
in interfaceClientConnector
Parameters:
listener
- an AttachListener implementationReturns:
Registration for unregistering the listener
-
removeAttachListener
@Deprecated public void removeAttachListener(ClientConnector.AttachListener listener)
Deprecated.Specified by:
removeAttachListener
in interfaceClientConnector
-
addDetachListener
public Registration addDetachListener(ClientConnector.DetachListener listener)
Deprecated.Description copied from interface:
ClientConnector
Add a listener for connector detach events.
Specified by:
addDetachListener
in interfaceClientConnector
Parameters:
listener
- an AttachListener implementationReturns:
Registration for unregistering the listener
-
removeDetachListener
@Deprecated public void removeDetachListener(ClientConnector.DetachListener listener)
Deprecated.Specified by:
removeDetachListener
in interfaceClientConnector
-
isAttached
public boolean isAttached()
Deprecated.Description copied from interface:
ClientConnector
Checks if the connector is attached to a VaadinSession.
Specified by:
isAttached
in interfaceClientConnector
Returns:
true if the connector is attached to a session, false otherwise
-
-