com.vaadin.ui
Class Grid.DetailComponentManager

java.lang.Object
  extended by com.vaadin.server.AbstractClientConnector
      extended by com.vaadin.server.AbstractExtension
          extended by com.vaadin.ui.Grid.AbstractGridExtension
              extended by com.vaadin.ui.Grid.DetailComponentManager
All Implemented Interfaces:
MethodEventSource, ClientConnector, DataGenerator, Extension, com.vaadin.shared.Connector, java.io.Serializable
Enclosing class:
Grid

public static final class Grid.DetailComponentManager
extends Grid.AbstractGridExtension
implements DataGenerator

A class that manages details components by calling Grid.DetailsGenerator as needed. Details components are attached by this class when the RpcDataProviderExtension 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
Grid.DetailComponentManager(Grid grid)
           
Grid.DetailComponentManager(Grid grid, Grid.DetailsGenerator detailsGenerator)
           
 
Method Summary
 void destroyData(java.lang.Object itemId)
          Informs the DataGenerator that an item id has been dropped and is no longer needed.
 void generateData(java.lang.Object itemId, Item item, elemental.json.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(java.lang.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(java.lang.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

Grid.DetailComponentManager

public Grid.DetailComponentManager(Grid grid)

Grid.DetailComponentManager

public Grid.DetailComponentManager(Grid grid,
                                   Grid.DetailsGenerator detailsGenerator)
Method Detail

refreshDetails

public void refreshDetails()
Recreates all visible details components.


setDetailsVisible

public void setDetailsVisible(java.lang.Object itemId,
                              boolean visible)
Sets details visiblity status of given item id.

Parameters:
itemId - item id to set
visible - true if visible; false if not

generateData

public void generateData(java.lang.Object itemId,
                         Item item,
                         elemental.json.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 interface DataGenerator
Parameters:
itemId - item id of item
item - item being sent to client
rowData - row object being sent to client

destroyData

public void destroyData(java.lang.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 interface DataGenerator
Parameters:
itemId - removed item id

setDetailsGenerator

public void setDetailsGenerator(Grid.DetailsGenerator detailsGenerator)
                         throws java.lang.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:
java.lang.IllegalArgumentException - if detailsGenerator is null;

getDetailsGenerator

public Grid.DetailsGenerator getDetailsGenerator()
Gets the current details generator for row details.

Returns:
the detailsGenerator the current details generator

isDetailsVisible

public boolean isDetailsVisible(java.lang.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


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