Class AbstractUiListUnmodifiable<O extends io.vertigo.datamodel.structure.model.DtObject>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<UiObject<O>>
io.vertigo.ui.core.AbstractUiListUnmodifiable<O>
Type Parameters:
O - the type of entity
All Implemented Interfaces:
UiList<O>, Serializable, Iterable<UiObject<O>>, Collection<UiObject<O>>, List<UiObject<O>>
Direct Known Subclasses:
ClusterUiList, UiListUnmodifiable

public abstract class AbstractUiListUnmodifiable<O extends io.vertigo.datamodel.structure.model.DtObject> extends AbstractList<UiObject<O>> implements UiList<O>, Serializable
Wrapper d'affichage des listes d'objets métier.
Author:
npiedeloup
See Also:
  • Field Details

    • NB_MAX_ELEMENTS

      protected static final int NB_MAX_ELEMENTS
      See Also:
    • entityStoreManager

      protected final ComponentRef<io.vertigo.datastore.entitystore.EntityStoreManager> entityStoreManager
      Accès au storeManager.
    • transactionManager

      protected final ComponentRef<io.vertigo.commons.transaction.VTransactionManager> transactionManager
      Accès au transactionManager.
  • Method Details

    • getObjectType

      public Class<O> getObjectType()
      Specified by:
      getObjectType in interface UiList<O extends io.vertigo.datamodel.structure.model.DtObject>
    • getIdFieldName

      public String getIdFieldName()
    • initUiObjectByIdIndex

      protected final void initUiObjectByIdIndex()
      Initialize l'index des UiObjects par Id. Attention : nécessite la DtList (appel obtainDtList).
    • initUiObjectByKeyIndex

      protected final void initUiObjectByKeyIndex(String keyFieldName)
      Initialize l'index des UiObjects par Clé. Attention : nécessite la DtList (appel obtainDtList).
      Parameters:
      keyFieldName - Nom du champs à indexer
    • obtainDtList

      protected abstract io.vertigo.datamodel.structure.model.DtList<O> obtainDtList()
      Récupère la liste des elements. Peut-être appelé souvant : doit assurer un cache local (transient au besoin) si chargement.
      Returns:
      Liste des éléments
    • getDtDefinition

      public final io.vertigo.datamodel.structure.definitions.DtDefinition getDtDefinition()
      Specified by:
      getDtDefinition in interface UiList<O extends io.vertigo.datamodel.structure.model.DtObject>
      Returns:
      DtDefinition de l'objet métier
    • get

      public final UiObject<O> get(int index)
      Specified by:
      get in interface List<O extends io.vertigo.datamodel.structure.model.DtObject>
      Specified by:
      get in class AbstractList<UiObject<O extends io.vertigo.datamodel.structure.model.DtObject>>
    • size

      public final int size()
      Specified by:
      size in interface Collection<O extends io.vertigo.datamodel.structure.model.DtObject>
      Specified by:
      size in interface List<O extends io.vertigo.datamodel.structure.model.DtObject>
      Specified by:
      size in class AbstractCollection<UiObject<O extends io.vertigo.datamodel.structure.model.DtObject>>
    • indexOf

      public int indexOf(Object o)
      Specified by:
      indexOf in interface List<O extends io.vertigo.datamodel.structure.model.DtObject>
      Specified by:
      indexOf in interface UiList<O extends io.vertigo.datamodel.structure.model.DtObject>
      Overrides:
      indexOf in class AbstractList<UiObject<O extends io.vertigo.datamodel.structure.model.DtObject>>
    • getById

      public UiObject<O> getById(String keyFieldName, Serializable keyValue)
      Récupère un objet par la valeur de son identifiant. Utilisé par les select, radio et autocomplete en mode ReadOnly.
      Parameters:
      keyFieldName - Nom du champ identifiant
      keyValue - Valeur de l'identifiant
      Returns:
      UiObject
      Throws:
      io.vertigo.datamodel.structure.definitions.FormatterException - Format error
    • obtainUiObjectByIdMap

      protected final Map<Serializable,UiObject<O>> obtainUiObjectByIdMap(String keyFieldName)
      Récupère l'index des UiObjects par Id. Calcul l'index si besoin.
      Parameters:
      keyFieldName - Nom du champ identifiant
      Returns:
      Index des UiObjects par Id
    • getUiObjectBuffer

      protected final Collection<UiObject<O>> getUiObjectBuffer()
      Returns:
      Liste des uiObjects bufferisés (potentiellement modifiés).
    • clearUiObjectBuffer

      protected final void clearUiObjectBuffer()
      Vide le buffer des UiObjects (potentiellement modifiés).
    • listForClient

      public ArrayList<HashMap<String,Serializable>> listForClient(Set<String> fieldsForClient, Map<String,Function<Serializable,String>> valueTransformers)
      Return a Serializable List for client.
      Parameters:
      fieldsForClient - List of fields
      valueTransformers - Map of transformers
      Returns:
      ArrayList of HashMap (needed for Serializable)