org.eclipse.emf.ecp.core.util
Class ECPUtil

java.lang.Object
  extended by org.eclipse.emf.ecp.core.util.ECPUtil

public final class ECPUtil
extends Object

This class provides common functionality.

Author:
Eike Stepper, Eugen Neufeld

Method Summary
static ECPProperties createProperties()
          This creates an empty ECPProperties.
static Set<org.eclipse.emf.ecore.EPackage> getAllRegisteredEPackages()
          Returns the set of all known EPackages.
static ECPObserverBus getECPObserverBus()
          Helper method to get the instance of the ECPObserverBus.
static ECPProjectManager getECPProjectManager()
          Helper method to get the instance of the ECPProjectManager.
static ECPProviderRegistry getECPProviderRegistry()
          Helper method to get the instance of the ECPProviderRegistry.
static ECPRepositoryManager getECPRepositoryManager()
          Helper method to get the instance of the ECPRepositoryManager.
static ECPContainer getModelContext(ECPModelContextProvider contextProvider, Object... elements)
          Return the common ECPContainer for the provided elements.
static ECPElement getResolvedElement(ECPElement elementOrDescriptor)
          Checks whether the ECPElement is an ElementDescriptor and resolves it when necessary.
static Collection<org.eclipse.emf.ecore.EClass> getSubClasses(org.eclipse.emf.ecore.EClass superClass)
          This method looks through all known EPackages to find all subclasses for the provided super class.
static boolean isClosed(Object object)
          Checks whether an object is an ECPProject and closed.
static boolean isDisposed(Object object)
          Checks whether an object is an ECPDisposable and disposed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getModelContext

public static ECPContainer getModelContext(ECPModelContextProvider contextProvider,
                                           Object... elements)
Return the common ECPContainer for the provided elements.

Parameters:
contextProvider - the ECPModelContextProvider to use
elements - the elements to check
Returns:
the common ECPContainer for the elements or null

createProperties

public static ECPProperties createProperties()
This creates an empty ECPProperties.

Returns:
an empty ECPProperties

isDisposed

public static boolean isDisposed(Object object)
Checks whether an object is an ECPDisposable and disposed.

Parameters:
object - the object to check
Returns:
true if the object is an instance of ECPDisposable and ECPDisposable.isDisposed() returns true, false otherwise

isClosed

public static boolean isClosed(Object object)
Checks whether an object is an ECPProject 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 the ECPElement is an ElementDescriptor and resolves it when necessary.

Parameters:
elementOrDescriptor - the ECPElement to check
Returns:
the resolved Object or the original object if it is not an descriptor

getSubClasses

public static Collection<org.eclipse.emf.ecore.EClass> getSubClasses(org.eclipse.emf.ecore.EClass superClass)
This method looks through all known EPackages to find all subclasses for the provided super class.

Parameters:
superClass - - the class for which to get the subclasses
Returns:
a Collection of EClasses

getAllRegisteredEPackages

public static Set<org.eclipse.emf.ecore.EPackage> getAllRegisteredEPackages()
Returns the set of all known EPackages.

Returns:
the Set of all known Epackages

getECPProjectManager

public static ECPProjectManager getECPProjectManager()
Helper method to get the instance of the ECPProjectManager.

Returns:
the ECPProjectManager

getECPRepositoryManager

public static ECPRepositoryManager getECPRepositoryManager()
Helper method to get the instance of the ECPRepositoryManager.

Returns:
the ECPRepositoryManager

getECPProviderRegistry

public static ECPProviderRegistry getECPProviderRegistry()
Helper method to get the instance of the ECPProviderRegistry.

Returns:
the ECPProviderRegistry

getECPObserverBus

public static ECPObserverBus getECPObserverBus()
Helper method to get the instance of the ECPObserverBus.

Returns:
the ECPObserverBus


Copyright © 2014. All Rights Reserved.