Class MapProperty<S,K,V>
- Type Parameters:
S
- type of the source objectK
- type of the keys to the mapV
- type of the values in the map
- All Implemented Interfaces:
IProperty
,IMapProperty<S,
K, V>
- Direct Known Subclasses:
DelegatingMapProperty
,SimpleMapProperty
- Since:
- 1.2
- Implementation Note:
- If methods are added to the interface which this class implements then implementations of those methods must be added to this class.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a Map with the current contents of the source's map propertyprotected void
Updates the property on the source with the specified change.protected void
doUpdateMap
(S source, MapDiff<K, V> diff) Updates the property on the source with the specified change.By default, this method returnsCollections.EMPTY_MAP
in case the source object isnull
.Returns a factory for creating observable maps tracking this property of a particular property source.mapFactory
(Realm realm) Returns a factory for creating observable maps in the given realm, tracking this property of a particular property source.Returns an observable map observing this map property on the given property source<U extends S>
IObservableMap<K,V> observeDetail
(IObservableValue<U> master) Returns an observable map on the master observable's realm which tracks this property of the values in the entry set ofmaster
.final void
Updates the property on the source with the specified change.final void
Updates the property on the source with the specified change.final <T> IMapProperty<S,
K, T> values
(IValueProperty<? super V, T> detailValues) Returns the nested combination of this property and the specified detail value property.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.map.IMapProperty
getKeyType, getValueType, observe
-
Constructor Details
-
MapProperty
public MapProperty()
-
-
Method Details
-
getMap
By default, this method returnsCollections.EMPTY_MAP
in case the source object isnull
. Otherwise, this method delegates todoGetMap(Object)
.Clients may override this method if they e.g. want to return a specific default map in case the source object is
null
.- Specified by:
getMap
in interfaceIMapProperty<S,
K, V> - Parameters:
source
- the property source (may be null)- Returns:
- a Map with the current contents of the source's map property
- Since:
- 1.3
- See Also:
-
doGetMap
Returns a Map with the current contents of the source's map property- Parameters:
source
- the property source- Returns:
- a Map with the current contents of the source's map property
- Since:
- 1.6
- Restriction:
- This method is not intended to be referenced by clients.
-
setMap
Description copied from interface:IMapProperty
Updates the property on the source with the specified change.Note: This method is made available to facilitate basic property access. However if the property source lacks property change notification, then observables on the source object may not be notified of the change. In most cases it is preferable to modify the source through an
IObservableMap
than through the property directly.- Specified by:
setMap
in interfaceIMapProperty<S,
K, V> - Parameters:
source
- the property source (may be null)map
- the new map- Since:
- 1.3
-
doSetMap
Updates the property on the source with the specified change.- Parameters:
source
- the property sourcemap
- the new map- Since:
- 1.6
- Restriction:
- This method is not intended to be referenced by clients.
-
updateMap
Description copied from interface:IMapProperty
Updates the property on the source with the specified change.Note: This method is made available to facilitate basic property access. However if the property source lacks property change notification, then observables on the source object may not be notified of the change. In most cases it is preferable to modify the source through an
IObservableMap
than through the property directly.- Specified by:
updateMap
in interfaceIMapProperty<S,
K, V> - Parameters:
source
- the property source (may be null)diff
- a diff describing the change- Since:
- 1.3
-
doUpdateMap
Updates the property on the source with the specified change.- Parameters:
source
- the property sourcediff
- a diff describing the change- Since:
- 1.6
- Restriction:
- This method is not intended to be referenced by clients.
-
observe
Description copied from interface:IMapProperty
Returns an observable map observing this map property on the given property source- Specified by:
observe
in interfaceIMapProperty<S,
K, V> - Parameters:
source
- the property source- Returns:
- an observable map observing this map-typed property on the given property source
-
mapFactory
Description copied from interface:IMapProperty
Returns a factory for creating observable maps tracking this property of a particular property source.- Specified by:
mapFactory
in interfaceIMapProperty<S,
K, V> - Returns:
- a factory for creating observable maps tracking this property of a particular property source.
-
mapFactory
Description copied from interface:IMapProperty
Returns a factory for creating observable maps in the given realm, tracking this property of a particular property source.- Specified by:
mapFactory
in interfaceIMapProperty<S,
K, V> - Parameters:
realm
- the realm- Returns:
- a factory for creating observable maps in the given realm, tracking this property of a particular property source.
-
observeDetail
Description copied from interface:IMapProperty
Returns an observable map on the master observable's realm which tracks this property of the values in the entry set ofmaster
.- Specified by:
observeDetail
in interfaceIMapProperty<S,
K, V> - Parameters:
master
- the master observable- Returns:
- an observable map on the master observable's realm which tracks
this property of the values in the entry set of
master
.
-
values
Description copied from interface:IMapProperty
Returns the nested combination of this property and the specified detail value property. Note that because this property is a projection of value properties over a values collection, the only modifications supported are through theIObservableMap.put(Object, Object)
andMap.putAll(java.util.Map)
methods. In the latter case, this property does not entries for keys not already contained in the master map's key set. Modifications made through the returned property are delegated to the detail property, using the corresponding entry value from the master property as the source.- Specified by:
values
in interfaceIMapProperty<S,
K, V> - Parameters:
detailValues
- the detail property- Returns:
- the nested combination of the master map and detail value properties.
-