Interface IProjectOperationApi


  • public interface IProjectOperationApi
    The API that allows to perform high-level operations. Also it provides APIs for data and files manipulations.
    • Method Detail

      • submitContextCreation

        void submitContextCreation​(org.eclipse.emf.ecore.EObject object,
                                   org.eclipse.core.runtime.IProgressMonitor monitor,
                                   Consumer<IEditingContext> contextConsumer)
        Submits the editing context creation.
        Invokes the createContext(EObject, IProgressMonitor) within a separate thread.
        Parameters:
        object - the object to create context, cannot be null.
        monitor - the progress monitor that monitors the activity of workspace operations, can be null.
        contextConsumer - the consumer that processes a newly created context, cannot be null.
      • createContext

        IEditingContext createContext​(org.eclipse.emf.ecore.EObject object,
                                      org.eclipse.core.runtime.IProgressMonitor monitor)
        Creates the IEditingContext for the environment (project, bm/emf, ...) obtained from the specified object. A newly created context works within the operation that executed after the sync DD is computed.
        Parameters:
        object - the object to create context, cannot be null.
        monitor - the progress monitor that monitors the activity of workspace operations, can be null.
        Returns:
        the editing context instance, or null if the operation was canceled by monitor.
      • getExistingContext

        IEditingContext getExistingContext​(org.eclipse.emf.ecore.EObject object)
        Returns a last created context by the specified object.
        Parameters:
        object - the object to get the existing context, cannot be null.
        Returns:
        the editing context instance, or null if the corrensponding context was not found.
        See Also:
        createContext(EObject, IProgressMonitor)
      • performOperation

        void performOperation​(Runnable runnable,
                              ProjectPipelineJob afterJob,
                              org.eclipse.core.runtime.IProgressMonitor monitor,
                              org.eclipse.core.resources.IProject... projects)
        Performs the specified runnable within the operation.

        The operation is performed after all specified projects are ready and its pipeline stage corresponds the specified afterJob stage.

        It does nothing if it is canceled using monitor.

        Parameters:
        runnable - the runnable to perform, cannot be null.
        afterJob - the stage the operation executed after, cannot be null.
        monitor - the progress monitor that monitors the activity of workspace operations, can be null.
        projects - the projects the operation affects, cannot be null or empty.
      • performOperation

        void performOperation​(Runnable runnable,
                              ProjectPipelineJob afterJob,
                              org.eclipse.core.runtime.IProgressMonitor monitor,
                              IDtProject... projects)
        Performs the specified runnable within the operation.

        The operation is performed after projects pipeline stage corresponds the specified afterJob stage.

        It does nothing if it is canceled using monitor.

        Parameters:
        runnable - the runnable to perform, cannot be null.
        afterJob - the stage the operation executed after, cannot be null.
        monitor - the progress monitor that monitors the activity of workspace operations, can be null.
        projects - the projects the operation affects, cannot be null or empty.
      • submitOperation

        void submitOperation​(Runnable runnable,
                             ProjectPipelineJob afterJob,
                             org.eclipse.core.runtime.IProgressMonitor monitor,
                             org.eclipse.core.resources.IProject... projects)
        Submits the operation. In fact, performs the in a separate thread.
        Parameters:
        runnable - the runnable to perform, cannot be null.
        afterJob - the stage the operation executed after, cannot be null.
        monitor - the progress monitor that monitors the activity of workspace operations, can be null.
        projects - the projects the operation affects, cannot be null or empty.
        See Also:
        performOperation(Runnable, ProjectPipelineJob, IProgressMonitor, IProject...)
      • getReadonlyModelApi

        IModelApi getReadonlyModelApi​(IBmModel bmModel,
                                      org.eclipse.core.runtime.IProgressMonitor monitor,
                                      ProjectPipelineJob afterJob)
        Returns a newly created readonly IModelApi for the specified bmModel.
        Parameters:
        bmModel - the BM Model to create the model API, cannot be null.
        monitor - the progress monitor that monitors the activity of workspace operations, can be null.
        afterJob - the stage the operation executed after, cannot be null.
        Returns:
        IModelApi instance, never null.
      • getReadonlyModelApi

        IModelApi getReadonlyModelApi​(IDtProject project,
                                      org.eclipse.core.runtime.IProgressMonitor monitor,
                                      ProjectPipelineJob afterJob)
        Returns a newly created readonly IModelApi for the specified project.
        Parameters:
        project - the project to create the model API, cannot be null.
        monitor - the progress monitor that monitors the activity of workspace operations, can be null.
        afterJob - the stage the operation executed after, cannot be null.
        Returns:
        IModelApi instance, never null.
      • getReadonlyModelApi

        IModelApi getReadonlyModelApi​(IBmObject bmObject,
                                      org.eclipse.core.runtime.IProgressMonitor monitor,
                                      ProjectPipelineJob afterJob)
        Returns a newly created readonly IModelApi for the specified bmObject.
        Parameters:
        bmObject - the object to create the model API, cannot be null.
        monitor - the progress monitor that monitors the activity of workspace operations, can be null.
        afterJob - the stage the operation executed after, cannot be null.
        Returns:
        IModelApi instance, never null.
      • getModelApi

        IModelApi getModelApi​(IBmModel bmModel,
                              org.eclipse.core.runtime.IProgressMonitor monitor,
                              ProjectPipelineJob afterJob)
        Returns a newly created IModelApi for the specified bmModel.
        Parameters:
        bmModel - the BM Model to create the model API, cannot be null.
        monitor - the progress monitor that monitors the activity of workspace operations, can be null.
        afterJob - the stage the operation executed after, cannot be null.
        Returns:
        IModelApi instance, never null.
      • getModelApi

        IModelApi getModelApi​(IDtProject project,
                              org.eclipse.core.runtime.IProgressMonitor monitor,
                              ProjectPipelineJob afterJob)
        Returns a newly created IModelApi for the specified project.
        Parameters:
        project - the project to create the model API, cannot be null.
        monitor - the progress monitor that monitors the activity of workspace operations, can be null.
        afterJob - the stage the operation executed after, cannot be null.
        Returns:
        IModelApi instance, never null.
      • getModelApi

        IModelApi getModelApi​(IBmObject bmObject,
                              org.eclipse.core.runtime.IProgressMonitor monitor,
                              ProjectPipelineJob afterJob)
        Returns a newly created IModelApi for the specified bmObject.
        Parameters:
        bmObject - the object to create the model API, cannot be null.
        monitor - the progress monitor that monitors the activity of workspace operations, can be null.
        afterJob - the stage the operation executed after, cannot be null.
        Returns:
        IModelApi instance, never null.