EMF Compare
3.2.0.201505261421
- java.lang.Object
-
- org.eclipse.emf.compare.ide.ui.internal.util.PlatformElementUtil
-
public class PlatformElementUtil
extends Object
This provides access to commonly used functions for platform elements, such as adaptation or file lookup.
-
-
Method Summary
Methods
Modifier and Type |
Method and Description |
static <T> T |
adaptAs(Object object,
Class<T> clazz)
Tries and adapt the given object to an instance of the given class.
|
static IFile |
findFile(ITypedElement element)
Try and determine the resource of the given element.
|
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
adaptAs
public static <T> T adaptAs(Object object,
Class<T> clazz)
Tries and adapt the given object to an instance of the given class.
- Type Parameters:
T
- Type to which we need to adapt object.- Parameters:
object
- The object we need to coerce to a given Class
.clazz
- Class to which we are to adapt object.
- Returns:
- object cast to type T if possible,
null
if not.
EMF Compare
3.2.0.201505261421
Copyright (c) 2006, 2014 Obeo and others. All rights reserved.