Interface ProfileApplicationRegistry
- All Known Implementing Classes:
ProfileApplicationRegistryImpl
public interface ProfileApplicationRegistry
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ProfileApplicationRegistry
Singleton instance of profile application registry -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyProfileToModel
(String modelId, IFile profileApplicationsFile, Collection<Profile> profiles, ResourceSet resourceSet) To apply profiles on a modelgetProfileApplicationDecoratorOfContainedEObject
(String modelId, EObject eObject) Gets the instance of the @linkProfileApplicationDecorator
that is a parent of the providedEObject
and it searches amongst all profile application decorators for the given model id.getProfileApplications
(String modelId) Returns profile application elements.boolean
hasProfileApplications
(String modelId) Checks if there are any profile applications defined on the given modelled resource.loadProfileApplicationForModel
(String modelId, IFile profileApplicationFile, ResourceSet resourceSet) Load profile application for model from a file.void
Unloads all profile applications for a model.void
unloadProfileApplicationForModel
(String modelId, ProfileApplicationDecorator profileApplication) Unloads profile application for a model.
-
Field Details
-
INSTANCE
Singleton instance of profile application registry
-
-
Method Details
-
applyProfileToModel
void applyProfileToModel(String modelId, IFile profileApplicationsFile, Collection<Profile> profiles, ResourceSet resourceSet) throws Exception To apply profiles on a model- Parameters:
modelId
- Generated Id of the opened model's resource in user interface editor.profileApplicationsFile
- file where profile applications are saved.profiles
- collection of profiles that are going to be applied on a model resource.resourceSet
- is optional. If it's not provided, the registry's default resource set will be used instead.- Throws:
Exception
-
loadProfileApplicationForModel
ProfileApplicationDecorator loadProfileApplicationForModel(String modelId, IFile profileApplicationFile, ResourceSet resourceSet) throws Exception Load profile application for model from a file. Returnsfalse
if this profile application was already loaded.- Parameters:
modelId
-profileApplicationFile
-resourceSet
- is optional. If it's not provided, the registry's default resource set will be used instead.- Returns:
null
if already loaded, otherwise the loaded profile application.- Throws:
Exception
-
unloadProfileApplicationForModel
void unloadProfileApplicationForModel(String modelId, ProfileApplicationDecorator profileApplication) Unloads profile application for a model.- Parameters:
modelId
-profileApplication
-
-
unloadAllProfileApplicationsForModel
Unloads all profile applications for a model. Removes tracking of model id from registry.- Parameters:
modelId
-
-
hasProfileApplications
Checks if there are any profile applications defined on the given modelled resource.- Parameters:
modelID
- The string identification of the modelled resource.- Returns:
-
getProfileApplications
Returns profile application elements.- Parameters:
modelId
-- Returns:
-
getProfileApplicationDecoratorOfContainedEObject
ProfileApplicationDecorator getProfileApplicationDecoratorOfContainedEObject(String modelId, EObject eObject) Gets the instance of the @linkProfileApplicationDecorator
that is a parent of the providedEObject
and it searches amongst all profile application decorators for the given model id.- Parameters:
modelId
- The string identification of the modelled resource.eObject
- in question- Returns:
ProfileApplicationDecorator
if everything OK,null
if could not find it or any of the parents was alsonull
which would indicate that the eObject was removed together with parent.
-