Class SimpleListProperty<S,E>
- java.lang.Object
-
- org.eclipse.core.databinding.property.list.ListProperty<S,E>
-
- org.eclipse.core.databinding.property.list.SimpleListProperty<S,E>
-
- Type Parameters:
S
- type of the source objectE
- type of the elements in the list
- All Implemented Interfaces:
IProperty
,IListProperty<S,E>
- Direct Known Subclasses:
ViewerListProperty
,WidgetListProperty
public abstract class SimpleListProperty<S,E> extends ListProperty<S,E>
Simplified abstract implementation of IListProperty. This class takes care of most of the functional requirements for an IListProperty implementation, leaving only the property-specific details to subclasses.Subclasses must implement these methods:
IListProperty.getElementType()
doGetList(Object)
doSetList(Object, List, ListDiff)
adaptListener(ISimplePropertyListener)
In addition, we recommended overriding
Object.toString()
to return a description suitable for debugging purposes.- Since:
- 1.2
-
-
Constructor Summary
Constructors Constructor Description SimpleListProperty()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract INativePropertyListener<S>
adaptListener(ISimplePropertyListener<S,ListDiff<E>> listener)
Returns a listener capable of adding or removing itself as a listener on a source object using the the source's "native" listener API.protected abstract List<E>
doGetList(S source)
Returns a List with the current contents of the source's list propertyprotected void
doSetList(S source, List<E> list)
Updates the property on the source with the specified change.protected abstract void
doSetList(S source, List<E> list, ListDiff<E> diff)
Updates the property on the source with the specified change.protected void
doUpdateList(S source, ListDiff<E> diff)
Updates the property on the source with the specified changeIObservableList<E>
observe(Realm realm, S source)
Returns an observable list observing this list property on the given property sourcevoid
setList(S source, List<E> list, ListDiff<E> diff)
Updates the property on the source with the specified change.-
Methods inherited from class org.eclipse.core.databinding.property.list.ListProperty
getList, listFactory, listFactory, observe, observeDetail, setList, updateList, values
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.core.databinding.property.list.IListProperty
getElementType
-
-
-
-
Method Detail
-
observe
public IObservableList<E> observe(Realm realm, S source)
Description copied from interface:IListProperty
Returns an observable list observing this list property on the given property source- Parameters:
realm
- the observable's realmsource
- the property source- Returns:
- an observable list observing this list property on the given property source
-
doGetList
protected abstract List<E> doGetList(S source)
Description copied from class:ListProperty
Returns a List with the current contents of the source's list property- Overrides:
doGetList
in classListProperty<S,E>
- Parameters:
source
- the property source- Returns:
- a List with the current contents of the source's list property
-
setList
public final void setList(S source, List<E> list, ListDiff<E> diff)
Updates the property on the source with the specified change.- Parameters:
source
- the property sourcelist
- the new listdiff
- a diff describing the change- Since:
- 1.6
- Restriction:
- This method is not intended to be referenced by clients.
-
doSetList
protected abstract void doSetList(S source, List<E> list, ListDiff<E> diff)
Updates the property on the source with the specified change.- Parameters:
source
- the property sourcelist
- the new listdiff
- a diff describing the change- Restriction:
- This method is not intended to be referenced by clients.
-
doSetList
protected void doSetList(S source, List<E> list)
Description copied from class:ListProperty
Updates the property on the source with the specified change.- Overrides:
doSetList
in classListProperty<S,E>
- Parameters:
source
- the property sourcelist
- the new list
-
doUpdateList
protected void doUpdateList(S source, ListDiff<E> diff)
Description copied from class:ListProperty
Updates the property on the source with the specified change- Overrides:
doUpdateList
in classListProperty<S,E>
- Parameters:
source
- the property sourcediff
- a diff describing the change
-
adaptListener
public abstract INativePropertyListener<S> adaptListener(ISimplePropertyListener<S,ListDiff<E>> listener)
Returns a listener capable of adding or removing itself as a listener on a source object using the the source's "native" listener API. Events received from the source objects are parlayed to the specified listener argument.This method returns null if the source object has no listener APIs for this property.
- Parameters:
listener
- the property listener to receive events- Returns:
- a native listener which parlays property change events to the specified listener, or null if the source object has no listener APIs for this property.
- Restriction:
- This method is not intended to be referenced by clients.
-
-