Interface IMarkerManager

  • All Superinterfaces:
    IManagedService

    public interface IMarkerManager
    extends IManagedService
    A marker manager service.
    It provides operations with DT markers.

    Behind the scene the DT marker is associated with some EObject. From this point of view the DT marker is equivalent to Eclipse marker which is associated with some IResource.

    The marker manager manipulates with markers by the specified IProject, the given objectId and the given source.
    The objectId is an object of type string or long. It is caused as already mentioned by marker association with EObject.
    The marker-underlying EObject can be of type IBmObject or 'native' EObject.
    So we have two objectId types:

    The source string is an identifier of the source (origin) of markers. The source is a component that generates markers.

    See Also:
    Marker
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String SERVICE_NAME
      The name of the marker manager as managed service.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addListener​(org.eclipse.core.resources.IProject project, IMarkerManagerListener listener)
      Adds the specified listener for the given {code project}.
      IMarkerInfo getMarkerInfo​(org.eclipse.core.resources.IProject project)
      Returns marker info for the specified project.
      Marker[] getMarkers​(org.eclipse.core.resources.IProject project, Object objectId)
      Gets markers for the specified objectId and associated with the given project.
      MarkerSeverity getMaxSeverity​(org.eclipse.core.resources.IProject project, Object objectId)
      Finds and returns a maximum severity for the given objectId.
      Marker[] getNestedMarkers​(org.eclipse.core.resources.IProject project, Object objectId)
      Returns markers of the specified objectId and its children.
      Iterator<Marker> iterator​(org.eclipse.core.resources.IProject project)
      Returns an iterator over all the markers of the given project.
      void removeContainmentMarkers​(IDtProject dtProject, Long topObjectId, Set<Long> removedContainmentIds)
      TODO javadoc.
      void removeListener​(org.eclipse.core.resources.IProject project, IMarkerManagerListener listener)
      Removes the specified listener.
      void removeMarkers​(org.eclipse.core.resources.IProject project, Object objectId)
      Removes markers for the specified objectId associated with the given project.
      void removeMarkers​(org.eclipse.core.resources.IProject project, Object objectId, long sourceObjectId, String checkId)
      Removes markers for the specified objectId and source associated with the given project.
      void removeMarkers​(org.eclipse.core.resources.IProject project, String checkId)
      Removes all markers generated by the provided check for all applicable target objects
      void setMarkers​(org.eclipse.core.resources.IProject project, Object objectId, Marker[] markers)
      Sets markers for the specified objectId associated with the given project.
      void setMarkers​(org.eclipse.core.resources.IProject project, Object objectId, Object sourceObjectId, String checkId, Marker[] markers)
      Sets markers for the specified objectId and checkId associated with the given project.
      Iterator<Object> topObjectIdIterator​(org.eclipse.core.resources.IProject project)
      Returns an iterator over all top identifiers for objects with markers of the given project.
      void updateSeverity​(org.eclipse.core.resources.IProject project, String checkId, MarkerSeverity newSeverity)
      Updates severity of markers generated by the provided checkId, if any
    • Method Detail

      • addListener

        void addListener​(org.eclipse.core.resources.IProject project,
                         IMarkerManagerListener listener)
        Adds the specified listener for the given {code project}.
        Parameters:
        project - the project to associate with the listener, cannot be null.
        listener - the listener to add, cannot be null.
        See Also:
        IMarkerManagerListener
      • removeListener

        void removeListener​(org.eclipse.core.resources.IProject project,
                            IMarkerManagerListener listener)
        Removes the specified listener.
        Parameters:
        project - the project, cannot be null.
        listener - the listener to remove, cannot be null.
        See Also:
        IMarkerManagerListener
      • setMarkers

        void setMarkers​(org.eclipse.core.resources.IProject project,
                        Object objectId,
                        Marker[] markers)
        Sets markers for the specified objectId associated with the given project.

        If the specified objectId is of Long type then it is supposed that markers array contains all markers including contained objects.

        If some markers already exist for the specified objectId and source they will be replaced by a new one.
        If the given markers array is null or empty, the existing markers for the specified objectId and source will be removed.

        Parameters:
        project - the project, cannot be null.
        objectId - the object identifier. It can be of type String or Long only. The identifier cannot be null.
        markers - the array of markers.
      • setMarkers

        void setMarkers​(org.eclipse.core.resources.IProject project,
                        Object objectId,
                        Object sourceObjectId,
                        String checkId,
                        Marker[] markers)
        Sets markers for the specified objectId and checkId associated with the given project.

        If the specified objectId is of Long type then it is supposed that markers array contains all markers including contained objects.

        If some markers already exist for the specified objectId and source they will be replaced by a new one.
        If the given markers array is null or empty, the existing markers for the specified objectId and source will be removed.

        Parameters:
        project - the project, cannot be null.
        objectId - the object identifier. It can be of type String or Long only.
        sourceObjectId - The identifier of the source object which validation resulted in those markers. Used to clear previous markers being generated for the same source. Use -1 to specify situations when no identifiable source object is present (e.g. module markers, etc)
        checkId - the checkId, cannot be null.
        markers - the array of markers.
      • removeMarkers

        void removeMarkers​(org.eclipse.core.resources.IProject project,
                           Object objectId)
        Removes markers for the specified objectId associated with the given project. The removal automatically cleans all markers that were created for this object as well as all markers that were created in association with this object (e.g. context of checks, etc)
        Parameters:
        project - the project, cannot be null.
        objectId - the object identifier. It can be of type String or Long only. The identifier cannot be null.
      • removeMarkers

        void removeMarkers​(org.eclipse.core.resources.IProject project,
                           Object objectId,
                           long sourceObjectId,
                           String checkId)
        Removes markers for the specified objectId and source associated with the given project.
        Parameters:
        project - the project, cannot be null.
        objectId - the object identifier. It can be of type String or Long only. The identifier cannot be null.
        sourceObjectId - The identifier of the source object which validation resulted in those markers. Used to clear previous markers being generated for the same source. Use -1 to specify situations when no identifiable source object is present (e.g. module markers, etc) and markers should be removed completelly
        checkId - the checkId, cannot be null.
      • removeMarkers

        void removeMarkers​(org.eclipse.core.resources.IProject project,
                           String checkId)
        Removes all markers generated by the provided check for all applicable target objects
        Parameters:
        project - The project to update markers for. May not be null
        checkId - The check identifier. May not be null
      • updateSeverity

        void updateSeverity​(org.eclipse.core.resources.IProject project,
                            String checkId,
                            MarkerSeverity newSeverity)
        Updates severity of markers generated by the provided checkId, if any
        Parameters:
        project - The project to update markers for. May not be null
        checkId - The check identifier. May not be null
        newSeverity - New severity to set. May not be null
      • getMarkers

        Marker[] getMarkers​(org.eclipse.core.resources.IProject project,
                            Object objectId)
        Gets markers for the specified objectId and associated with the given project.

        It retrieves markers without filtering by 'source'. The client can filter if manually if needed.

        Parameters:
        project - the project, cannot be null.
        objectId - the object identifier. It can be of type String or Long only. The identifier cannot be null.
        Returns:
        an array of markers, never null.
      • getNestedMarkers

        Marker[] getNestedMarkers​(org.eclipse.core.resources.IProject project,
                                  Object objectId)
        Returns markers of the specified objectId and its children.
        Parameters:
        project - the project, cannot be null.
        objectId - the object identifier. It can be of type String or Long only. The identifier cannot be null.
        Returns:
        an array of markers for the specified objectId and its children, never null.
      • getMaxSeverity

        MarkerSeverity getMaxSeverity​(org.eclipse.core.resources.IProject project,
                                      Object objectId)
        Finds and returns a maximum severity for the given objectId.
        Parameters:
        project - the project, cannot be null.
        objectId - the object identifier. It can be of type String or Long only. The identifier cannot be null.
        Returns:
        a maximum severity or null.
      • iterator

        Iterator<Marker> iterator​(org.eclipse.core.resources.IProject project)
        Returns an iterator over all the markers of the given project.
        Parameters:
        project - the project, cannot be null.
        Returns:
        iterator over all the markers, never null.
      • topObjectIdIterator

        Iterator<Object> topObjectIdIterator​(org.eclipse.core.resources.IProject project)
        Returns an iterator over all top identifiers for objects with markers of the given project.
        Parameters:
        project - the project, cannot be null.
        Returns:
        iterator over all the source ids for objects with markers, never null.
      • getMarkerInfo

        IMarkerInfo getMarkerInfo​(org.eclipse.core.resources.IProject project)
        Returns marker info for the specified project.
        Parameters:
        project - the project to get the marker info associated with, cannot be null.
        Returns:
        the marker info, never null.
        See Also:
        IMarkerInfo
      • removeContainmentMarkers

        void removeContainmentMarkers​(IDtProject dtProject,
                                      Long topObjectId,
                                      Set<Long> removedContainmentIds)
        TODO javadoc. Only model containments are supported (that's for sure). Only model top object id is supported (as this call is only for the model changes)
        Parameters:
        dtProject -
        objectId -
        removedContainmentIds -