org.eclipse.emf.compare.ide.ui.internal.logical.resolver

## Class ModelResourceListener

- java.lang.Object
- - org.eclipse.emf.compare.ide.ui.internal.logical.resolver.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 Summary

Fields
`protected Set<URI>` `changedURIs` Keeps track of the URIs that need to be reparsed when next we need the dependencies graph .
`protected ReentrantLock` `internalLock` Prevents concurrent access to the two internal sets.
`protected Set<URI>` `removedURIs` Tracks the files that have been removed.

### Constructor Summary

Constructors
Constructor and Description
`ModelResourceListener()` Initializes this listener.

### Method Summary

All Methods Instance Methods Concrete Methods
`Set<URI>` `popChangedURIs()` Retrieves the set of all changed URIs since we last updated the dependencies graph, and clears it for subsequent calls.
`Set<URI>` `popRemovedURIs()` Retrieves the set of all removed URIs since we last updated the dependencies graph, and clears it for subsequent calls.
`void` `resourceChanged(org.eclipse.core.resources.IResourceChangeEvent event)`
`boolean` `visit(org.eclipse.core.resources.IResourceDelta delta)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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)`