public class WorkspaceProvider extends DefaultProvider
InternalProvider.LifecycleEvent
ECPDisposable.DisposeListener
Modifier and Type | Field and Description |
---|---|
static String |
NAME
The Provider Name.
|
static String |
PROP_ROOT_URI
Root URI Property Name.
|
static String |
VIRTUAL_ROOT_URI
Constant which is used to indicated the the
root uri is not existing yet. |
EMF_ADAPTER_FACTORY
TYPE
Constructor and Description |
---|
WorkspaceProvider()
Instantiates a new workspace provider.
|
Modifier and Type | Method and Description |
---|---|
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 |
doDelete(InternalProject project,
Collection<Object> objects)
Executes the delete opertation.
|
protected void |
doDispose()
This method is called when a provider is disposed.
|
void |
doSave(InternalProject project)
Convenient implementation where nothing happens.
|
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. |
ECPContainer |
getModelContext(Object element)
Returns the first
ECPContainer that can be found for the provided Object. |
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 |
hasCreateProjectWithoutRepositorySupport()
Convenient implementation that return false.
|
boolean |
hasCreateRepositorySupport()
Check whether a new repository can be added to this ECPProvider.
|
boolean |
isDirty(InternalProject project)
Convenient implementation where the provider saves changes of the project automatically, so a project never gets
dirty.
|
boolean |
isThreadSafe()
Whether it is safe to modify the
EList of model elements
ot this provider. |
void |
reload(InternalProject project)
Reloads the project.
|
addDisposeListener, createCommandStack, delete, dispose, getAdapter, getAdapter, getDescription, getLabel, getLinkElements, getModelContextFromAdapter, getOpenProjects, getProvider, getType, getUIProvider, getUnsupportedEPackages, isDisposed, isSlow, modelExists, notifyProviderChangeListeners, registerChangeListener, removeDisposeListener, setDescription, setLabel, setUIProvider, unregisterChangeListener
compareTo, equals, getName, hashCode, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getName
compareTo
public static final String NAME
public static final String PROP_ROOT_URI
public static final String VIRTUAL_ROOT_URI
root uri
is not existing yet.public WorkspaceProvider()
public void handleLifecycle(ECPContainer context, InternalProvider.LifecycleEvent event)
handleLifecycle
in interface InternalProvider
handleLifecycle
in class DefaultProvider
context
- the context to handle the lifecycle forevent
- the lifecycle event to handleprotected void doDispose()
DefaultProvider
doDispose
in class DefaultProvider
public boolean hasCreateRepositorySupport()
DefaultProvider
hasCreateRepositorySupport
in interface ECPProvider
hasCreateRepositorySupport
in class DefaultProvider
public void fillChildren(ECPContainer context, Object parent, InternalChildrenList childrenList)
DefaultProvider
fillChildren
in interface InternalProvider
fillChildren
in class DefaultProvider
context
- the context to useparent
- the parent to read the children fromchildrenList
- the list to fillpublic org.eclipse.emf.common.util.EList<? extends Object> getElements(InternalProject project)
EList
of the root elements.project
- the project to get the root elements forpublic boolean contains(InternalProject project, Object object)
DefaultProvider
contains
in interface InternalProvider
contains
in class DefaultProvider
project
- the project to checkobject
- the object to checkpublic void reload(InternalProject project)
project
- the project to be reloaded.public void cloneProject(InternalProject projectToClone, InternalProject targetProject)
projectToClone
- the project to be clonedtargetProject
- the project to add the cloned data topublic org.eclipse.emf.common.notify.Notifier getRoot(InternalProject project)
project
- to check the root container forNotifier
that is the model root of this projectpublic void doSave(InternalProject project)
DefaultProvider
doSave
in interface InternalProvider
doSave
in class DefaultProvider
project
- the project to savepublic boolean isDirty(InternalProject project)
DefaultProvider
isDirty
in interface InternalProvider
isDirty
in class DefaultProvider
project
- the project to checkpublic org.eclipse.emf.edit.domain.EditingDomain createEditingDomain(InternalProject project)
DefaultProvider
createEditingDomain
in interface InternalProvider
createEditingDomain
in class DefaultProvider
project
- the InternalProject
to create the domain for.EditingDomain
public ECPContainer getModelContext(Object element)
DefaultProvider
ECPContainer
that can be found for the provided Object.getModelContext
in interface ECPModelContextProvider
getModelContext
in class DefaultProvider
element
- the element to search the ECPContainer
forECPContainer
of this elementpublic boolean hasCreateProjectWithoutRepositorySupport()
DefaultProvider
hasCreateProjectWithoutRepositorySupport
in interface ECPProvider
hasCreateProjectWithoutRepositorySupport
in class DefaultProvider
public boolean isThreadSafe()
EList
of model elements
ot this provider.InternalProvider.isThreadSafe()
public void doDelete(InternalProject project, Collection<Object> objects)
doDelete
in class DefaultProvider
project
- the project from where to deleteobjects
- the Collection
if Objects
to deleteDefaultProvider.doDelete(org.eclipse.emf.ecp.spi.core.InternalProject,
java.util.Collection)
Copyright © 2017. All rights reserved.