Package 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
invalid reference

    ThreadedModelResolver#MODEL_CONTENT_TYPES

.

See Also:
  - invalid reference

        ThreadedModelResolver#hasModelType(IFile)

## Field Summary

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

### Fields inherited from interface org.eclipse.core.resources.IResourceChangeListener

`PROPERTY_EVENT_MASK`

## Constructor Summary

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

## Method Summary

Modifier and Type
Method
Description
`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 Details

### 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 Details

### ModelResourceListener

public ModelResourceListener()
Initializes this listener.

## Method Details

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