Interface IContentProvider<ITEM extends IContentItem,ITEM_CONTENT extends IContentData<ITEM>>

All Known Subinterfaces:
IContentProviderAPI<ITEM,ITEM_CONTENT>, IMListContentProvider, IMListContentProviderAPI
All Known Implementing Classes:
AbstractContentProvider, MapMarkerContentProvider, MLContentProvider

public interface IContentProvider<ITEM extends IContentItem,ITEM_CONTENT extends IContentData<ITEM>>
Generic interface of content providing. This interface is the base interface used to provide contents into e.g. comboboxes, maps, etc.
Author:
Christopher Mindus
  • Method Details Link icon

    • onSelectionTypeChanged Link icon

      void onSelectionTypeChanged(int selectionType)
      Called when the content provider changes selection type.
      Parameters:
      selectionType - The selection type: 0=none, 1=single, 2=multiple.
    • initialize Link icon

      Called to initialize the content provider for the container instance.
      Parameters:
      cnr - The container.
    • getItemsContainer Link icon

      Returns the items container.
      Returns:
      The container that stores the item properties. This method will return null if not yet initialized.
    • reinitialize Link icon

      void reinitialize()
      This method is called when the content provider needs re-initialization due to e.g. a change of its properties, e.g. the VSTable or one of the columns.
    • dispose Link icon

      void dispose()
      Called when the content provider is no longer required by the container.
    • canModifyWithAPI Link icon

      default boolean canModifyWithAPI()
      Returns if API is enabled for this content provider or not. If the content provider is connected to VirtualSpace, this method will return false.
      Returns:
      true if the API methods for modification can be used, false otherwise.
    • beginChanges Link icon

      void beginChanges()
      Begins a mass change operation of the content by means of the API. Call this method to avoid updates being fired to the client before all changes are committed.

      A call to this method must be followed by a call to commitChanges().

    • commitChanges Link icon

      void commitChanges()
      Commits a mass change operation of the content by means of the API. This method will fire the updates to the client.

      Each call to beginChanges() must be followed by a call to this method.

    • getItemCount Link icon

      int getItemCount()
      Gets the count of items. This method is intended for API usage.

      Note: if the content provider is connected to VirtualSpace, this count may not be up-to-date before updateContents() has been called.

      Returns:
      The count of items that will be provided.
    • getAll Link icon

      ITEM_CONTENT[] getAll()
      Returns the array of content data provided.
      Returns:
      The array of content data.
    • updateContents Link icon

      void updateContents()
      Updates all the items to match the current contents.

      This method is not intended to be called, it is used by the framework -- DO NOT CALL THE METHOD!

      Override this method to perform specialized processing.

      Note: this method is always called from the content updater thread, i.e. the client worker thread.

    • onAdded Link icon

      boolean onAdded(VSRow row, int index)
      Called when a VSRow is added in the connected table.
      Parameters:
      row - The row added.
      index - The row index added (-1 or table size for last).
      Returns:
      true for success, false to cause a refresh of the containers content.
    • onRemoved Link icon

      boolean onRemoved(VSRow row, int index)
      Called when a VSRow is removed in the connected table.
      Parameters:
      row - The row removed.
      index - The row index removed.
      Returns:
      true for success, false to cause a refresh of the containers content.