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 byThreadedModelResolver#MODEL_CONTENT_TYPES
.- See Also:
ThreadedModelResolver#hasModelType(IFile)
-
-
Field Summary
Fields Modifier and Type Field Description 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 Description ModelResourceListener()
Initializes this listener.
-
Method Summary
All Methods Instance Methods Concrete Methods 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)
-
-
-
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 .
-
internalLock
protected final ReentrantLock internalLock
Prevents concurrent access to the two internal sets.
-
-
Method Detail
-
resourceChanged
public void resourceChanged(org.eclipse.core.resources.IResourceChangeEvent event)
- Specified by:
resourceChanged
in interfaceorg.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 interfaceorg.eclipse.core.resources.IResourceDeltaVisitor
- Throws:
org.eclipse.core.runtime.CoreException
- See Also:
IResourceDeltaVisitor.visit(org.eclipse.core.resources.IResourceDelta)
-
-