Package com.iizix.prop.content
Interface IContentProviderAPI<ITEM extends IContentItem,ITEM_CONTENT extends IContentData<ITEM>> 
- All Superinterfaces:
- IContentProvider<ITEM,- ITEM_CONTENT> 
- All Known Subinterfaces:
- IMListContentProviderAPI
- All Known Implementing Classes:
- AbstractContentProvider,- MapMarkerContentProvider,- MLContentProvider
public interface IContentProviderAPI<ITEM extends IContentItem,ITEM_CONTENT extends IContentData<ITEM>>  extends IContentProvider<ITEM,ITEM_CONTENT> 
Extends the generic interface of content providing with an API to add/remove items by means of API. The method to change the items will throw exceptions if not enabled for API, e.g. when a connection to VirtualSpace is present.
- Author:
- Christopher Mindus
- Method SummaryModifier and TypeMethodDescription- void- add- (int index, ITEM_CONTENT item) Inserts a new item before the specified index.- default void- add- (ITEM_CONTENT item) Adds a new item to the end of the list.Clear the selection.- get- (int index) Gets an item at the specified index.- getAll()Gets all items.- intGets the first selected index.- int[]Gets the selected indicies.- int- indexOf- (ITEM_CONTENT item) Returns the index of an item.- void- onSelectionChanged- (ITEM_CONTENT item, boolean isSelected) Called from the items when they are selected or unselected from their- setSelection(boolean)method.- remove- (int index) Removes an item at the specified index.- boolean- remove- (ITEM_CONTENT item) Removes an item.- booleanRemoves all items.- setSelection- (int index) Sets the selection as a single selected item at specified index.- setSelection- (int[] indicies) Sets the selection to the specified indicies.- Methods inherited from interface com.iizix.prop.content.IContentProvider- beginChanges, canModifyWithAPI, commitChanges, dispose, getItemCount, getItemsContainer, initialize, onAdded, onRemoved, onSelectionTypeChanged, reinitialize, updateContents
- Method Details- addAdds a new item to the end of the list. Duplicates are not allowed.- Parameters:
- item- The item to insert.
 
- addInserts a new item before the specified index. Duplicates are not allowed.- Parameters:
- index- The insertion point index, -1 for last.
- item- The item to insert.
- Throws:
- IndexOutOfBoundsException- If the index is not valid.
 
- removeRemoves an item at the specified index.- Parameters:
- index- The item to remove.
- Returns:
- The removed item.
- Throws:
- IndexOutOfBoundsException- If the index is not valid.
 
- removeRemoves an item.- Parameters:
- item- The item to remove.
- Returns:
- true for success, false if not found.
 
- removeAllboolean removeAll()Removes all items.- Returns:
- true for changed, false when no items were present.
 
- getGets an item at the specified index.- Parameters:
- index- The index of the item.
- Returns:
- The item.
- Throws:
- IndexOutOfBoundsException- If the index is not valid.
 
- getAllITEM_CONTENT[] getAll()Gets all items.- Specified by:
- getAllin interface- IContentProvider<ITEM extends IContentItem,- ITEM_CONTENT extends IContentData<ITEM>> 
- Returns:
- The array of items.
 
- indexOfReturns the index of an item.- Parameters:
- item- The item to look-up.
- Returns:
- The index of the item, or -1 if not found.
 
- getFirstSelectedIndexint getFirstSelectedIndex()Gets the first selected index.- Returns:
- The first index in the current selection, or -1 for none.
 
- getSelectedIndiciesint[] getSelectedIndicies()Gets the selected indicies.- Returns:
- A new array of the selected indices (that may be modified to your liking), or a static zero in length array for no selection.
 
- setSelectionSets the selection as a single selected item at specified index.- Parameters:
- index- The single item to select at index, -1 to clear the selection.
- Returns:
- null for success, otherwise an error message why the selection failed.
 
- setSelectionSets the selection to the specified indicies.- Parameters:
- indicies- The indicies.
- Returns:
- null for success, otherwise the error message with the reason why it failed.
 
- clearSelectionString clearSelection()Clear the selection.
- onSelectionChangedCalled from the items when they are selected or unselected from their- setSelection(boolean)method.- The method is NOT intended to be called. - Parameters:
- item- The item who's selection changed.
- isSelected- The new selection state.