Eclipse Platform
Release 3.6

org.eclipse.core.databinding.property.map
Class SimpleMapProperty

java.lang.Object
  extended by org.eclipse.core.databinding.property.map.MapProperty
      extended by org.eclipse.core.databinding.property.map.SimpleMapProperty
All Implemented Interfaces:
IProperty, IMapProperty

public abstract class SimpleMapProperty
extends MapProperty

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:

In addition, we recommended overriding Object.toString() to return a description suitable for debugging purposes.

Since:
1.2

Constructor Summary
SimpleMapProperty()
           
 
Method Summary
abstract  INativePropertyListener adaptListener(ISimplePropertyListener 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  Map doGetMap(Object source)
          Returns a Map with the current contents of the source's map property
protected  void doSetMap(Object source, Map map)
          Updates the property on the source with the specified change.
protected abstract  void doSetMap(Object source, Map map, MapDiff diff)
          Updates the property on the source with the specified change.
protected  void doUpdateMap(Object source, MapDiff diff)
          Updates the property on the source with the specified change.
 IObservableMap observe(Realm realm, Object source)
          Returns an observable map observing this map property on the given property source
 void setMap(Object source, Map map, MapDiff diff)
          Updates 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, 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.map.IMapProperty
getKeyType, getValueType
 

Constructor Detail

SimpleMapProperty

public SimpleMapProperty()
Method Detail

observe

public IObservableMap observe(Realm realm,
                              Object source)
Description copied from interface: IMapProperty
Returns an observable map observing this map property on the given property source

Parameters:
realm - the observable's realm
source - the property source
Returns:
an observable map observing this map-typed property on the given property source

doGetMap

protected abstract Map doGetMap(Object source)
Description copied from class: MapProperty
Returns a Map with the current contents of the source's map property

Overrides:
doGetMap in class MapProperty
Parameters:
source - the property source
Returns:
a Map with the current contents of the source's map property

setMap

public final void setMap(Object source,
                         Map map,
                         MapDiff diff)
Updates the property on the source with the specified change.

Parameters:
source - the property source
map - the new map
diff - a diff describing the change
Restriction:
This method is not intended to be referenced by clients.

doSetMap

protected abstract void doSetMap(Object source,
                                 Map map,
                                 MapDiff diff)
Updates the property on the source with the specified change.

Parameters:
source - the property source
map - the new map
diff - a diff describing the change
Restriction:
This method is not intended to be referenced by clients.

doSetMap

protected void doSetMap(Object source,
                        Map map)
Description copied from class: MapProperty
Updates the property on the source with the specified change.

Overrides:
doSetMap in class MapProperty
Parameters:
source - the property source
map - the new map

doUpdateMap

protected void doUpdateMap(Object source,
                           MapDiff diff)
Description copied from class: MapProperty
Updates the property on the source with the specified change.

Overrides:
doUpdateMap in class MapProperty
Parameters:
source - the property source
diff - a diff describing the change

adaptListener

public abstract INativePropertyListener adaptListener(ISimplePropertyListener 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.

Eclipse Platform
Release 3.6

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.