Class SimpleMapProperty<S,K,V>
java.lang.Object
org.eclipse.core.databinding.property.map.MapProperty<S,K,V>
org.eclipse.core.databinding.property.map.SimpleMapProperty<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>
Simplified abstract implementation of IMapProperty. This class takes care of
most of the functional requirements for an IMapProperty implementation,
leaving only the property-specific details to subclasses.
Subclasses must implement these methods:
-
IMapProperty.getKeyType() -
IMapProperty.getValueType() -
doGetMap(Object) -
doSetMap(Object, Map, MapDiff) -
adaptListener(ISimplePropertyListener)
In addition, we recommended overriding Object.toString() to return a
description suitable for debugging purposes.
- Since:
- 1.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract INativePropertyListener<S> adaptListener(ISimplePropertyListener<S, MapDiff<K, V>> 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.Returns a Map with the current contents of the source's map propertyprotected voidUpdates the property on the source with the specified change.protected abstract voidUpdates the property on the source with the specified change.protected voiddoUpdateMap(S source, MapDiff<K, V> diff) Updates the property on the source with the specified change.Returns an observable map observing this map property on the given property sourcefinal voidUpdates the property on the source with the specified change.Methods inherited from class org.eclipse.core.databinding.property.map.MapProperty
getMap, mapFactory, mapFactory, observe, observeDetail, setMap, updateMap, valuesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.core.databinding.property.map.IMapProperty
getKeyType, getValueType
-
Constructor Details
-
SimpleMapProperty
public SimpleMapProperty()
-
-
Method Details
-
observe
Description copied from interface:IMapPropertyReturns an observable map observing this map property on the given property source- Parameters:
realm- the observable's realmsource- the property source- Returns:
- an observable map observing this map-typed property on the given property source
-
doGetMap
Description copied from class:MapPropertyReturns a Map with the current contents of the source's map property- Overrides:
doGetMapin classMapProperty<S,K, V> - Parameters:
source- the property source- Returns:
- a Map with the current contents of the source's map property
-
setMap
Updates the property on the source with the specified change.- Parameters:
source- the property sourcemap- the new mapdiff- a diff describing the change- Since:
- 1.6
- Restriction:
- This method is not intended to be referenced by clients.
-
doSetMap
Updates the property on the source with the specified change.- Parameters:
source- the property sourcemap- the new mapdiff- a diff describing the change- Restriction:
- This method is not intended to be referenced by clients.
-
doSetMap
Description copied from class:MapPropertyUpdates the property on the source with the specified change.- Overrides:
doSetMapin classMapProperty<S,K, V> - Parameters:
source- the property sourcemap- the new map
-
doUpdateMap
Description copied from class:MapPropertyUpdates the property on the source with the specified change.- Overrides:
doUpdateMapin classMapProperty<S,K, V> - Parameters:
source- the property sourcediff- a diff describing the change
-
adaptListener
public abstract INativePropertyListener<S> adaptListener(ISimplePropertyListener<S, MapDiff<K, V>> 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.
- Since:
- 1.5
- Restriction:
- This method is not intended to be referenced by clients.
-