public class RpcDataProviderExtension extends AbstractExtension
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.ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
Constructor and Description |
---|
RpcDataProviderExtension(Container.Indexed container)
Creates a new data provider using the given container.
|
Modifier and Type | Method and Description |
---|---|
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(List<Grid.Column> addedColumns)
Informs this data provider that given columns have been added to grid.
|
void |
columnsRemoved(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<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(Object itemId)
Informs the client side that data of a row has been modified in the data
source.
|
extend, getParent, getSupportedParentType, remove
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
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addAttachListener, addDetachListener, attach, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, getUI, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
getConnectorId
public RpcDataProviderExtension(Container.Indexed container)
container
- the container to make availablepublic void beforeClientResponse(boolean initial)
RpcDataProviderExtension makes all actual RPC calls from this function based on changes in the container.
beforeClientResponse
in interface ClientConnector
beforeClientResponse
in class AbstractClientConnector
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.public void extend(Grid component)
Grid
component.component
- the remote data grid component to extendcolumnKeys
- the key mapper for columnspublic void addDataGenerator(DataGenerator generator)
DataGenerator
for this RpcDataProviderExtension
.
DataGenerators are called when sending row data to client. If given
DataGenerator is already added, this method does nothing.generator
- generator to addpublic void removeDataGenerator(DataGenerator generator)
DataGenerator
from this
RpcDataProviderExtension
. If given DataGenerator is not added to
this data provider, this method does nothing.generator
- generator to removepublic void updateRowData(Object itemId)
itemId
- the item Id the row that was updatedpublic void refreshCache()
public void setParent(ClientConnector parent)
Extension
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.
setParent
in interface Extension
setParent
in class AbstractExtension
parent
- the parent connectorpublic void columnsRemoved(List<Grid.Column> removedColumns)
removedColumns
- a list of removed columnspublic void columnsAdded(List<Grid.Column> addedColumns)
addedColumns
- a list of added columnsprotected Grid getGrid()
Copyright © 2023 Vaadin Ltd. All rights reserved.