Package org.eclipse.xtext.resource.impl
Class ResourceDescriptionsProvider
- java.lang.Object
-
- org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider
-
- All Implemented Interfaces:
IResourceDescriptionsProvider
public class ResourceDescriptionsProvider extends java.lang.Object implements IResourceDescriptionsProvider
TheResourceDescriptionsProviderallows to obtain a readily configured instance of theIResourceDescriptionsdepending on the use case and lifecylce of the resource set.- Noextend:
- This class is not intended to be subclassed by clients.
- Noinstantiate:
- This class is not intended to be instantiated by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringLIVE_SCOPEThis flag configures Xtext's scoping for aResourceSetto use Xtext's index shadowed by the dirty editors' state shadowed by the ResourceSet's contents.static java.lang.StringNAMED_BUILDER_SCOPEThis flag configures Xtext's scoping for aResourceSetfor the (incremental) build.static java.lang.StringPERSISTED_DESCRIPTIONSThis flag configures Xtext's scoping for aResourceSetto use Xtext's index only.
-
Constructor Summary
Constructors Constructor Description ResourceDescriptionsProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IResourceDescriptionscreateBuilderScopeResourceDescriptions()The returned IResourceDescriptions are used by the Xtext Builder to update the Index.IResourceDescriptionscreateLiveScopeResourceDescriptions()The returned IResourceDescriptions represent the Xtext Index' state shadowed by the Editors Dirty State shadowed by the current ResourceSets contents.IResourceDescriptionscreatePersistedResourceDescriptions()The returned IResourceDescriptions represent the Xtext Index' state (not shadowed by anything).IResourceDescriptionscreateResourceDescriptions()The returned IResourceDescriptions represent the Xtext Index' state shadowed by the Editors Dirty State.IResourceDescriptionsgetResourceDescriptions(org.eclipse.emf.ecore.resource.Resource resource)IResourceDescriptionsgetResourceDescriptions(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)Provides the proper resource descriptions according to the context in which the resource set is used.voidsetBuilderScopeResourceDescriptions(com.google.inject.Provider<IResourceDescriptions> resourceDescriptions)voidsetLiveScopeResourceDescriptions(com.google.inject.Provider<IResourceDescriptions> liveScopeResourceDescriptions)voidsetPersistedResourceDescriptions(com.google.inject.Provider<IResourceDescriptions> persistedResourceDescriptions)voidsetResourceDescriptions(com.google.inject.Provider<IResourceDescriptions> resourceDescriptions)
-
-
-
Field Detail
-
NAMED_BUILDER_SCOPE
public static final java.lang.String NAMED_BUILDER_SCOPE
This flag configures Xtext's scoping for aResourceSetfor the (incremental) build. This should not be used by clients, since it is tailored for org.eclipse.xtext.builder.impl.XtextBuilder.- See Also:
- Constant Field Values
-
LIVE_SCOPE
public static final java.lang.String LIVE_SCOPE
This flag configures Xtext's scoping for aResourceSetto use Xtext's index shadowed by the dirty editors' state shadowed by the ResourceSet's contents. I.e., scoping will look for a IResourceDescription first in the ResourecSet, then in dirty editors and then in the index. If possible, don't use this this flag directly but use org.eclipse.xtext.ui.resource.LiveScopeResourceSetInitializer instead.- See Also:
- Constant Field Values
-
PERSISTED_DESCRIPTIONS
public static final java.lang.String PERSISTED_DESCRIPTIONS
This flag configures Xtext's scoping for aResourceSetto use Xtext's index only. Dirty state and the ResourceSet's contents are ignored.- Since:
- 2.6
- See Also:
- Constant Field Values
-
-
Method Detail
-
getResourceDescriptions
public IResourceDescriptions getResourceDescriptions(org.eclipse.emf.ecore.resource.Resource resource)
-
getResourceDescriptions
public IResourceDescriptions getResourceDescriptions(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Provides the proper resource descriptions according to the context in which the resource set is used. The context is indicated by theload optionsof the resource set. Supported options are:NAMED_BUILDER_SCOPELIVE_SCOPEPERSISTED_DESCRIPTIONS- If no such option is present the dirty editors are taken into account to contribute their contents to the index
null.- Specified by:
getResourceDescriptionsin interfaceIResourceDescriptionsProvider- Parameters:
resourceSet- the resource set that is currently used.- Returns:
- the
IResourceDescriptionsaccording to the usage context. - Since:
- 2.1
-
createLiveScopeResourceDescriptions
public IResourceDescriptions createLiveScopeResourceDescriptions()
The returned IResourceDescriptions represent the Xtext Index' state shadowed by the Editors Dirty State shadowed by the current ResourceSets contents.
-
createBuilderScopeResourceDescriptions
public IResourceDescriptions createBuilderScopeResourceDescriptions()
The returned IResourceDescriptions are used by the Xtext Builder to update the Index.
-
createResourceDescriptions
public IResourceDescriptions createResourceDescriptions()
The returned IResourceDescriptions represent the Xtext Index' state shadowed by the Editors Dirty State.
-
createPersistedResourceDescriptions
public IResourceDescriptions createPersistedResourceDescriptions()
The returned IResourceDescriptions represent the Xtext Index' state (not shadowed by anything).- Throws:
java.lang.IllegalStateException- if the builder integration is not configured for this language but the persisted descriptions are requested- Since:
- 2.6
-
setBuilderScopeResourceDescriptions
public void setBuilderScopeResourceDescriptions(com.google.inject.Provider<IResourceDescriptions> resourceDescriptions)
-
setResourceDescriptions
public void setResourceDescriptions(com.google.inject.Provider<IResourceDescriptions> resourceDescriptions)
-
setLiveScopeResourceDescriptions
public void setLiveScopeResourceDescriptions(com.google.inject.Provider<IResourceDescriptions> liveScopeResourceDescriptions)
- Since:
- 2.6
-
setPersistedResourceDescriptions
public void setPersistedResourceDescriptions(com.google.inject.Provider<IResourceDescriptions> persistedResourceDescriptions)
- Since:
- 2.6
-
-