E
- the list element typepublic class DecoratingObservableList<E> extends DecoratingObservableCollection<E> implements IObservableList<E>
Constructor and Description |
---|
DecoratingObservableList(IObservableList<E> decorated,
boolean disposeDecoratedOnDispose)
Constructs a DecoratingObservableList which decorates the given
observable.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
E o) |
boolean |
addAll(int index,
Collection<? extends E> c) |
void |
addListChangeListener(IListChangeListener<? super E> listener)
Adds the given list change listener to the list of list change listeners.
|
protected void |
addListener(Object listenerType,
IObservablesListener listener) |
protected Object |
clone() |
void |
dispose()
Disposes of this observable object, removing all listeners registered
with this object, and all listeners this object might have registered on
other objects.
|
protected void |
fireChange() |
protected void |
fireEvent(ObservableEvent event) |
protected void |
fireListChange(ListDiff<E> diff) |
protected void |
firstListenerAdded() |
E |
get(int index) |
Realm |
getRealm() |
protected void |
handleListChange(ListChangeEvent<? extends E> event)
Called whenever a ListChangeEvent is received from the decorated
observable.
|
protected boolean |
hasListeners() |
int |
indexOf(Object o) |
int |
lastIndexOf(Object o) |
protected void |
lastListenerRemoved() |
ListIterator<E> |
listIterator() |
ListIterator<E> |
listIterator(int index) |
E |
move(int oldIndex,
int newIndex)
Moves the element located at
oldIndex to
newIndex . |
E |
remove(int index) |
void |
removeListChangeListener(IListChangeListener<? super E> listener)
Removes the given list change listener from the list of list change
listeners.
|
protected void |
removeListener(Object listenerType,
IObservablesListener listener) |
E |
set(int index,
E element) |
List<E> |
subList(int fromIndex,
int toIndex) |
add, addAll, clear, contains, containsAll, equals, getElementType, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString
getDecorated, getterCalled, handleStaleEvent, isStale
addChangeListener, addDisposeListener, addStaleListener, checkRealm, fireStale, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListener
finalize, getClass, notify, notifyAll, wait, wait, wait
add, addAll, contains, containsAll, equals, getElementType, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
clear, replaceAll, sort, spliterator
addChangeListener, addDisposeListener, addStaleListener, getRealm, isDisposed, isStale, removeChangeListener, removeDisposeListener, removeStaleListener
parallelStream, removeIf, stream
public DecoratingObservableList(IObservableList<E> decorated, boolean disposeDecoratedOnDispose)
decorated
- the observable list being decorateddisposeDecoratedOnDispose
- public void addListChangeListener(IListChangeListener<? super E> listener)
IObservableList
addListChangeListener
in interface IObservableList<E>
public void removeListChangeListener(IListChangeListener<? super E> listener)
IObservableList
removeListChangeListener
in interface IObservableList<E>
protected void fireChange()
fireChange
in class AbstractObservable
protected void firstListenerAdded()
firstListenerAdded
in class DecoratingObservable
protected void lastListenerRemoved()
lastListenerRemoved
in class DecoratingObservable
protected void handleListChange(ListChangeEvent<? extends E> event)
event
- the change event received from the decorated observablepublic boolean addAll(int index, Collection<? extends E> c)
public E get(int index)
public int indexOf(Object o)
public int lastIndexOf(Object o)
lastIndexOf
in interface List<E>
lastIndexOf
in interface IObservableList<E>
public ListIterator<E> listIterator()
listIterator
in interface List<E>
listIterator
in interface IObservableList<E>
public ListIterator<E> listIterator(int index)
listIterator
in interface List<E>
listIterator
in interface IObservableList<E>
public E move(int oldIndex, int newIndex)
IObservableList
oldIndex
to
newIndex
. This method is equivalent to calling
add(newIndex, remove(oldIndex))
.
Implementors should deliver list change notification for the remove and
add operations in the same ListChangeEvent, as this allows
ListDiff.accept(ListDiffVisitor)
to recognize the operation as a
move.
move
in interface IObservableList<E>
oldIndex
- the element's position before the move. Must be within the
range 0 <= oldIndex < size()
.newIndex
- the element's position after the move. Must be within the
range 0 <= newIndex < size()
.ListDiffVisitor.handleMove(int, int, Object)
,
ListDiff.accept(ListDiffVisitor)
public E remove(int index)
public void dispose()
IObservable
dispose
in interface IObservable
dispose
in class DecoratingObservableCollection<E>
protected void addListener(Object listenerType, IObservablesListener listener)
listenerType
- listener
- protected void removeListener(Object listenerType, IObservablesListener listener)
listenerType
- listener
- protected boolean hasListeners()
protected void fireEvent(ObservableEvent event)
public Realm getRealm()
protected Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Copyright (c) 2000, 2016 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.