Package com.vaadin.ui
Class Grid.DetailComponentManager
- java.lang.Object
-
- com.vaadin.server.AbstractClientConnector
-
- com.vaadin.server.AbstractExtension
-
- com.vaadin.ui.Grid.AbstractGridExtension
-
- com.vaadin.ui.Grid.DetailComponentManager
-
- All Implemented Interfaces:
MethodEventSource
,ClientConnector
,DataGenerator
,Extension
,Connector
,Serializable
- Enclosing class:
- Grid
public static final class Grid.DetailComponentManager extends Grid.AbstractGridExtension implements DataGenerator
A class that manages details components by callingGrid.DetailsGenerator
as needed. Details components are attached by this class when theRpcDataProviderExtension
is sending data to the client. Details components are detached and forgotten when client informs that it has dropped the corresponding item.- Since:
- 7.6.1
- 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
Constructors Constructor Description DetailComponentManager(Grid grid)
DetailComponentManager(Grid grid, Grid.DetailsGenerator detailsGenerator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroyData(Object itemId)
Informs the DataGenerator that an item id has been dropped and is no longer needed.void
generateData(Object itemId, Item item, JsonObject rowData)
Adds data to row object for given item and item id being sent to client.Grid.DetailsGenerator
getDetailsGenerator()
Gets the current details generator for row details.boolean
isDetailsVisible(Object itemId)
Checks whether details are visible for the given item.void
refreshDetails()
Recreates all visible details components.void
setDetailsGenerator(Grid.DetailsGenerator detailsGenerator)
Sets a new details generator for row details.void
setDetailsVisible(Object itemId, boolean visible)
Sets details visiblity status of given item id.-
Methods inherited from class com.vaadin.ui.Grid.AbstractGridExtension
addComponentToGrid, extend, getColumn, getItemId, getParentGrid, refreshRow, remove, removeComponentFromGrid
-
Methods inherited from class com.vaadin.server.AbstractExtension
getParent, getSupportedParentType, setParent
-
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, attach, beforeClientResponse, 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, beforeClientResponse, 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
-
DetailComponentManager
public DetailComponentManager(Grid grid)
-
DetailComponentManager
public DetailComponentManager(Grid grid, Grid.DetailsGenerator detailsGenerator)
-
-
Method Detail
-
refreshDetails
public void refreshDetails()
Recreates all visible details components.
-
setDetailsVisible
public void setDetailsVisible(Object itemId, boolean visible)
Sets details visiblity status of given item id.- Parameters:
itemId
- item id to setvisible
-true
if visible;false
if not
-
generateData
public void generateData(Object itemId, Item item, JsonObject rowData)
Description copied from interface:DataGenerator
Adds data to row object for given item and item id being sent to client.- Specified by:
generateData
in interfaceDataGenerator
- Parameters:
itemId
- item id of itemitem
- item being sent to clientrowData
- row object being sent to client
-
destroyData
public void destroyData(Object itemId)
Description copied from interface:DataGenerator
Informs the DataGenerator that an item id has been dropped and is no longer needed. This method should clean up any unneeded stored data related to the item.- Specified by:
destroyData
in interfaceDataGenerator
- Parameters:
itemId
- removed item id
-
setDetailsGenerator
public void setDetailsGenerator(Grid.DetailsGenerator detailsGenerator) throws IllegalArgumentException
Sets a new details generator for row details.The currently opened row details will be re-rendered.
- Parameters:
detailsGenerator
- the details generator to set- Throws:
IllegalArgumentException
- if detailsGenerator isnull
;
-
getDetailsGenerator
public Grid.DetailsGenerator getDetailsGenerator()
Gets the current details generator for row details.- Returns:
- the detailsGenerator the current details generator
-
isDetailsVisible
public boolean isDetailsVisible(Object itemId)
Checks whether details are visible for the given item.- Parameters:
itemId
- the id of the item for which to check details visibility- Returns:
true
iff the details are visible
-
-