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
TheResourceDescriptionsProvider
allows to obtain a readily configured instance of theIResourceDescriptions
depending 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.String
LIVE_SCOPE
This flag configures Xtext's scoping for aResourceSet
to use Xtext's index shadowed by the dirty editors' state shadowed by the ResourceSet's contents.static java.lang.String
NAMED_BUILDER_SCOPE
This flag configures Xtext's scoping for aResourceSet
for the (incremental) build.static java.lang.String
PERSISTED_DESCRIPTIONS
This flag configures Xtext's scoping for aResourceSet
to use Xtext's index only.
-
Constructor Summary
Constructors Constructor Description ResourceDescriptionsProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IResourceDescriptions
createBuilderScopeResourceDescriptions()
The returned IResourceDescriptions are used by the Xtext Builder to update the Index.IResourceDescriptions
createLiveScopeResourceDescriptions()
The returned IResourceDescriptions represent the Xtext Index' state shadowed by the Editors Dirty State shadowed by the current ResourceSets contents.IResourceDescriptions
createPersistedResourceDescriptions()
The returned IResourceDescriptions represent the Xtext Index' state (not shadowed by anything).IResourceDescriptions
createResourceDescriptions()
The returned IResourceDescriptions represent the Xtext Index' state shadowed by the Editors Dirty State.IResourceDescriptions
getResourceDescriptions(org.eclipse.emf.ecore.resource.Resource resource)
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.void
setBuilderScopeResourceDescriptions(com.google.inject.Provider<IResourceDescriptions> resourceDescriptions)
void
setLiveScopeResourceDescriptions(com.google.inject.Provider<IResourceDescriptions> liveScopeResourceDescriptions)
void
setPersistedResourceDescriptions(com.google.inject.Provider<IResourceDescriptions> persistedResourceDescriptions)
void
setResourceDescriptions(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 aResourceSet
for 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 aResourceSet
to 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 aResourceSet
to 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 options
of the resource set. Supported options are:NAMED_BUILDER_SCOPE
LIVE_SCOPE
PERSISTED_DESCRIPTIONS
- If no such option is present the dirty editors are taken into account to contribute their contents to the index
null
.- Specified by:
getResourceDescriptions
in interfaceIResourceDescriptionsProvider
- Parameters:
resourceSet
- the resource set that is currently used.- Returns:
- the
IResourceDescriptions
according 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
-
-