org.eclipse.emf.ecp.cdo.internal.core
Class CDOProvider

java.lang.Object
  extended by org.eclipse.emf.ecp.internal.core.util.Element
      extended by org.eclipse.emf.ecp.spi.core.DefaultProvider
          extended by org.eclipse.emf.ecp.cdo.internal.core.CDOProvider
All Implemented Interfaces:
Comparable<ECPElement>, org.eclipse.core.runtime.IAdaptable, ECPProvider, ECPElement, ECPModelContextProvider, ECPProviderAware, InternalProvider, AdapterProvider, ECPDisposable, InternalRegistryElement

public class CDOProvider
extends DefaultProvider

Author:
Eike Stepper

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.emf.ecp.spi.core.InternalProvider
InternalProvider.LifecycleEvent
 
Nested classes/interfaces inherited from interface org.eclipse.emf.ecp.spi.core.util.ECPDisposable
ECPDisposable.DisposeListener
 
Field Summary
static String NAME
          The unique provider name.
static String PROP_BRANCH_PATH
          The key for the branch path ECP project property.
static String PROP_CONNECTOR_DESCRIPTION
          The key for the connector description ECP project property.
static String PROP_CONNECTOR_TYPE
          The key for the connector type ECP project property.
static String PROP_REPOSITORY_NAME
          The key for the repository name ECP project property.
static String PROP_TIME_STAMP
          The key for the time stamp ECP project property.
static String PROP_WORKSPACE_ID
          The key for the workspace ID ECP project property.
 
Fields inherited from interface org.eclipse.emf.ecp.spi.core.InternalProvider
EMF_ADAPTER_FACTORY
 
Fields inherited from interface org.eclipse.emf.ecp.core.ECPProvider
TYPE
 
Constructor Summary
CDOProvider()
          Default constructor.
 
Method Summary
 void cloneProject(InternalProject projectToClone, InternalProject targetProject)
          This method clones a project.
 void delete(InternalProject project, Collection<Object> objects)
          Deletes a collection of EObjects from the model.
 void fillChildren(ECPContainer context, Object parent, InternalChildrenList childrenList)
          Fills the elements of a certain parent object, depending on the context into the childrenList.
<T> T
getAdapter(Object adaptable, Class<T> adapterType)
          
 org.eclipse.emf.common.util.EList<Object> getElements(InternalProject project)
          This method returns an EList of the root elements.
static CDOProvider getInstance()
          Deprecated. use ECPUtil.getECPProviderRegistry().getProvider(CDOProvider.NAME) instead
 ECPContainer getModelContext(Object element)
          Returns the first ECPContainer that can be found for the provided Object.
static CDOProjectData getProjectData(InternalProject project)
          Get CDOProjectData for the given internal project.
static File getProjectFolder(InternalProject project)
          Get the folder for the configuration data of the internal project.
static CDORepositoryData getRepositoryData(InternalRepository repository)
          Retrieve CDORepositoryData for a given InternalRepository.
 org.eclipse.emf.common.notify.Notifier getRoot(InternalProject project)
          Method checking whether an object is the root of the model container.
 void handleLifecycle(ECPContainer context, InternalProvider.LifecycleEvent event)
          This method is called to handle a specific life cycle.
 boolean isSlow(Object parent)
          Whether this provider is slow or not.
 boolean isThreadSafe()
          Whether it is safe to modify the EList of model elements ot this provider.
 
Methods inherited from class org.eclipse.emf.ecp.spi.core.DefaultProvider
addDisposeListener, contains, createEditingDomain, dispose, doSave, getAdapter, getDescription, getLabel, getLinkElements, getOpenProjects, getProvider, getType, getUIProvider, getUnsupportedEPackages, hasCreateProjectWithoutRepositorySupport, hasCreateRepositorySupport, isDirty, isDisposed, modelExists, removeDisposeListener, setDescription, setLabel, setUIProvider
 
Methods inherited from class org.eclipse.emf.ecp.internal.core.util.Element
compareTo, equals, getName, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.emf.ecp.core.util.ECPElement
getName
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

NAME

public static final String NAME
The unique provider name.

See Also:
Constant Field Values

PROP_CONNECTOR_TYPE

public static final String PROP_CONNECTOR_TYPE
The key for the connector type ECP project property.

See Also:
Constant Field Values

PROP_CONNECTOR_DESCRIPTION

public static final String PROP_CONNECTOR_DESCRIPTION
The key for the connector description ECP project property.

See Also:
Constant Field Values

PROP_REPOSITORY_NAME

public static final String PROP_REPOSITORY_NAME
The key for the repository name ECP project property.

See Also:
Constant Field Values

PROP_BRANCH_PATH

public static final String PROP_BRANCH_PATH
The key for the branch path ECP project property.

See Also:
Constant Field Values

PROP_TIME_STAMP

public static final String PROP_TIME_STAMP
The key for the time stamp ECP project property.

See Also:
Constant Field Values

PROP_WORKSPACE_ID

public static final String PROP_WORKSPACE_ID
The key for the workspace ID ECP project property.

See Also:
Constant Field Values
Constructor Detail

CDOProvider

public CDOProvider()
Default constructor.

Method Detail

getInstance

@Deprecated
public static CDOProvider getInstance()
Deprecated. use ECPUtil.getECPProviderRegistry().getProvider(CDOProvider.NAME) instead

Get the CDO Provider singleton.

Returns:
the singleton instance or null

getAdapter

public <T> T getAdapter(Object adaptable,
                        Class<T> adapterType)
Description copied from class: DefaultProvider

Specified by:
getAdapter in interface AdapterProvider
Overrides:
getAdapter in class DefaultProvider

isSlow

public boolean isSlow(Object parent)
Description copied from class: DefaultProvider
Whether this provider is slow or not. Slow objects are handled differently.

Specified by:
isSlow in interface InternalProvider
Overrides:
isSlow in class DefaultProvider
Parameters:
parent - to check
Returns:
true if slow, false otherwise

fillChildren

public void fillChildren(ECPContainer context,
                         Object parent,
                         InternalChildrenList childrenList)
Description copied from class: DefaultProvider
Fills the elements of a certain parent object, depending on the context into the childrenList.

Specified by:
fillChildren in interface InternalProvider
Overrides:
fillChildren in class DefaultProvider
Parameters:
context - the context to use
parent - the parent to read the children from
childrenList - the list to fill

getElements

public org.eclipse.emf.common.util.EList<Object> getElements(InternalProject project)
This method returns an EList of the root elements.

Parameters:
project - the project to get the root elements for
Returns:
list of root elements of this project

handleLifecycle

public void handleLifecycle(ECPContainer context,
                            InternalProvider.LifecycleEvent event)
Description copied from class: DefaultProvider
This method is called to handle a specific life cycle.

Specified by:
handleLifecycle in interface InternalProvider
Overrides:
handleLifecycle in class DefaultProvider
Parameters:
context - the context to handle the lifecycle for
event - the lifecycle event to handle

getModelContext

public ECPContainer getModelContext(Object element)
Returns the first ECPContainer that can be found for the provided Object.

Specified by:
getModelContext in interface ECPModelContextProvider
Overrides:
getModelContext in class DefaultProvider
Parameters:
element - the element to search the ECPContainer for
Returns:
the ECPContainer of this element

getRepositoryData

public static CDORepositoryData getRepositoryData(InternalRepository repository)
Retrieve CDORepositoryData for a given InternalRepository.

Parameters:
repository - the internal repositorz
Returns:
the CDORepositoryData

getProjectData

public static CDOProjectData getProjectData(InternalProject project)
Get CDOProjectData for the given internal project.

Parameters:
project - the internal project
Returns:
the CDOProjectData

getProjectFolder

public static File getProjectFolder(InternalProject project)
Get the folder for the configuration data of the internal project.

Parameters:
project - the internal project.
Returns:
the File

delete

public void delete(InternalProject project,
                   Collection<Object> objects)
Deletes a collection of EObjects from the model.

Parameters:
project - the project from where to delete
objects - the Collection if Objects to delete

cloneProject

public void cloneProject(InternalProject projectToClone,
                         InternalProject targetProject)
This method clones a project.

Parameters:
projectToClone - the project to be cloned
targetProject - the project to add the cloned data to

getRoot

public org.eclipse.emf.common.notify.Notifier getRoot(InternalProject project)
Method checking whether an object is the root of the model container.

Parameters:
project - to check the root container for
Returns:
a Notifier that is the model root of this project

isThreadSafe

public boolean isThreadSafe()
Whether it is safe to modify the EList of model elements ot this provider.

Returns:
true, if the provider is thread-safe, false otherwise
See Also:
InternalProvider.isThreadSafe()


Copyright © 2015. All Rights Reserved.