|
Eclipse Platform Release 3.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.databinding.observable.AbstractObservable
org.eclipse.core.databinding.observable.list.ObservableList
public abstract class ObservableList
Abstract implementation of IObservableList
, based on an underlying
regular list.
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 | |
---|---|
protected java.util.List |
wrappedList
|
Constructor Summary | |
---|---|
protected |
ObservableList(java.util.List wrappedList,
java.lang.Object elementType)
|
protected |
ObservableList(Realm realm,
java.util.List wrappedList,
java.lang.Object elementType)
|
Method Summary | |
---|---|
void |
add(int index,
java.lang.Object element)
|
boolean |
add(java.lang.Object o)
|
boolean |
addAll(java.util.Collection c)
|
boolean |
addAll(int index,
java.util.Collection c)
|
void |
addListChangeListener(IListChangeListener listener)
Adds the given list change listener to the list of list change listeners. |
protected void |
addListener(java.lang.Object listenerType,
IObservablesListener listener)
|
void |
clear()
|
protected java.lang.Object |
clone()
|
boolean |
contains(java.lang.Object o)
|
boolean |
containsAll(java.util.Collection c)
|
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. |
boolean |
equals(java.lang.Object o)
|
protected void |
fireChange()
|
protected void |
fireEvent(ObservableEvent event)
|
protected void |
fireListChange(ListDiff diff)
|
protected void |
firstListenerAdded()
|
java.lang.Object |
get(int index)
|
java.lang.Object |
getElementType()
Returns the element type of this observable collection, or null if this observable collection is untyped. |
Realm |
getRealm()
|
protected void |
getterCalled()
|
int |
hashCode()
|
protected boolean |
hasListeners()
|
int |
indexOf(java.lang.Object o)
|
boolean |
isEmpty()
|
boolean |
isStale()
Returns the stale state. |
java.util.Iterator |
iterator()
|
int |
lastIndexOf(java.lang.Object o)
|
protected void |
lastListenerRemoved()
|
java.util.ListIterator |
listIterator()
|
java.util.ListIterator |
listIterator(int index)
|
java.lang.Object |
move(int oldIndex,
int newIndex)
Moves the element located at oldIndex to
newIndex . |
java.lang.Object |
remove(int index)
|
boolean |
remove(java.lang.Object o)
|
boolean |
removeAll(java.util.Collection c)
|
void |
removeListChangeListener(IListChangeListener listener)
Removes the given list change listener from the list of list change listeners. |
protected void |
removeListener(java.lang.Object listenerType,
IObservablesListener listener)
|
boolean |
retainAll(java.util.Collection c)
|
java.lang.Object |
set(int index,
java.lang.Object element)
|
void |
setStale(boolean stale)
Sets the stale state. |
int |
size()
|
java.util.List |
subList(int fromIndex,
int toIndex)
|
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] a)
|
java.lang.String |
toString()
|
protected void |
updateWrappedList(java.util.List newList)
|
Methods inherited from class org.eclipse.core.databinding.observable.AbstractObservable |
---|
addChangeListener, addDisposeListener, addStaleListener, checkRealm, fireStale, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListener |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.core.databinding.observable.IObservable |
---|
addChangeListener, addDisposeListener, addStaleListener, getRealm, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListener |
Field Detail |
---|
protected java.util.List wrappedList
Constructor Detail |
---|
protected ObservableList(java.util.List wrappedList, java.lang.Object elementType)
protected ObservableList(Realm realm, java.util.List wrappedList, java.lang.Object elementType)
Method Detail |
---|
public void addListChangeListener(IListChangeListener listener)
IObservableList
addListChangeListener
in interface IObservableList
public void removeListChangeListener(IListChangeListener listener)
IObservableList
removeListChangeListener
in interface IObservableList
protected void fireListChange(ListDiff diff)
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection
contains
in interface java.util.List
contains
in interface IObservableList
public boolean containsAll(java.util.Collection c)
containsAll
in interface java.util.Collection
containsAll
in interface java.util.List
containsAll
in interface IObservableList
public boolean equals(java.lang.Object o)
equals
in interface java.util.Collection
equals
in interface java.util.List
equals
in interface IObservableList
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface java.util.Collection
hashCode
in interface java.util.List
hashCode
in interface IObservableList
hashCode
in class java.lang.Object
public boolean isEmpty()
isEmpty
in interface java.util.Collection
isEmpty
in interface java.util.List
isEmpty
in interface IObservableList
public java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in interface java.util.List
iterator
in interface IObservableList
public int size()
size
in interface java.util.Collection
size
in interface java.util.List
size
in interface IObservableList
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
toArray
in interface java.util.List
toArray
in interface IObservableList
public java.lang.Object[] toArray(java.lang.Object[] a)
toArray
in interface java.util.Collection
toArray
in interface java.util.List
toArray
in interface IObservableList
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object get(int index)
get
in interface java.util.List
get
in interface IObservableList
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List
indexOf
in interface IObservableList
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List
lastIndexOf
in interface IObservableList
public java.util.ListIterator listIterator()
listIterator
in interface java.util.List
listIterator
in interface IObservableList
public java.util.ListIterator listIterator(int index)
listIterator
in interface java.util.List
listIterator
in interface IObservableList
public java.util.List subList(int fromIndex, int toIndex)
subList
in interface java.util.List
subList
in interface IObservableList
protected void getterCalled()
public java.lang.Object set(int index, java.lang.Object element)
set
in interface java.util.List
set
in interface IObservableList
public java.lang.Object move(int oldIndex, int newIndex)
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
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()
.
java.lang.IndexOutOfBoundsException
- if either argument is out of range (
0 <= index < size()
).ListDiffVisitor.handleMove(int, int, Object)
,
ListDiff.accept(ListDiffVisitor)
public java.lang.Object remove(int index)
remove
in interface java.util.List
remove
in interface IObservableList
public boolean add(java.lang.Object o)
add
in interface java.util.Collection
add
in interface java.util.List
add
in interface IObservableList
public void add(int index, java.lang.Object element)
add
in interface java.util.List
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
addAll
in interface java.util.List
addAll
in interface IObservableList
public boolean addAll(int index, java.util.Collection c)
addAll
in interface java.util.List
addAll
in interface IObservableList
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection
remove
in interface java.util.List
remove
in interface IObservableList
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
removeAll
in interface java.util.List
removeAll
in interface IObservableList
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
retainAll
in interface java.util.List
retainAll
in interface IObservableList
public void clear()
clear
in interface java.util.Collection
clear
in interface java.util.List
public boolean isStale()
isStale
in interface IObservable
public void setStale(boolean stale)
stale
- The stale state to list. This will fire a stale event if the
given boolean is true and this observable list was not already
stale.protected void fireChange()
fireChange
in class AbstractObservable
public void dispose()
IObservable
dispose
in interface IObservable
dispose
in class AbstractObservable
public java.lang.Object getElementType()
IObservableCollection
null
if this observable collection is untyped.
getElementType
in interface IObservableCollection
getElementType
in interface IObservableList
null
if this observable collection is untyped.protected void updateWrappedList(java.util.List newList)
protected void addListener(java.lang.Object listenerType, IObservablesListener listener)
listenerType
- listener
- protected void removeListener(java.lang.Object listenerType, IObservablesListener listener)
listenerType
- listener
- protected boolean hasListeners()
protected void fireEvent(ObservableEvent event)
protected void firstListenerAdded()
protected void lastListenerRemoved()
public Realm getRealm()
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
|
Eclipse Platform Release 3.6 |
|||||||||
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, 2010. All rights reserved.