Interface ProfileApplicationRegistry

    • 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. Returns false 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:
      • getProfileApplicationDecoratorOfContainedEObject

        ProfileApplicationDecorator getProfileApplicationDecoratorOfContainedEObject​(String modelId,
                                                                                     EObject eObject)
        Gets the instance of the @link ProfileApplicationDecorator that is a parent of the provided EObject 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 also null which would indicate that the eObject was removed together with parent.