Package org.eclipse.emf.ecp.core.util
Class ECPUtil
- java.lang.Object
-
- org.eclipse.emf.ecp.core.util.ECPUtil
-
public final class ECPUtil extends java.lang.Object
This class provides common functionality.- Author:
- Eike Stepper, Eugen Neufeld
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ECPProperties
createProperties()
This creates an emptyECPProperties
.static java.util.Set<org.eclipse.emf.ecore.EPackage>
getAllRegisteredEPackages()
Returns the set of all knownEPackages
.static ECPObserverBus
getECPObserverBus()
Helper method to get the instance of theECPObserverBus
.static ECPProjectManager
getECPProjectManager()
Helper method to get the instance of theECPProjectManager
.static ECPProviderRegistry
getECPProviderRegistry()
Helper method to get the instance of theECPProviderRegistry
.static ECPRepositoryManager
getECPRepositoryManager()
Helper method to get the instance of theECPRepositoryManager
.static ECPContainer
getModelContext(ECPModelContextProvider contextProvider, java.lang.Object... elements)
Return the commonECPContainer
for the provided elements.static ECPElement
getResolvedElement(ECPElement elementOrDescriptor)
Checks whether theECPElement
is anElementDescriptor
and resolves it when necessary.static java.util.Collection<org.eclipse.emf.ecore.EClass>
getSubClasses(org.eclipse.emf.ecore.EClass superClass)
Deprecated.UseEMFUtils
.getSubClasses insteadstatic boolean
isClosed(java.lang.Object object)
Checks whether an object is anECPProject
and closed.static boolean
isDisposed(java.lang.Object object)
Checks whether an object is anECPDisposable
and disposed.
-
-
-
Method Detail
-
getModelContext
public static ECPContainer getModelContext(ECPModelContextProvider contextProvider, java.lang.Object... elements)
Return the commonECPContainer
for the provided elements.- Parameters:
contextProvider
- theECPModelContextProvider
to useelements
- the elements to check- Returns:
- the common
ECPContainer
for the elements or null
-
createProperties
public static ECPProperties createProperties()
This creates an emptyECPProperties
.- Returns:
- an empty
ECPProperties
-
isDisposed
public static boolean isDisposed(java.lang.Object object)
Checks whether an object is anECPDisposable
and disposed.- Parameters:
object
- the object to check- Returns:
- true if the object is an instance of
ECPDisposable
andECPDisposable.isDisposed()
returns true, false otherwise
-
isClosed
public static boolean isClosed(java.lang.Object object)
Checks whether an object is anECPProject
and closed.- Parameters:
object
- the object to check- Returns:
- true if the object is an instance of
ECPProject
and not open, false otherwise
-
getResolvedElement
public static ECPElement getResolvedElement(ECPElement elementOrDescriptor)
Checks whether theECPElement
is anElementDescriptor
and resolves it when necessary.- Parameters:
elementOrDescriptor
- theECPElement
to check- Returns:
- the resolved Object or the original object if it is not an descriptor
-
getSubClasses
@Deprecated public static java.util.Collection<org.eclipse.emf.ecore.EClass> getSubClasses(org.eclipse.emf.ecore.EClass superClass)
Deprecated.UseEMFUtils
.getSubClasses insteadThis method looks through all knownEPackage
s to find all subclasses for the provided super class.- Parameters:
superClass
- - the class for which to get the subclasses- Returns:
- a
Collection
ofEClasses
-
getAllRegisteredEPackages
public static java.util.Set<org.eclipse.emf.ecore.EPackage> getAllRegisteredEPackages()
Returns the set of all knownEPackages
.- Returns:
- the Set of all known
Epackages
-
getECPProjectManager
public static ECPProjectManager getECPProjectManager()
Helper method to get the instance of theECPProjectManager
.- Returns:
- the
ECPProjectManager
-
getECPRepositoryManager
public static ECPRepositoryManager getECPRepositoryManager()
Helper method to get the instance of theECPRepositoryManager
.- Returns:
- the
ECPRepositoryManager
-
getECPProviderRegistry
public static ECPProviderRegistry getECPProviderRegistry()
Helper method to get the instance of theECPProviderRegistry
.- Returns:
- the
ECPProviderRegistry
-
getECPObserverBus
public static ECPObserverBus getECPObserverBus()
Helper method to get the instance of theECPObserverBus
.- Returns:
- the
ECPObserverBus
-
-