|
Eclipse Platform Release 3.4 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.databinding.observable.ChangeManager
org.eclipse.core.databinding.observable.AbstractObservable
org.eclipse.core.databinding.observable.list.ObservableList
org.eclipse.core.databinding.observable.list.WritableList
Mutable observable list backed by an ArrayList.
This class is thread safe. All state accessing methods must be invoked from
the current realm
. Methods for adding and removing
listeners may be invoked from any thread.
Field Summary |
Fields inherited from class org.eclipse.core.databinding.observable.list.ObservableList |
wrappedList |
Constructor Summary | |
WritableList()
Creates an empty writable list in the default realm with a null element type. |
|
WritableList(List toWrap,
Object elementType)
Constructs a new instance with the default realm. |
|
WritableList(Realm realm)
Creates an empty writable list with a null element type. |
|
WritableList(Realm realm,
List toWrap,
Object elementType)
Creates a writable list containing elements of the given type, wrapping an existing client-supplied list. |
Method Summary | |
void |
add(int index,
Object element)
|
boolean |
add(Object element)
|
boolean |
addAll(Collection c)
|
boolean |
addAll(int index,
Collection c)
|
void |
clear()
|
Object |
move(int oldIndex,
int newIndex)
Moves the element located at oldIndex to
newIndex . |
Object |
remove(int index)
|
boolean |
remove(Object o)
|
boolean |
removeAll(Collection c)
|
boolean |
retainAll(Collection c)
|
Object |
set(int index,
Object element)
|
static WritableList |
withElementType(Object elementType)
|
Methods inherited from class org.eclipse.core.databinding.observable.list.ObservableList |
addListChangeListener, contains, containsAll, dispose, equals, fireChange, fireListChange, get, getElementType, getterCalled, hashCode, indexOf, isEmpty, isStale, iterator, lastIndexOf, listIterator, listIterator, removeListChangeListener, setStale, size, subList, toArray, toArray, toString, updateWrappedList |
Methods inherited from class org.eclipse.core.databinding.observable.AbstractObservable |
addChangeListener, addListener, addStaleListener, checkRealm, fireEvent, fireStale, firstListenerAdded, getRealm, hasListeners, lastListenerRemoved, removeChangeListener, removeListener, removeStaleListener |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.core.databinding.observable.IObservable |
addChangeListener, addStaleListener, getRealm, removeChangeListener, removeStaleListener |
Constructor Detail |
public WritableList()
null
element type.
public WritableList(Realm realm)
null
element type.
realm
- public WritableList(List toWrap, Object elementType)
toWrap
- elementType
- can be null
public WritableList(Realm realm, List toWrap, Object elementType)
realm
- toWrap
- The java.utilList to wrapelementType
- can be null
Method Detail |
public Object set(int index, Object element)
set
in interface IObservableList
set
in class ObservableList
public Object move(int oldIndex, int newIndex)
ObservableList
oldIndex
to
newIndex
. This method is equivalent to calling
add(newIndex, remove(oldIndex))
.
Subclasses should override this method to 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
move
in class ObservableList
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 Object remove(int index)
remove
in interface IObservableList
remove
in class ObservableList
public boolean add(Object element)
add
in interface IObservableList
add
in class ObservableList
public void add(int index, Object element)
add
in interface List
add
in class ObservableList
public boolean addAll(Collection c)
addAll
in interface IObservableList
addAll
in class ObservableList
public boolean addAll(int index, Collection c)
addAll
in interface IObservableList
addAll
in class ObservableList
public boolean remove(Object o)
remove
in interface IObservableList
remove
in class ObservableList
public boolean removeAll(Collection c)
removeAll
in interface IObservableList
removeAll
in class ObservableList
public boolean retainAll(Collection c)
retainAll
in interface IObservableList
retainAll
in class ObservableList
public void clear()
clear
in interface List
clear
in class ObservableList
public static WritableList withElementType(Object elementType)
elementType
- can be null
|
Eclipse Platform Release 3.4 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.