org.eclipse.xtext.builder.impl
Class DirtyStateAwareResourceDescriptions

java.lang.Object
  extended by org.eclipse.xtext.resource.impl.AbstractResourceDescriptionChangeEventSource
      extended by org.eclipse.xtext.builder.impl.DirtyStateAwareResourceDescriptions
All Implemented Interfaces:
IResourceDescription.Event.Source, IResourceDescriptions, ISelectable

public class DirtyStateAwareResourceDescriptions
extends AbstractResourceDescriptionChangeEventSource
implements IResourceDescriptions

Author:
Sebastian Zarnekow - Initial contribution and API

Nested Class Summary
protected  class DirtyStateAwareResourceDescriptions.DirtyStateListener
           
protected  class DirtyStateAwareResourceDescriptions.GlobalStateListener
           
 
Nested classes/interfaces inherited from interface org.eclipse.xtext.resource.IResourceDescriptions
IResourceDescriptions.IContextAware, IResourceDescriptions.NullImpl
 
Constructor Summary
DirtyStateAwareResourceDescriptions(IBuilderState globalDescriptions, IDirtyStateManager dirtyStateManager, IStateChangeEventBroker stateChangeEventBroker)
           
 
Method Summary
protected  IResourceDescription.Delta createDelta(IResourceDescription old, IResourceDescription _new)
           
protected  IResourceDescription.Event.Listener createDirtyStateListener()
           
protected  IResourceDescription.Event.Listener createGlobalStateListener()
           
 void dirtyDescriptionsChanged(IResourceDescription.Event event)
           
 java.lang.Iterable<IResourceDescription> getAllResourceDescriptions()
           
 java.lang.Iterable<IEObjectDescription> getExportedObjects()
           
 java.lang.Iterable<IEObjectDescription> getExportedObjects(org.eclipse.emf.ecore.EClass type, QualifiedName name, boolean ignoreCase)
           
 java.lang.Iterable<IEObjectDescription> getExportedObjectsByObject(org.eclipse.emf.ecore.EObject object)
           
 java.lang.Iterable<IEObjectDescription> getExportedObjectsByType(org.eclipse.emf.ecore.EClass type)
           
 IResourceDescription getResourceDescription(org.eclipse.emf.common.util.URI uri)
          Returns the resource descriptions for the given URI.
 void globalDescriptionsChanged(IResourceDescription.Event event)
           
 boolean isEmpty()
          Clients may want to check the selectable to skip its processing in case it is empty.
protected  java.lang.Iterable<IEObjectDescription> joinIterables(java.lang.Iterable<IEObjectDescription> dirtyDescriptions, java.lang.Iterable<IEObjectDescription> persistentDescriptions)
           
 
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
 

Constructor Detail

DirtyStateAwareResourceDescriptions

@Inject
public DirtyStateAwareResourceDescriptions(IBuilderState globalDescriptions,
                                                  IDirtyStateManager dirtyStateManager,
                                                  IStateChangeEventBroker stateChangeEventBroker)
Method Detail

createDirtyStateListener

protected IResourceDescription.Event.Listener createDirtyStateListener()

createGlobalStateListener

protected IResourceDescription.Event.Listener createGlobalStateListener()

dirtyDescriptionsChanged

public void dirtyDescriptionsChanged(IResourceDescription.Event event)

createDelta

protected IResourceDescription.Delta createDelta(IResourceDescription old,
                                                 IResourceDescription _new)

globalDescriptionsChanged

public void globalDescriptionsChanged(IResourceDescription.Event event)

getAllResourceDescriptions

public java.lang.Iterable<IResourceDescription> getAllResourceDescriptions()
Specified by:
getAllResourceDescriptions in interface IResourceDescriptions

getResourceDescription

public IResourceDescription getResourceDescription(org.eclipse.emf.common.util.URI uri)
Description copied from interface: IResourceDescriptions
Returns the resource descriptions for the given URI. It's the client's responsibility to normalize the URI.

Specified by:
getResourceDescription in interface IResourceDescriptions

isEmpty

public boolean isEmpty()
Description copied from interface: ISelectable
Clients may want to check the selectable to skip its processing in case it is empty. Implementations should be fast and not require expensive precalculation. Selectable may return false if it is too expensive to compute the actual result.

Specified by:
isEmpty in interface ISelectable
Returns:
true if the selectable does not provide any descriptions.

getExportedObjects

public java.lang.Iterable<IEObjectDescription> getExportedObjects()
Specified by:
getExportedObjects in interface ISelectable
Returns:
all exported elements. May not be null.

getExportedObjects

public java.lang.Iterable<IEObjectDescription> getExportedObjects(org.eclipse.emf.ecore.EClass type,
                                                                  QualifiedName name,
                                                                  boolean ignoreCase)
Specified by:
getExportedObjects in interface ISelectable
Returns:
all elements which match the given qualified name and type. May not be null.

joinIterables

protected java.lang.Iterable<IEObjectDescription> joinIterables(java.lang.Iterable<IEObjectDescription> dirtyDescriptions,
                                                                java.lang.Iterable<IEObjectDescription> persistentDescriptions)

getExportedObjectsByType

public java.lang.Iterable<IEObjectDescription> getExportedObjectsByType(org.eclipse.emf.ecore.EClass type)
Specified by:
getExportedObjectsByType in interface ISelectable
Returns:
all elements which match the given type. May not be null.

getExportedObjectsByObject

public java.lang.Iterable<IEObjectDescription> getExportedObjectsByObject(org.eclipse.emf.ecore.EObject object)
Specified by:
getExportedObjectsByObject in interface ISelectable
Returns:
all elements which match the given instance. May not be null.