public class ResourceDescriptionsProvider extends java.lang.Object implements IResourceDescriptionsProvider
ResourceDescriptionsProvider
allows to obtain a readily configured instance of the
IResourceDescriptions
depending on the use case and lifecylce of the resource set.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LIVE_SCOPE
This flag configures Xtext's scoping for a
ResourceSet 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 a
ResourceSet for the (incremental) build. |
static java.lang.String |
PERSISTED_DESCRIPTIONS
This flag configures Xtext's scoping for a
ResourceSet to use Xtext's index only. |
Constructor and Description |
---|
ResourceDescriptionsProvider() |
Modifier and Type | Method and 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) |
public static final java.lang.String NAMED_BUILDER_SCOPE
ResourceSet
for the (incremental) build. This should not be
used by clients, since it is tailored for org.eclipse.xtext.builder.impl.XtextBuilder.public static final java.lang.String LIVE_SCOPE
ResourceSet
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.public static final java.lang.String PERSISTED_DESCRIPTIONS
ResourceSet
to use Xtext's index only. Dirty state and the
ResourceSet's contents are ignored.public IResourceDescriptions getResourceDescriptions(org.eclipse.emf.ecore.resource.Resource resource)
public IResourceDescriptions getResourceDescriptions(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
load options
of the resource set. Supported
options are:
NAMED_BUILDER_SCOPE
LIVE_SCOPE
PERSISTED_DESCRIPTIONS
null
.getResourceDescriptions
in interface IResourceDescriptionsProvider
resourceSet
- the resource set that is currently used.IResourceDescriptions
according to the usage context.public IResourceDescriptions createLiveScopeResourceDescriptions()
public IResourceDescriptions createBuilderScopeResourceDescriptions()
public IResourceDescriptions createResourceDescriptions()
public IResourceDescriptions createPersistedResourceDescriptions()
java.lang.IllegalStateException
- if the builder integration is not configured for this language but the persisted descriptions are requestedpublic void setBuilderScopeResourceDescriptions(com.google.inject.Provider<IResourceDescriptions> resourceDescriptions)
public void setResourceDescriptions(com.google.inject.Provider<IResourceDescriptions> resourceDescriptions)
public void setLiveScopeResourceDescriptions(com.google.inject.Provider<IResourceDescriptions> liveScopeResourceDescriptions)
public void setPersistedResourceDescriptions(com.google.inject.Provider<IResourceDescriptions> persistedResourceDescriptions)