Class DragAndDropService

    • Constructor Detail

      • DragAndDropService

        public DragAndDropService​(VaadinSession session)
    • Method Detail

      • changeVariables

        public void changeVariables​(Object source,
                                    Map<String,​Object> variables)
        Description copied from interface: VariableOwner
        Called when one or more variables handled by the implementing class are changed.
        Specified by:
        changeVariables in interface VariableOwner
        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()
        Description copied from interface: VariableOwner

        Tests if the variable owner is enabled or not. The terminal should not send any variable changes to disabled variable owners.

        Specified by:
        isEnabled in interface VariableOwner
        Returns:
        true if the variable owner is enabled, false if not
      • isImmediate

        public boolean isImmediate()
        Description copied from interface: VariableOwner

        Tests if the variable owner is in immediate mode or not. Being in immediate mode means that all variable changes are required to be sent back from the terminal immediately when they occur.

        Note: VariableOwner does not include a set- method for the immediateness property. This is because not all VariableOwners wish to offer the functionality. Such VariableOwners are never in the immediate mode, thus they always return false in VariableOwner.isImmediate().

        Specified by:
        isImmediate in interface VariableOwner
        Returns:
        true if the component is in immediate mode, false if not.
      • getConnectorId

        public String getConnectorId()
        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 interface Connector
        Returns:
        The id for the connector.
      • isConnectorEnabled

        public boolean isConnectorEnabled()
        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 interface ClientConnector
        Returns:
        true if the connector can receive messages, false otherwise
      • getRpcManager

        public ServerRpcManager<?> getRpcManager​(String interfaceName)
        Description copied from interface: ClientConnector
        Returns the RPC manager instance to use when receiving calls for an RPC interface.
        Specified by:
        getRpcManager in interface ClientConnector
        Parameters:
        interfaceName - name of the interface for which the call was made
        Returns:
        ServerRpcManager or null if none found for the interface
      • getParent

        public ClientConnector getParent()
        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 interface ClientConnector
        Specified by:
        getParent in interface Connector
        Returns:
        the parent connector, or null if there is no parent.
      • markAsDirtyRecursive

        public void markAsDirtyRecursive()
        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 interface ClientConnector
        See Also:
        ClientConnector.markAsDirty()
      • attach

        public void attach()
        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 #setParent(ClientConnector) if the parent is itself already attached to the session. If not, the parent will call the ClientConnector.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 interface ClientConnector
      • detach

        public void detach()
        Description copied from interface: ClientConnector
        Notifies the connector that it is detached from its VaadinSession.

        The caller of this method is #setParent(ClientConnector) if the parent is in the session. When the parent is detached from the session it is its responsibility to call ClientConnector.detach() for each of its children.

        Specified by:
        detach in interface ClientConnector
      • removeExtension

        public void removeExtension​(Extension extension)
        Description copied from interface: ClientConnector
        Remove an extension from this connector.
        Specified by:
        removeExtension in interface ClientConnector
        Parameters:
        extension - the extension to remove.
      • getUI

        public UI getUI()
        Description copied from interface: ClientConnector
        Returns the UI this connector is attached to
        Specified by:
        getUI in interface ClientConnector
        Returns:
        The UI this connector is attached to or null if it is not attached to any UI
      • beforeClientResponse

        public void beforeClientResponse​(boolean initial)
        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 interface ClientConnector
        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.
      • handleConnectorRequest

        public boolean handleConnectorRequest​(VaadinRequest request,
                                              VaadinResponse response,
                                              String path)
                                       throws IOException
        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 ConnectorResources.

        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 interface ClientConnector
        Parameters:
        request - the request that should be handled
        response - the response object to which the response should be written
        path - the requested relative path
        Returns:
        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()
        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 interface ClientConnector
        Returns:
        The error handler or null if not set
      • setErrorHandler

        public void setErrorHandler​(ErrorHandler errorHandler)
        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 interface ClientConnector
        Parameters:
        errorHandler - The error handler for this connector
      • isAttached

        public boolean isAttached()
        Description copied from interface: ClientConnector
        Checks if the connector is attached to a VaadinSession.
        Specified by:
        isAttached in interface ClientConnector
        Returns:
        true if the connector is attached to a session, false otherwise