org.eclipse.emf.ecp.spi.core
Interface InternalProvider

All Superinterfaces:
AdapterProvider, Comparable<ECPElement>, ECPDisposable, ECPElement, ECPModelContextProvider, ECPProvider, ECPProviderAware, org.eclipse.core.runtime.IAdaptable, InternalRegistryElement
All Known Implementing Classes:
CDOProvider, DefaultProvider, EMFStoreProvider, WorkspaceProvider

public interface InternalProvider
extends ECPProvider, ECPProviderAware, ECPModelContextProvider, InternalRegistryElement, AdapterProvider

Since:
1.1
Author:
Eike Stepper, Eugen Neufeld

Nested Class Summary
static class InternalProvider.LifecycleEvent
          Possible lifecycle events.
 
Nested classes/interfaces inherited from interface org.eclipse.emf.ecp.spi.core.util.ECPDisposable
ECPDisposable.DisposeListener
 
Field Summary
static org.eclipse.emf.edit.provider.ComposedAdapterFactory EMF_ADAPTER_FACTORY
          ComposedAdapterFactory to use.
 
Fields inherited from interface org.eclipse.emf.ecp.core.ECPProvider
TYPE
 
Method Summary
 void cloneProject(InternalProject projectToClone, InternalProject targetProject)
          This method clones a project.
 boolean contains(InternalProject project, Object object)
          Checks whether a specific project contains a specific object.
 org.eclipse.emf.edit.domain.EditingDomain createEditingDomain(InternalProject project)
          This method creates an editing domain each time it is called.
 void delete(InternalProject project, Collection<Object> objects)
          Deletes a collection of EObjects from the model.
 void doSave(InternalProject project)
          This method manually triggers the save of the model data.
 void fillChildren(ECPContainer context, Object parent, InternalChildrenList childrenList)
          Fills the elements of a certain parent object, depending on the context into the childrenList.
 org.eclipse.emf.common.util.EList<? extends Object> getElements(InternalProject project)
          This method returns an EList of the root elements.
 Iterator<org.eclipse.emf.ecore.EObject> getLinkElements(InternalProject project, org.eclipse.emf.ecore.EObject modelElement, org.eclipse.emf.ecore.EReference eReference)
          Return all EObjects that this provider supports for linking them to the modelElement and the provided eReference.
 Set<InternalProject> getOpenProjects()
          Array of all ECPProjects based on this ECPProvider which are open.
 org.eclipse.emf.common.notify.Notifier getRoot(InternalProject project)
          Method checking whether an object is the root of the model container.
 AdapterProvider getUIProvider()
          Allows access of the corresponding UI Adapter.
 Set<org.eclipse.emf.ecore.EPackage> getUnsupportedEPackages(Collection<org.eclipse.emf.ecore.EPackage> ePackages, InternalRepository repository)
          EPackages that are not supported by this provider.
 void handleLifecycle(ECPContainer context, InternalProvider.LifecycleEvent event)
          This method is called to handle a specific life cycle.
 boolean isDirty(InternalProject project)
          This method checks, whether the model is in a dirty state.
 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.
 boolean modelExists(InternalProject project)
          Checks whether the data of the project still exists, method is called on startup.
 void setUIProvider(AdapterProvider uiProvider)
          Allows to set the uiProvider.
 
Methods inherited from interface org.eclipse.emf.ecp.core.ECPProvider
getLabel, hasCreateProjectWithoutRepositorySupport, hasCreateRepositorySupport
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.emf.ecp.core.util.ECPProviderAware
getProvider
 
Methods inherited from interface org.eclipse.emf.ecp.core.util.ECPModelContextProvider
getModelContext
 
Methods inherited from interface org.eclipse.emf.ecp.spi.core.util.InternalRegistryElement
getDescription, getLabel, setDescription, setLabel
 
Methods inherited from interface org.eclipse.emf.ecp.core.util.ECPElement
getName
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.eclipse.emf.ecp.spi.core.util.ECPDisposable
addDisposeListener, dispose, isDisposed, removeDisposeListener
 
Methods inherited from interface org.eclipse.emf.ecp.spi.core.util.AdapterProvider
getAdapter
 

Field Detail

EMF_ADAPTER_FACTORY

static final org.eclipse.emf.edit.provider.ComposedAdapterFactory EMF_ADAPTER_FACTORY
ComposedAdapterFactory to use.

Method Detail

getUIProvider

AdapterProvider getUIProvider()
Allows access of the corresponding UI Adapter.

Returns:
the UIProvider for this provider

setUIProvider

void setUIProvider(AdapterProvider uiProvider)
Allows to set the uiProvider.

Parameters:
uiProvider - the uiProvider to set

createEditingDomain

org.eclipse.emf.edit.domain.EditingDomain createEditingDomain(InternalProject project)
This method creates an editing domain each time it is called.

Parameters:
project - the InternalProject to create the domain for.
Returns:
the created EditingDomain

isSlow

boolean isSlow(Object parent)
Whether this provider is slow or not. Slow objects are handled differently.

Parameters:
parent - to check
Returns:
true if slow, false otherwise

isThreadSafe

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

fillChildren

void fillChildren(ECPContainer context,
                  Object parent,
                  InternalChildrenList childrenList)
Fills the elements of a certain parent object, depending on the context into the childrenList.

Parameters:
context - the context to use
parent - the parent to read the children from
childrenList - the list to fill

handleLifecycle

void handleLifecycle(ECPContainer context,
                     InternalProvider.LifecycleEvent event)
This method is called to handle a specific life cycle.

Parameters:
context - the context to handle the lifecycle for
event - the lifecycle event to handle

getElements

org.eclipse.emf.common.util.EList<? extends 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

getUnsupportedEPackages

Set<org.eclipse.emf.ecore.EPackage> getUnsupportedEPackages(Collection<org.eclipse.emf.ecore.EPackage> ePackages,
                                                            InternalRepository repository)
EPackages that are not supported by this provider.

Parameters:
ePackages - packages to filter from
repository - the repository to check
Returns:
a Collection of EPackages that are not supported

getLinkElements

Iterator<org.eclipse.emf.ecore.EObject> getLinkElements(InternalProject project,
                                                        org.eclipse.emf.ecore.EObject modelElement,
                                                        org.eclipse.emf.ecore.EReference eReference)
Return all EObjects that this provider supports for linking them to the modelElement and the provided eReference.

Parameters:
project - - the project the call is from
modelElement - - EObject to add the EReference to
eReference - - the EReference to add
Returns:
Iterator of EObject that can be linked

doSave

void doSave(InternalProject project)
This method manually triggers the save of the model data.

Parameters:
project - the project to save the model data for

isDirty

boolean isDirty(InternalProject project)
This method checks, whether the model is in a dirty state.

Parameters:
project - the project to check the dirty state for
Returns:
true if model is dirty, false otherwise

delete

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

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

modelExists

boolean modelExists(InternalProject project)
Checks whether the data of the project still exists, method is called on startup. DefaultProvider implements this by returning true, adopt if needed.

Parameters:
project - InternalProject to check
Returns:
true if data exists, false otherwise

getRoot

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

getOpenProjects

Set<InternalProject> getOpenProjects()
Array of all ECPProjects based on this ECPProvider which are open.

Returns:
open projects using this ECPProvider

contains

boolean contains(InternalProject project,
                 Object object)
Checks whether a specific project contains a specific object.

Parameters:
project - the project to check
object - the object to check
Returns:
true if the project contains such an object, false otherwise


Copyright © 2015. All Rights Reserved.