public class Adapters extends Object
IAdaptable
,
IAdapterManager
Constructor and Description |
---|
Adapters() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
adapt(Object sourceObject,
Class<T> adapter)
If it is possible to adapt the given object to the given type, this
returns the adapter.
|
static <T> T |
adapt(Object sourceObject,
Class<T> adapter,
boolean allowActivation)
If it is possible to adapt the given object to the given type, this
returns the adapter.
|
public static <T> T adapt(Object sourceObject, Class<T> adapter, boolean allowActivation)
sourceObject
if it is an instance of the
adapter type.sourceObject
- object to adapt, can be nulladapter
- type to adapt toallowActivation
- if true, plug-ins may be activated if necessary to provide the requested adapter.
if false, the method will return null if an adapter cannot be provided from activated plug-ins.public static <T> T adapt(Object sourceObject, Class<T> adapter)
Convenience method for calling adapt(Object, Class, true)
.
sourceObject
- object to adapt, can be nulladapter
- type to adapt to
Copyright (c) 2000, 2016 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.