org.eclipse.xtext.builder.clustering
Class ClusteringBuilderState

java.lang.Object
  extended by org.eclipse.xtext.resource.impl.AbstractResourceDescriptionChangeEventSource
      extended by org.eclipse.xtext.builder.builderState.AbstractBuilderState
          extended by org.eclipse.xtext.builder.clustering.ClusteringBuilderState
All Implemented Interfaces:
IBuilderState, IResourceDescription.Event.Source, IResourceDescriptions, ISelectable

public class ClusteringBuilderState
extends AbstractBuilderState

Author:
Sebastian Zarnekow - Initial contribution and API

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.xtext.resource.IResourceDescriptions
IResourceDescriptions.IContextAware, IResourceDescriptions.NullImpl
 
Constructor Summary
ClusteringBuilderState()
           
 
Method Summary
protected  java.util.Collection<IResourceDescription.Delta> doUpdate(BuildData buildData, ResourceDescriptionsData newData, org.eclipse.core.runtime.IProgressMonitor monitor)
          Actually do the build.
protected  IResourceDescription.Manager getResourceDescriptionManager(org.eclipse.emf.common.util.URI uri)
           
protected  void queueAffectedResources(java.util.Set<org.eclipse.emf.common.util.URI> allRemainingURIs, IResourceDescriptions oldState, CurrentDescriptions newState, java.util.Collection<IResourceDescription.Delta> deltas, BuildData buildData, org.eclipse.core.runtime.IProgressMonitor monitor)
          Put all resources that depend on some changes onto the queue of resources to be processed.
protected  void writeNewResourceDescriptions(BuildData buildData, IResourceDescriptions oldState, CurrentDescriptions newState, org.eclipse.core.runtime.IProgressMonitor monitor)
          Create new resource descriptions for a set of resources given by their URIs.
 
Methods inherited from class org.eclipse.xtext.builder.builderState.AbstractBuilderState
clean, doClean, ensureLoaded, ensureNotNull, getAllResourceDescriptions, getCopiedResourceDescriptionsData, getExportedObjects, getExportedObjects, getExportedObjectsByObject, getExportedObjectsByType, getResourceDescription, isEmpty, load, setPersister, setResourceDescriptionsData, update, updateMarkers
 
Methods inherited from class org.eclipse.xtext.resource.impl.AbstractResourceDescriptionChangeEventSource
addListener, addListeners, notifyListeners, removeListener, removeListeners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.xtext.resource.IResourceDescription.Event.Source
addListener, removeListener
 

Constructor Detail

ClusteringBuilderState

public ClusteringBuilderState()
Method Detail

doUpdate

protected java.util.Collection<IResourceDescription.Delta> doUpdate(BuildData buildData,
                                                                    ResourceDescriptionsData newData,
                                                                    org.eclipse.core.runtime.IProgressMonitor monitor)
Actually do the build.

Specified by:
doUpdate in class AbstractBuilderState
Parameters:
resourceSet - The resource set
toBeUpdated - The URIs of all the resources that have physically changed
toBeRemoved - The URIs of all the resources that have been physically deleted
newMap - A map collecting the new resource descriptions as they are to be persisted. (The new index after the build.) Initially contains the old resource descriptions.
monitor - The progress monitor
Returns:
A list of deltas describing all changes made by the build.

writeNewResourceDescriptions

protected void writeNewResourceDescriptions(BuildData buildData,
                                            IResourceDescriptions oldState,
                                            CurrentDescriptions newState,
                                            org.eclipse.core.runtime.IProgressMonitor monitor)
Create new resource descriptions for a set of resources given by their URIs.

Parameters:
resourceSet - The resource set
oldState - The old index
newState - The new index
toBeUpdated - URIs of all resources physically changed (initial delta)
monitor - The progress monitor used for user feedback

queueAffectedResources

protected void queueAffectedResources(java.util.Set<org.eclipse.emf.common.util.URI> allRemainingURIs,
                                      IResourceDescriptions oldState,
                                      CurrentDescriptions newState,
                                      java.util.Collection<IResourceDescription.Delta> deltas,
                                      BuildData buildData,
                                      org.eclipse.core.runtime.IProgressMonitor monitor)
Put all resources that depend on some changes onto the queue of resources to be processed. Updates notInDelta by removing all URIs put into the queue.

Parameters:
notInDelta - URIs of unchanged and unaffected resources
oldState - State before the build
newState - The current state
deltas - The changes
queue - The queue of resources yet to be built
monitor - The progress monitor used for user feedback

getResourceDescriptionManager

protected IResourceDescription.Manager getResourceDescriptionManager(org.eclipse.emf.common.util.URI uri)