public void fireRemoved(ListenableCollection<T> source, Collection<T> elements) { fireEvent(source, elements, CollectionEvent.EventType.REMOVED, -1, -1); } public void fireRemoved(ListenableCollection<T> source, Collection<T> elements, int firstIndex, int lastIndex) {
public void fireUpdated(ListenableCollection<T> source, Collection<T> elements, int firstIndex, int lastIndex) { fireEvent(source, elements, CollectionEvent.EventType.UPDATED, firstIndex, lastIndex); } }
public void fireAdded(ListenableCollection<T> source, Collection<T> elements, int firstIndex, int lastIndex) { fireEvent(source, elements, CollectionEvent.EventType.ADDED, firstIndex, lastIndex); }
public void fireRemoved(ListenableCollection<T> source, Collection<T> elements, int firstIndex, int lastIndex) { fireEvent(source, elements, CollectionEvent.EventType.REMOVED, firstIndex, lastIndex); }
public void fireAdded(ListenableCollection<T> source, Collection<T> elements) { fireEvent(source, elements, CollectionEvent.EventType.ADDED, -1, -1); } public void fireAdded(ListenableCollection<T> source, Collection<T> elements, int firstIndex, int lastIndex) {
public void fireUpdated(ListenableCollection<T> source, Collection<T> elements) { fireEvent(source, elements, CollectionEvent.EventType.UPDATED, -1, -1); } public void fireUpdated(ListenableCollection<T> source, Collection<T> elements, int firstIndex, int lastIndex) {
public void collectionChanged(CollectionEvent<U> e) { // Do not propagate the event if we triggered it if (currentlyCausingChange) return; // Only propagate if someone is listening (CollectionSupport already tries not to fire anything when there is no listener, but here we are trying to avoid to create the wrapped elements collection) if (collectionSupport == null || !collectionSupport.hasListeners()) return; // Adapt the collection of changed / added / removed elements in the event collectionSupport.fireEvent( AdaptedCollection.this, new AdaptedCollection<U, V>(e.getElements(), AdaptedCollection.this.forwardAdapter, AdaptedCollection.this.backwardAdapter), e.getType(), e.getFirstIndex(), e.getLastIndex()); } });