com.vaadin.server.communication.data
Class RpcDataProviderExtension

java.lang.Object
  extended by com.vaadin.server.AbstractClientConnector
      extended by com.vaadin.server.AbstractExtension
          extended by com.vaadin.server.communication.data.RpcDataProviderExtension
All Implemented Interfaces:
MethodEventSource, ClientConnector, Extension, com.vaadin.shared.Connector, java.io.Serializable

public class RpcDataProviderExtension
extends AbstractExtension

Provides Vaadin server-side container data source to a com.vaadin.client.ui.grid.GridConnector. This is currently implemented as an Extension hardcoded to support a specific connector type. This will be changed once framework support for something more flexible has been implemented.

Since:
7.4
Author:
Vaadin Ltd
See Also:
Serialized Form

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
RpcDataProviderExtension(Container.Indexed container)
          Creates a new data provider using the given container.
 
Method Summary
 void addDataGenerator(DataGenerator generator)
          Adds a DataGenerator for this RpcDataProviderExtension.
 void beforeClientResponse(boolean initial)
          Called before the shared state and RPC invocations are sent to the client.
 void columnsAdded(java.util.List<Grid.Column> addedColumns)
          Informs this data provider that given columns have been added to grid.
 void columnsRemoved(java.util.List<Grid.Column> removedColumns)
          Informs this data provider that given columns have been removed from grid.
 void extend(Grid component)
          Makes the data source available to the given Grid component.
protected  Grid getGrid()
           
 KeyMapper<java.lang.Object> getKeyMapper()
           
 void refreshCache()
          Pushes a new version of all the rows in the active cache range.
 void removeDataGenerator(DataGenerator generator)
          Removes a DataGenerator from this RpcDataProviderExtension.
 void setParent(ClientConnector parent)
          Sets the parent connector of the connector.
 void updateRowData(java.lang.Object itemId)
          Informs the client side that data of a row has been modified in the data source.
 
Methods inherited from class com.vaadin.server.AbstractExtension
extend, getParent, getSupportedParentType, remove
 
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, attach, createState, detach, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getState, getState, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isConnectorEnabled, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, attach, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, getUI, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
 
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
 

Constructor Detail

RpcDataProviderExtension

public RpcDataProviderExtension(Container.Indexed container)
Creates a new data provider using the given container.

Parameters:
container - the container to make available
Method Detail

beforeClientResponse

public void beforeClientResponse(boolean initial)
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.

RpcDataProviderExtension makes all actual RPC calls from this function based on changes in the container.

Specified by:
beforeClientResponse in interface ClientConnector
Overrides:
beforeClientResponse in class AbstractClientConnector
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.

extend

public void extend(Grid component)
Makes the data source available to the given Grid component.

Parameters:
component - the remote data grid component to extend
columnKeys - the key mapper for columns

addDataGenerator

public void addDataGenerator(DataGenerator generator)
Adds a DataGenerator for this RpcDataProviderExtension. DataGenerators are called when sending row data to client. If given DataGenerator is already added, this method does nothing.

Parameters:
generator - generator to add
Since:
7.6

removeDataGenerator

public void removeDataGenerator(DataGenerator generator)
Removes a DataGenerator from this RpcDataProviderExtension. If given DataGenerator is not added to this data provider, this method does nothing.

Parameters:
generator - generator to remove
Since:
7.6

updateRowData

public void updateRowData(java.lang.Object itemId)
Informs the client side that data of a row has been modified in the data source.

Parameters:
itemId - the item Id the row that was updated

refreshCache

public void refreshCache()
Pushes a new version of all the rows in the active cache range.


setParent

public void setParent(ClientConnector parent)
Description copied from interface: Extension
Sets the parent connector of the connector. This method automatically calls ClientConnector.attach() if the connector becomes attached to the session.

This method is rarely called directly. AbstractClientConnector.addExtension(Extension) is normally used for adding extensions to a parent and it will call this method implicitly.

Specified by:
setParent in interface Extension
Overrides:
setParent in class AbstractExtension
Parameters:
parent - the parent connector

columnsRemoved

public void columnsRemoved(java.util.List<Grid.Column> removedColumns)
Informs this data provider that given columns have been removed from grid.

Parameters:
removedColumns - a list of removed columns

columnsAdded

public void columnsAdded(java.util.List<Grid.Column> addedColumns)
Informs this data provider that given columns have been added to grid.

Parameters:
addedColumns - a list of added columns

getKeyMapper

public KeyMapper<java.lang.Object> getKeyMapper()

getGrid

protected Grid getGrid()


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