Package | Description |
---|---|
org.eclipse.gef4.common.adapt |
This package provides abstractions and implementations related to an enhanced
adaptable-pattern.
|
org.eclipse.gef4.common.inject |
This package provides support for Google Guice-based injection of adapters.
|
Modifier and Type | Method and Description |
---|---|
static <T> AdapterKey<T> |
AdapterKey.get(java.lang.Class<T> key)
Creates a new
AdapterKey for the given key and the
DEFAULT_ROLE role. |
static <T> AdapterKey<T> |
AdapterKey.get(java.lang.Class<T> key,
java.lang.String role)
Creates a new
AdapterKey for the given key and role. |
static <T> AdapterKey<T> |
AdapterKey.get(com.google.common.reflect.TypeToken<T> key)
Creates a new
AdapterKey for the given key and the
DEFAULT_ROLE role. |
static <T> AdapterKey<T> |
AdapterKey.get(com.google.common.reflect.TypeToken<T> key,
java.lang.String role)
Creates a new
AdapterKey for the given key and role. |
Modifier and Type | Method and Description |
---|---|
java.util.Map<AdapterKey<?>,java.lang.Object> |
AdaptableSupport.getAdapters()
Retrieves all registered adapters, mapped to the respective
AdapterKey s they are registered. |
<T> java.util.Map<AdapterKey<? extends T>,T> |
AdaptableSupport.getAdapters(java.lang.Class<? super T> key)
Returns all adapters 'matching' the given
Class key, i.e. all
adapters whose AdapterKey 's TypeToken key
getKey() ) refers to the same or a sub-type of the
given Class key (see TypeToken.isAssignableFrom(Type) ). |
<T> java.util.Map<AdapterKey<? extends T>,T> |
AdapterStore.getAdapters(java.lang.Class<? super T> key) |
<T> java.util.Map<AdapterKey<? extends T>,T> |
IAdaptable.getAdapters(java.lang.Class<? super T> key)
Returns all adapters 'matching' the given
Class key, i.e. all
adapters whose AdapterKey 's TypeToken key
getKey() ) refers to the same or a sub-type of the
given Class key (see TypeToken.isAssignableFrom(Type) ). |
<T> java.util.Map<AdapterKey<? extends T>,T> |
AdaptableSupport.getAdapters(com.google.common.reflect.TypeToken<? super T> key)
Returns all adapters 'matching' the given
TypeToken key, i.e. all
adapters whose AdapterKey 's TypeToken key
getKey() ) refers to the same or a sub-type or of the
given TypeToken key (see
TypeToken.isAssignableFrom(TypeToken) ). |
<T> java.util.Map<AdapterKey<? extends T>,T> |
AdapterStore.getAdapters(com.google.common.reflect.TypeToken<? super T> key) |
<T> java.util.Map<AdapterKey<? extends T>,T> |
IAdaptable.getAdapters(com.google.common.reflect.TypeToken<? super T> key)
Returns all adapters 'matching' the given
TypeToken key, i.e. all
adapters whose AdapterKey 's TypeToken key
getKey() ) refers to the same or a sub-type or of the
given TypeToken key (see
TypeToken.isAssignableFrom(TypeToken) ). |
Modifier and Type | Method and Description |
---|---|
<T> T |
AdaptableSupport.getAdapter(AdapterKey<? super T> key)
Returns an adapter for the given
AdapterKey if one can
unambiguously be retrieved, i.e. if there is only a single adapter
registered under a key that 'matches' the given AdapterKey . |
<T> T |
AdapterStore.getAdapter(AdapterKey<? super T> key) |
<T> T |
IAdaptable.getAdapter(AdapterKey<? super T> key)
Returns an adapter for the given
AdapterKey if one can
unambiguously be retrieved, i.e. if there is only a single adapter that
'matches' the given AdapterKey . |
<T> void |
AdaptableSupport.setAdapter(AdapterKey<? super T> key,
T adapter)
Registers the given adapter under the given
AdapterKey . |
<T> void |
AdapterStore.setAdapter(AdapterKey<? super T> key,
T adapter) |
<T> void |
IAdaptable.setAdapter(AdapterKey<? super T> key,
T adapter)
Registers the given adapter under the given
AdapterKey . |
<T> T |
AdaptableSupport.unsetAdapter(AdapterKey<? super T> key)
Unregisters the adapter registered under the exact
AdapterKey
given, returning it for convenience. |
<T> T |
AdapterStore.unsetAdapter(AdapterKey<? super T> key) |
<T> T |
IAdaptable.unsetAdapter(AdapterKey<? super T> key)
Unregisters the adapter registered under the exact
AdapterKey
given, returning it for convenience. |
Modifier and Type | Method and Description |
---|---|
void |
AdaptableSupport.setAdapters(java.util.Map<AdapterKey<?>,java.lang.Object> adaptersWithKeys,
boolean overwrite)
Registers the given adapters under the provided keys by delegating to
AdaptableSupport.setAdapter(AdapterKey, Object) . |
Modifier and Type | Method and Description |
---|---|
static com.google.inject.multibindings.MapBinder<AdapterKey<?>,java.lang.Object> |
AdapterMaps.getAdapterMapBinder(com.google.inject.Binder binder,
java.lang.Class<? extends IAdaptable> type)
Returns a
MapBinder , which is bound to an AdapterMap
annotation of the given type. |
Copyright (c) 2014 itemis AG and others. All rights reserved.