Interface ProfileApplicationRegistry
public interface ProfileApplicationRegistry
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ProfileApplicationRegistrySingleton instance of profile application registry -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyProfileToModel(String modelId, IFile profileApplicationsFile, Collection<Profile> profiles, ResourceSet resourceSet) To apply profiles on a modelgetProfileApplicationDecoratorOfContainedEObject(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.getProfileApplications(String modelId) Returns profile application elements.booleanhasProfileApplications(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.voidUnloads all profile applications for a model.voidunloadProfileApplicationForModel(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. 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
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 @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.
-