com.vaadin.terminal.gwt.server
Class DragAndDropService

java.lang.Object
  extended by com.vaadin.terminal.gwt.server.DragAndDropService
All Implemented Interfaces:
Connector, ClientConnector, RpcTarget, VariableOwner, Serializable

public class DragAndDropService
extends Object
implements VariableOwner, ClientConnector

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.vaadin.terminal.VariableOwner
VariableOwner.ErrorEvent
 
Constructor Summary
DragAndDropService(AbstractCommunicationManager manager)
           
 
Method Summary
 void attach()
          Notifies the connector that it is connected to an application.
 void changeVariables(Object source, Map<String,Object> variables)
          Called when one or more variables handled by the implementing class are changed.
 void detach()
          Notifies the component that it is detached from the application.
 String getConnectorId()
          Returns the id for this connector.
 Collection<Extension> getExtensions()
          Get a read-only collection of all extensions attached to this connector.
 ClientConnector getParent()
          Gets the parent connector of this connector, or null if the connector is not attached to any parent.
 Root getRoot()
          Returns the root this connector is attached to
 RpcManager getRpcManager(Class<?> rpcInterface)
          Returns the RPC manager instance to use when receiving calls for an RPC interface.
 SharedState getState()
          Gets the current shared state of the connector.
 Class<? extends SharedState> getStateType()
          Returns the type of the shared state for this connector
 boolean isConnectorEnabled()
          Checks if the communicator is enabled.
 boolean isEnabled()
           Tests if the variable owner is enabled or not.
 boolean isImmediate()
           Tests if the variable owner is in immediate mode or not.
 void removeExtension(Extension extension)
          Remove an extension from this connector.
 void requestRepaint()
          Requests that the connector should be repainted as soon as possible.
 void requestRepaintAll()
          Causes a repaint of this connector, and all connectors below it.
 List<ClientMethodInvocation> retrievePendingRpcCalls()
          Returns the list of pending server to client RPC calls and clears the list.
 void setParent(ClientConnector parent)
          Sets the parent connector of the connector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DragAndDropService

public DragAndDropService(AbstractCommunicationManager manager)
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.

getState

public SharedState getState()
Description copied from interface: Connector
Gets the current shared state of the connector.

Specified by:
getState in interface Connector
Returns:
state The shared state object. Can be any sub type of SharedState. Never null.

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

retrievePendingRpcCalls

public List<ClientMethodInvocation> retrievePendingRpcCalls()
Description copied from interface: ClientConnector
Returns the list of pending server to client RPC calls and clears the list.

Specified by:
retrievePendingRpcCalls in interface ClientConnector
Returns:
an unmodifiable ordered list of pending server to client method calls (not null)

getRpcManager

public RpcManager getRpcManager(Class<?> rpcInterface)
Description copied from interface: RpcTarget
Returns the RPC manager instance to use when receiving calls for an RPC interface.

Specified by:
getRpcManager in interface RpcTarget
Parameters:
rpcInterface - interface for which the call was made
Returns:
RpcManager or null if none found for the interface

getStateType

public Class<? extends SharedState> getStateType()
Description copied from interface: ClientConnector
Returns the type of the shared state for this connector

Specified by:
getStateType in interface ClientConnector
Returns:
The type of the state. Must never return null.

requestRepaint

public void requestRepaint()
Description copied from interface: ClientConnector
Requests that the connector should be repainted as soon as possible.

Specified by:
requestRepaint in interface ClientConnector

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

requestRepaintAll

public void requestRepaintAll()
Description copied from interface: ClientConnector
Causes a repaint of this connector, and all connectors below it. 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:
requestRepaintAll in interface ClientConnector

setParent

public void setParent(ClientConnector parent)
Description copied from interface: ClientConnector
Sets the parent connector of the connector.

This method automatically calls ClientConnector.attach() if the connector becomes attached to the application, regardless of whether it was attached previously. Conversely, if the parent is null and the connector is attached to the application, ClientConnector.detach() is called for the connector.

This method is rarely called directly. One of the ComponentContainer.addComponent(Component) or AbstractClientConnector.addExtension(Extension) methods are normally used for adding connectors to a parent and they will call this method implicitly.

It is not possible to change the parent without first setting the parent to null.

Specified by:
setParent in interface ClientConnector
Parameters:
parent - the parent connector

attach

public void attach()
Description copied from interface: ClientConnector
Notifies the connector that it is connected to an application.

The caller of this method is ClientConnector.setParent(ClientConnector) if the parent is itself already attached to the application. If not, the parent will call the ClientConnector.attach() for all its children when it is attached to the application. 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 component that it is detached from the application.

The caller of this method is ClientConnector.setParent(ClientConnector) if the parent is in the application. When the parent is detached from the application it is its response to call ClientConnector.detach() for all the children and to detach itself from the terminal.

Specified by:
detach in interface ClientConnector

getExtensions

public Collection<Extension> getExtensions()
Description copied from interface: ClientConnector
Get a read-only collection of all extensions attached to this connector.

Specified by:
getExtensions in interface ClientConnector
Returns:
a collection of extensions

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.

getRoot

public Root getRoot()
Description copied from interface: ClientConnector
Returns the root this connector is attached to

Specified by:
getRoot in interface ClientConnector
Returns:
The Root this connector is attached to or null if it is not attached to any Root


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.