Class AdapterMaps
java.lang.Object
org.eclipse.gef.common.adapt.inject.AdapterMaps
-
Method Summary
Modifier and TypeMethodDescriptionstatic MapBinder<AdapterKey<?>,
Object> getAdapterMapBinder
(Binder binder, Class<? extends IAdaptable> adaptableType) Returns aMapBinder
, which can be used to define adapter bindings for anIAdaptable
s of the given type.static MapBinder<AdapterKey<?>,
Object> getAdapterMapBinder
(Binder binder, Class<? extends IAdaptable> adaptableType, AdapterKey<?>... adaptableContext) Returns aMapBinder
, which can be used to define adapter bindings for anIAdaptable
s of the given type, restricting it further to thoseIAdaptable
s that are themselvesadapted
to anotherIAdaptable
with the specified role.
-
Method Details
-
getAdapterMapBinder
public static MapBinder<AdapterKey<?>,Object> getAdapterMapBinder(Binder binder, Class<? extends IAdaptable> adaptableType) Returns aMapBinder
, which can be used to define adapter bindings for anIAdaptable
s of the given type. -
getAdapterMapBinder
public static MapBinder<AdapterKey<?>,Object> getAdapterMapBinder(Binder binder, Class<? extends IAdaptable> adaptableType, AdapterKey<?>... adaptableContext) Returns aMapBinder
, which can be used to define adapter bindings for anIAdaptable
s of the given type, restricting it further to thoseIAdaptable
s that are themselvesadapted
to anotherIAdaptable
with the specified role.- Parameters:
binder
- TheBinder
used to create a newMapBinder
.adaptableType
- The type to be used as type of theAdapterMap
.adaptableContext
- A specification of the context the adaptable, into which adapters are to be injected, has to provide. If specified the injection will be restricted toIAdaptable
s with a compatible context only. The context of an adaptable is compatible when respective context elements are visited in the given order when walking the adaptable-adapter chain, beginning with the adaptable in which to inject. The actual chain may contain additional elements, that do not correspond to context element, in between (which are ignored), but it has to contain the specified context elements in the given order.- Returns:
- A new
MapBinder
used to define adapter map bindings for the given type (and all sub-types).
-