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

    • Method Detail

      • onSelectionTypeChanged

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

        AbstractContentUIContainer<ITEM,​ITEM_CONTENT> getItemsContainer()
        Returns the items container.
        Returns:
        The container that stores the item properties. This method will return null if not yet initialized.
      • reinitialize

        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

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

        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

        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

        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

        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

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

        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

        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

        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.