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

All Superinterfaces:
Cloneable, Comparable<ECPElement>, ECPContainer, ECPElement, ECPProject, ECPProjectAware, ECPPropertiesAware, ECPProviderAware, ECPRepositoryAware, org.eclipse.emf.edit.domain.IEditingDomainProvider, PropertiesStore.StorableElement
All Known Implementing Classes:
ECPProjectImpl

public interface InternalProject
extends ECPProject, ECPProjectAware, PropertiesStore.StorableElement, Cloneable

Since:
1.1
Author:
Eike Stepper, Eugen Neufeld

Field Summary
 
Fields inherited from interface org.eclipse.emf.ecp.core.ECPProject
TYPE
 
Method Summary
 InternalProject clone(String name)
          This method clones a project.
 boolean contains(Object object)
          Check whether a project contains an Object.
 InternalProvider getProvider()
          This method returns the provider of this project.
 Object getProviderSpecificData()
          This method returns the provider specific data of this project.
 Iterator<org.eclipse.emf.ecore.EObject> getReferenceCandidates(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference eReference)
          Get all possible EObjects from the provider to which a reference can be added from a certain EObject based on the type of the EReference.
 InternalRepository getRepository()
          This method returns the repository this project is shared on.
 Set<org.eclipse.emf.ecore.EPackage> getUnsupportedEPackages()
          Returns a collection of EPackages which are not supported by the provider.
 Set<org.eclipse.emf.ecore.EClass> getVisibleEClasses()
          Get the currently visible EClasses.
 Set<org.eclipse.emf.ecore.EPackage> getVisiblePackages()
          Get the currently visible EPackages.
 boolean isModelRoot(Object object)
          This method checks whether the provided object is the model root of the project.
 void notifyObjectsChanged(Collection<Object> objects, boolean structural)
          This method is a callback for the provider to notify the project about changes.
 void notifyProvider(InternalProvider.LifecycleEvent event)
          This method is used to notify the provider about a InternalProvider.LifecycleEvent of this project.
 void saveProperties()
          Deprecated. As of 1.1 properties are saved automatically when they're changed.
 void setProviderSpecificData(Object data)
          This method sets the provider specific data of this project.
 void setVisibleEClasses(Set<org.eclipse.emf.ecore.EClass> visibleEClasses)
          Set the visible EClasses.
 void setVisiblePackages(Set<org.eclipse.emf.ecore.EPackage> visiblePackages)
          Set the visible EPackages.
 void undispose(InternalRepository repository)
          This method undisposes the project based on a repository.
 
Methods inherited from interface org.eclipse.emf.ecp.core.ECPProject
close, deleteElements, getContents, hasDirtyContents, isOpen, open, saveContents
 
Methods inherited from interface org.eclipse.emf.ecp.core.util.ECPContainer
canDelete, delete
 
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.core.util.ECPPropertiesAware
getProperties
 
Methods inherited from interface org.eclipse.emf.edit.domain.IEditingDomainProvider
getEditingDomain
 
Methods inherited from interface org.eclipse.emf.ecp.core.util.ECPProjectAware
getProject
 
Methods inherited from interface org.eclipse.emf.ecp.internal.core.util.PropertiesStore.StorableElement
isStorable, write
 

Method Detail

getRepository

InternalRepository getRepository()
This method returns the repository this project is shared on.

Specified by:
getRepository in interface ECPRepositoryAware
Returns:
the repository of this project or null if not shared

getProvider

InternalProvider getProvider()
This method returns the provider of this project.

Specified by:
getProvider in interface ECPProviderAware
Returns:
the provider of this project

getProviderSpecificData

Object getProviderSpecificData()
This method returns the provider specific data of this project.

Returns:
the provider specific data of this project

setProviderSpecificData

void setProviderSpecificData(Object data)
This method sets the provider specific data of this project.

Parameters:
data - the provider specific data of this project

notifyObjectsChanged

void notifyObjectsChanged(Collection<Object> objects,
                          boolean structural)
This method is a callback for the provider to notify the project about changes.

Parameters:
objects - the objects that have changed
structural - if the changes where structural (e.g. delete)

undispose

void undispose(InternalRepository repository)
This method undisposes the project based on a repository.

Parameters:
repository - the repository

notifyProvider

void notifyProvider(InternalProvider.LifecycleEvent event)
This method is used to notify the provider about a InternalProvider.LifecycleEvent of this project.

Parameters:
event - to pass to the provider

clone

InternalProject clone(String name)
This method clones a project.

Parameters:
name - the name of the project to create
Returns:
the cloned project

saveProperties

@Deprecated
void saveProperties()
Deprecated. As of 1.1 properties are saved automatically when they're changed.

Saves the properties, such as visible packages or the name of the project into the workspace.


getReferenceCandidates

Iterator<org.eclipse.emf.ecore.EObject> getReferenceCandidates(org.eclipse.emf.ecore.EObject eObject,
                                                               org.eclipse.emf.ecore.EReference eReference)
Get all possible EObjects from the provider to which a reference can be added from a certain EObject based on the type of the EReference.

Parameters:
eObject - - the EObject for which the reference should be set.
eReference - - the EReference to be set.
Returns:
Iterator over all EObject that can be added as a reference

isModelRoot

boolean isModelRoot(Object object)
This method checks whether the provided object is the model root of the project.

Parameters:
object - the object to check
Returns:
true if the object is the root of the model of this project, false otherwise

getUnsupportedEPackages

Set<org.eclipse.emf.ecore.EPackage> getUnsupportedEPackages()
Returns a collection of EPackages which are not supported by the provider. EObjects from these packages cannot be created within the project.

Returns:
Collection of unsupported EPackages

setVisiblePackages

void setVisiblePackages(Set<org.eclipse.emf.ecore.EPackage> visiblePackages)
Set the visible EPackages. New model elements can only be created from EPackages contained in the visiblePackages and the setVisibleEClasses(Set).

Parameters:
visiblePackages - the EPackages to be visible

getVisiblePackages

Set<org.eclipse.emf.ecore.EPackage> getVisiblePackages()
Get the currently visible EPackages. If no filter is set, then all EPackages supported by the provider are returned.

Returns:
Set of EPackages that should be available, or all supported EPackages

getVisibleEClasses

Set<org.eclipse.emf.ecore.EClass> getVisibleEClasses()
Get the currently visible EClasses. If no visible EClasses are set, then an empty Set is returned.

Returns:
Set of EClasses that should be available, or empty.

setVisibleEClasses

void setVisibleEClasses(Set<org.eclipse.emf.ecore.EClass> visibleEClasses)
Set the visible EClasses.

Parameters:
visibleEClasses - the classes that should be available

contains

boolean contains(Object object)
Check whether a project contains an Object.

Parameters:
object - the object to check for containment
Returns:
true if the object is in the project, false otherwise


Copyright © 2015. All Rights Reserved.