public class SubItemUtil
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
SubItemUtil.IPredicate<T> |
| Constructor and Description |
|---|
SubItemUtil() |
| Modifier and Type | Method and Description |
|---|---|
static int |
countItems(IItemAdapter adapter,
boolean countHeaders)
counts the items in the adapter, respecting subitems regardless of there current visibility
|
static int |
countItems(IItemAdapter adapter,
SubItemUtil.IPredicate predicate)
counts the items in the adapter, respecting subitems regardless of there current visibility
|
static <T extends IItem & IExpandable> |
countSelectedSubItems(FastAdapter adapter,
T header)
counts the selected items in the adapter underneath an expandable item, recursively
|
static <T extends IItem & IExpandable> |
countSelectedSubItems(java.util.Set<IItem> selections,
T header) |
static java.util.List<IItem> |
delete(FastAdapter fastAdapter,
ExpandableExtension expandableExtension,
java.util.Collection<java.lang.Long> identifiersToDelete,
boolean notifyParent,
boolean deleteEmptyHeaders)
deletes all items in identifiersToDelete collection from the adapter respecting if there are sub items or not
subitems are removed from their parents sublists, main items are directly removed
|
static java.util.List<IItem> |
deleteSelected(FastAdapter fastAdapter,
ExpandableExtension expandableExtension,
boolean notifyParent,
boolean deleteEmptyHeaders)
deletes all selected items from the adapter respecting if the are sub items or not
subitems are removed from their parents sublists, main items are directly removed
Alternatively you might consider also looking at:
SelectExtension#deleteAllSelectedItems() |
static void |
deselect(FastAdapter adapter)
Deprecated.
See
SelectExtension#deselect() ()} |
static java.util.List<IItem> |
getAllItems(IItemAdapter adapter,
boolean countHeaders)
retrieves a flat list of the items in the adapter, respecting subitems regardless of there current visibility
|
static java.util.List<IItem> |
getAllItems(IItemAdapter adapter,
SubItemUtil.IPredicate predicate)
retrieves a flat list of the items in the adapter, respecting subitems regardless of there current visibility
|
static java.util.List<IItem> |
getAllItems(java.util.List<IItem> items,
boolean countHeaders,
SubItemUtil.IPredicate predicate)
retrieves a flat list of the items in the provided list, respecting subitems regardless of there current visibility
|
static java.util.Set<IItem> |
getSelectedItems(FastAdapter adapter)
Deprecated.
See
FastAdapter#getSelectedItems() ()} ()} |
static <Item extends IItem & IExpandable> |
notifyItemsChanged(FastAdapter adapter,
ExpandableExtension expandableExtension,
Item header,
java.util.Set<java.lang.Long> identifiers,
boolean checkSubItems,
boolean restoreExpandedState)
notifies items (incl.
|
static <Item extends IItem & IExpandable> |
notifyItemsChanged(FastAdapter adapter,
ExpandableExtension expandableExtension,
java.util.Set<java.lang.Long> identifiers)
notifies items (incl.
|
static <Item extends IItem & IExpandable> |
notifyItemsChanged(FastAdapter adapter,
ExpandableExtension expandableExtension,
java.util.Set<java.lang.Long> identifiers,
boolean restoreExpandedState)
notifies items (incl.
|
static <T extends IItem & IExpandable> |
selectAllSubItems(FastAdapter adapter,
T header,
boolean select)
select or unselect all sub itmes underneath an expandable item
|
static <T extends IItem & IExpandable> |
selectAllSubItems(FastAdapter adapter,
T header,
boolean select,
boolean notifyParent,
java.lang.Object payload)
select or unselect all sub itmes underneath an expandable item
|
static boolean |
selectItem(FastAdapter adapter,
long identifier,
boolean select)
Deprecated.
See
SelectExtension#selectByIdentifier(long, boolean, boolean) ()} ()} |
@Deprecated public static java.util.Set<IItem> getSelectedItems(FastAdapter adapter)
FastAdapter#getSelectedItems() ()} ()}adapter - the adapter instancepublic static int countItems(IItemAdapter adapter,
SubItemUtil.IPredicate predicate)
adapter - the adapter instancepredicate - predicate against which each item will be checked before counting itpublic static int countItems(IItemAdapter adapter,
boolean countHeaders)
adapter - the adapter instancecountHeaders - if true, headers will be counted as wellpublic static java.util.List<IItem> getAllItems(IItemAdapter adapter,
SubItemUtil.IPredicate predicate)
adapter - the adapter instancepredicate - predicate against which each item will be checked before adding it to the resultpublic static java.util.List<IItem> getAllItems(IItemAdapter adapter,
boolean countHeaders)
adapter - the adapter instancecountHeaders - if true, headers will be counted as wellpublic static java.util.List<IItem> getAllItems(java.util.List<IItem> items,
boolean countHeaders,
SubItemUtil.IPredicate predicate)
items - the list of items to processcountHeaders - if true, headers will be counted as wellpublic static <T extends IItem & IExpandable> int countSelectedSubItems(FastAdapter adapter,
T header)
adapter - the adapter instanceheader - the header who's selected children should be countedpublic static <T extends IItem & IExpandable> int countSelectedSubItems(java.util.Set<IItem> selections,
T header)
public static <T extends IItem & IExpandable> void selectAllSubItems(FastAdapter adapter,
T header,
boolean select)
adapter - the adapter instanceheader - the header who's children should be selected or deselectedselect - the new selected state of the sub itemspublic static <T extends IItem & IExpandable> void selectAllSubItems(FastAdapter adapter,
T header,
boolean select,
boolean notifyParent,
java.lang.Object payload)
adapter - the adapter instanceheader - the header who's children should be selected or deselectedselect - the new selected state of the sub itemsnotifyParent - true, if the parent should be notified about the changes of its children selection statepayload - payload for the notifying function@Deprecated
public static boolean selectItem(FastAdapter adapter,
long identifier,
boolean select)
SelectExtension#selectByIdentifier(long, boolean, boolean) ()} ()}adapter - the adapter instanceidentifier - the identifier of the item to select / deselectselect - the new selected state of the sub items@Deprecated public static void deselect(FastAdapter adapter)
SelectExtension#deselect() ()}adapter - the adapter instancepublic static java.util.List<IItem> deleteSelected(FastAdapter fastAdapter,
ExpandableExtension expandableExtension,
boolean notifyParent,
boolean deleteEmptyHeaders)
SelectExtension#deleteAllSelectedItems()deleteEmptyHeaders - if true, empty headers will be removed from the adapterpublic static java.util.List<IItem> delete(FastAdapter fastAdapter,
ExpandableExtension expandableExtension,
java.util.Collection<java.lang.Long> identifiersToDelete,
boolean notifyParent,
boolean deleteEmptyHeaders)
fastAdapter - the adapter to remove the items fromidentifiersToDelete - ids of items to removenotifyParent - if true, headers of removed items will be notified about the change of their child itemsdeleteEmptyHeaders - if true, empty headers will be removed from the adapterpublic static <Item extends IItem & IExpandable> void notifyItemsChanged(FastAdapter adapter,
ExpandableExtension expandableExtension,
java.util.Set<java.lang.Long> identifiers)
adapter - the adapteridentifiers - set of identifiers that should be notifiedpublic static <Item extends IItem & IExpandable> void notifyItemsChanged(FastAdapter adapter,
ExpandableExtension expandableExtension,
java.util.Set<java.lang.Long> identifiers,
boolean restoreExpandedState)
adapter - the adapteridentifiers - set of identifiers that should be notifiedrestoreExpandedState - true, if expanded headers should stay expandedpublic static <Item extends IItem & IExpandable> void notifyItemsChanged(FastAdapter adapter,
ExpandableExtension expandableExtension,
Item header,
java.util.Set<java.lang.Long> identifiers,
boolean checkSubItems,
boolean restoreExpandedState)
adapter - the adapterheader - the expandable header that should be checked (incl. sub items)identifiers - set of identifiers that should be notifiedcheckSubItems - true, if sub items of headers items should be checked recursivelyrestoreExpandedState - true, if expanded headers should stay expanded