Interface ProfileApplicationRegistry
-
- All Known Implementing Classes:
ProfileApplicationRegistryImpl
public interface ProfileApplicationRegistry
-
-
Field Summary
Fields Modifier and Type Field Description static ProfileApplicationRegistryINSTANCESingleton instance of profile application registry
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidapplyProfileToModel(String modelId, IFile profileApplicationsFile, Collection<Profile> profiles, ResourceSet resourceSet)To apply profiles on a modelProfileApplicationDecoratorgetProfileApplicationDecoratorOfContainedEObject(String modelId, EObject eObject)Gets the instance of the @linkProfileApplicationDecoratorthat is a parent of the providedEObjectand it searches amongst all profile application decorators for the given model id.Collection<ProfileApplicationDecorator>getProfileApplications(String modelId)Returns profile application elements.booleanhasProfileApplications(String modelId)Checks if there are any profile applications defined on the given modelled resource.ProfileApplicationDecoratorloadProfileApplicationForModel(String modelId, IFile profileApplicationFile, ResourceSet resourceSet)Load profile application for model from a file.voidunloadAllProfileApplicationsForModel(String modelId)Unloads all profile applications for a model.voidunloadProfileApplicationForModel(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. Returnsfalseif 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:
nullif 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 @linkProfileApplicationDecoratorthat is a parent of the providedEObjectand 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:
ProfileApplicationDecoratorif everything OK,nullif could not find it or any of the parents was alsonullwhich would indicate that the eObject was removed together with parent.
-
-