Errai 3.0.1-SNAPSHOT

org.jboss.errai.databinding.client
Class UnspecificListChangeHandler<M>

java.lang.Object
  extended by org.jboss.errai.databinding.client.UnspecificListChangeHandler<M>
Type Parameters:
M -
All Implemented Interfaces:
BindableListChangeHandler<M>

public abstract class UnspecificListChangeHandler<M>
extends Object
implements BindableListChangeHandler<M>

A BindableListChangeHandler that can be used in case details of the underlying list mutation are irrelevant (when the sole information that the list has changed is sufficient).

Author:
Christian Sadilek

Constructor Summary
UnspecificListChangeHandler()
           
 
Method Summary
 void onItemAdded(List<M> source, M item)
          Called when a single item has been appended to the list.
 void onItemAddedAt(List<M> source, int index, M item)
          Called when a single item has been added to the list at the provided index.
 void onItemChanged(List<M> source, int index, M item)
          Called when a single item has been changed.
 void onItemRemovedAt(List<M> source, int index)
          Called when a single item has been removed from the list at the provided index.
 void onItemsAdded(List<M> source, Collection<? extends M> items)
          Called when multiple items have been appended to the list.
 void onItemsAddedAt(List<M> source, int index, Collection<? extends M> items)
          Called when multiple items have been added to the list starting at the provided index.
 void onItemsCleared(List<M> source)
          Called when all items have been removed from the list.
 void onItemsRemovedAt(List<M> source, List<Integer> indexes)
          Called when multiple items have been removed from the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnspecificListChangeHandler

public UnspecificListChangeHandler()
Method Detail

onItemAdded

public void onItemAdded(List<M> source,
                        M item)
Description copied from interface: BindableListChangeHandler
Called when a single item has been appended to the list.

Specified by:
onItemAdded in interface BindableListChangeHandler<M>
Parameters:
source - a list representing the state before the item was appended (equal to the old value of the list). Never null.
item - the added item. May be null.

onItemAddedAt

public void onItemAddedAt(List<M> source,
                          int index,
                          M item)
Description copied from interface: BindableListChangeHandler
Called when a single item has been added to the list at the provided index.

Specified by:
onItemAddedAt in interface BindableListChangeHandler<M>
Parameters:
source - a list representing the state before the item was added (equal to the old value of the list). Never null.
index - the index at which the item has been added.
item - the added item. May be null.

onItemsAdded

public void onItemsAdded(List<M> source,
                         Collection<? extends M> items)
Description copied from interface: BindableListChangeHandler
Called when multiple items have been appended to the list.

Specified by:
onItemsAdded in interface BindableListChangeHandler<M>
Parameters:
source - a list representing the state before the items were appended (equal to the old value of the list). Never null.
items - the added items. May contain null elements.

onItemsAddedAt

public void onItemsAddedAt(List<M> source,
                           int index,
                           Collection<? extends M> items)
Description copied from interface: BindableListChangeHandler
Called when multiple items have been added to the list starting at the provided index.

Specified by:
onItemsAddedAt in interface BindableListChangeHandler<M>
Parameters:
source - a list representing the state before the items were added (equal to the old value of the list). Never null.
index - the index at which the items have been added.

onItemsCleared

public void onItemsCleared(List<M> source)
Description copied from interface: BindableListChangeHandler
Called when all items have been removed from the list.

Specified by:
onItemsCleared in interface BindableListChangeHandler<M>
Parameters:
source - a list representing the state before all items were removed (equal to the old value of the list). Never null.

onItemRemovedAt

public void onItemRemovedAt(List<M> source,
                            int index)
Description copied from interface: BindableListChangeHandler
Called when a single item has been removed from the list at the provided index.

Specified by:
onItemRemovedAt in interface BindableListChangeHandler<M>
Parameters:
source - a list representing the state before the item was removed (equal to the old value of the list). Never null.
index - the index at which the item has been removed.

onItemsRemovedAt

public void onItemsRemovedAt(List<M> source,
                             List<Integer> indexes)
Description copied from interface: BindableListChangeHandler
Called when multiple items have been removed from the list.

Specified by:
onItemsRemovedAt in interface BindableListChangeHandler<M>
Parameters:
source - a list representing the state before the items were removed (equal to the old value of the list). Never null.

onItemChanged

public void onItemChanged(List<M> source,
                          int index,
                          M item)
Description copied from interface: BindableListChangeHandler
Called when a single item has been changed.

Specified by:
onItemChanged in interface BindableListChangeHandler<M>
Parameters:
source - a list representing the state before the item was changed (equal to the old value of the list). Never null.
index - the index of the item that has changed.
item - the new value of the item at the provided index.

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.