info.joseluismartin.vaadin.data
Class PkItemIdStrategy

java.lang.Object
  extended by info.joseluismartin.vaadin.data.PkItemIdStrategy
All Implemented Interfaces:
com.vaadin.data.Container.ItemSetChangeListener, ItemIdStrategy, Serializable

public class PkItemIdStrategy
extends Object
implements ItemIdStrategy

Use Primary Keys as ItemId.

Author:
Jose Luis Martin - (jlm@joseluismartin.info)
See Also:
Serialized Form

Constructor Summary
PkItemIdStrategy()
           
 
Method Summary
 void containerItemSetChange(com.vaadin.data.Container.ItemSetChangeEvent event)
          
 Object firstItemId()
          
 Object getIdByIndex(int index)
          Get an id by index
 Collection<?> getItemIds()
          Gets a collection of all itemIds
 Serializable getKey(com.vaadin.data.Item item)
           
 int indexOfId(Object itemId)
          Gets the index of an itemId
 void itemLoaded(int index, com.vaadin.data.Item item)
          
 Object lastItemId()
          
 void setContainerDataSource(ContainerDataSource<?> containerDataSource)
          Set the containerDataSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PkItemIdStrategy

public PkItemIdStrategy()
Method Detail

firstItemId

public Object firstItemId()

Specified by:
firstItemId in interface ItemIdStrategy
Returns:
the first itemId

getIdByIndex

public Object getIdByIndex(int index)
Get an id by index

Specified by:
getIdByIndex in interface ItemIdStrategy
Parameters:
index - the index
Returns:
Id

getItemIds

public Collection<?> getItemIds()
Gets a collection of all itemIds

Specified by:
getItemIds in interface ItemIdStrategy
Returns:
collection with all itemIds

indexOfId

public int indexOfId(Object itemId)
Gets the index of an itemId

Specified by:
indexOfId in interface ItemIdStrategy
Parameters:
itemId - the itemId

lastItemId

public Object lastItemId()

Specified by:
lastItemId in interface ItemIdStrategy
Returns:
the las itemId

setContainerDataSource

public void setContainerDataSource(ContainerDataSource<?> containerDataSource)
Set the containerDataSource

Specified by:
setContainerDataSource in interface ItemIdStrategy

getKey

public Serializable getKey(com.vaadin.data.Item item)

itemLoaded

public void itemLoaded(int index,
                       com.vaadin.data.Item item)

Specified by:
itemLoaded in interface ItemIdStrategy

containerItemSetChange

public void containerItemSetChange(com.vaadin.data.Container.ItemSetChangeEvent event)

Specified by:
containerItemSetChange in interface com.vaadin.data.Container.ItemSetChangeListener


Copyright © 2012 JDAL. All Rights Reserved.