Class ModelResourceListener

  • All Implemented Interfaces:
    EventListener, org.eclipse.core.resources.IResourceChangeListener, org.eclipse.core.resources.IResourceDeltaVisitor

    public class ModelResourceListener
    extends Object
    implements org.eclipse.core.resources.IResourceChangeListener, org.eclipse.core.resources.IResourceDeltaVisitor
    This will listen to workspace changes and react to all changes on "model" resources as determined by ThreadedModelResolver#MODEL_CONTENT_TYPES.
    See Also:
    ThreadedModelResolver#hasModelType(IFile)
    • Field Detail

      • changedURIs

        protected final Set<URI> changedURIs
        Keeps track of the URIs that need to be reparsed when next we need the dependencies graph .
      • removedURIs

        protected final Set<URI> removedURIs
        Tracks the files that have been removed.
      • internalLock

        protected final ReentrantLock internalLock
        Prevents concurrent access to the two internal sets.
    • Constructor Detail

      • ModelResourceListener

        public ModelResourceListener()
        Initializes this listener.
    • Method Detail

      • resourceChanged

        public void resourceChanged​(org.eclipse.core.resources.IResourceChangeEvent event)
        Specified by:
        resourceChanged in interface org.eclipse.core.resources.IResourceChangeListener
      • popChangedURIs

        public Set<URI> popChangedURIs()
        Retrieves the set of all changed URIs since we last updated the dependencies graph, and clears it for subsequent calls.
        Returns:
        The set of all changed URIs since we last updated the dependencies graph.
      • popRemovedURIs

        public Set<URI> popRemovedURIs()
        Retrieves the set of all removed URIs since we last updated the dependencies graph, and clears it for subsequent calls.
        Returns:
        The set of all removed URIs since we last updated the dependencies graph.
      • visit

        public boolean visit​(org.eclipse.core.resources.IResourceDelta delta)
                      throws org.eclipse.core.runtime.CoreException
        Specified by:
        visit in interface org.eclipse.core.resources.IResourceDeltaVisitor
        Throws:
        org.eclipse.core.runtime.CoreException
        See Also:
        IResourceDeltaVisitor.visit(org.eclipse.core.resources.IResourceDelta)