Interface ProfileApplicationRegistry
-
- All Known Implementing Classes:
ProfileApplicationRegistryImpl
public interface ProfileApplicationRegistry
-
-
Field Summary
Fields Modifier and Type Field Description static ProfileApplicationRegistry
INSTANCE
Singleton instance of profile application registry
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
applyProfileToModel(String modelId, IFile profileApplicationsFile, Collection<Profile> profiles, ResourceSet resourceSet)
To apply profiles on a modelProfileApplicationDecorator
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.Collection<ProfileApplicationDecorator>
getProfileApplications(String modelId)
Returns profile application elements.boolean
hasProfileApplications(String modelId)
Checks if there are any profile applications defined on the given modelled resource.ProfileApplicationDecorator
loadProfileApplicationForModel(String modelId, IFile profileApplicationFile, ResourceSet resourceSet)
Load profile application for model from a file.void
unloadAllProfileApplicationsForModel(String modelId)
Unloads all profile applications for a model.void
unloadProfileApplicationForModel(String modelId, ProfileApplicationDecorator profileApplication)
Unloads profile application for a model.
-
-
-
Field Detail
-
INSTANCE
static final ProfileApplicationRegistry INSTANCE
Singleton instance of profile application registry
-
-
Method Detail
-
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
void unloadAllProfileApplicationsForModel(String modelId)
Unloads all profile applications for a model. Removes tracking of model id from registry.- Parameters:
modelId
-
-
hasProfileApplications
boolean hasProfileApplications(String modelId)
Checks if there are any profile applications defined on the given modelled resource.- Parameters:
modelID
- The string identification of the modelled resource.- Returns:
-
getProfileApplications
Collection<ProfileApplicationDecorator> getProfileApplications(String modelId)
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.
-
-