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.DetailsGeneratoras needed. Details components are attached by this class when theRpcDataProviderExtensionis 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 voiddestroyData(Object itemId)Informs the DataGenerator that an item id has been dropped and is no longer needed.voidgenerateData(Object itemId, Item item, elemental.json.JsonObject rowData)Adds data to row object for given item and item id being sent to client.Grid.DetailsGeneratorgetDetailsGenerator()Gets the current details generator for row details.booleanisDetailsVisible(Object itemId)Checks whether details are visible for the given item.voidrefreshDetails()Recreates all visible details components.voidsetDetailsGenerator(Grid.DetailsGenerator detailsGenerator)Sets a new details generator for row details.voidsetDetailsVisible(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-trueif visible;falseif not
-
generateData
public void generateData(Object itemId, Item item, elemental.json.JsonObject rowData)
Description copied from interface:DataGeneratorAdds data to row object for given item and item id being sent to client.- Specified by:
generateDatain 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:DataGeneratorInforms 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:
destroyDatain 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:
trueiff the details are visible
-
-