项目:xtext-extras
文件:BuilderIntegrationFragment.java
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
return new BindFactory()
.addTypetoType(IContainer.Manager.class.getName(),StateBasedContainerManager.class.getName())
.addTypetoType(IAllContaineRSState.Provider.class.getName(),org.eclipse.xtext.resource.containers.ResourceSetBasedAllContaineRSStateProvider.class.getName())
.addConfiguredBinding(
IResourceDescriptions.class.getName(),"binder.bind(" + IResourceDescriptions.class.getName() + ".class"
+ ").to("
+ ResourceSetBasedResourceDescriptions.class.getName() + ".class)")
.addConfiguredBinding(
IResourceDescriptions.class.getName() + "Persisted","binder.bind("+ IResourceDescriptions.class.getName() + ".class"
+ ").annotatedWith(com.google.inject.name.Names.named("
+ "org.eclipse.xtext.resource.impl.ResourceDescriptionsprovider.PERSISTED_DESCRIPTIONS)).to("
+ ResourceSetBasedResourceDescriptions.class.getName() + ".class)")
.getBindings();
}
项目:xtext-core
文件:Reader.java
@Override
protected void invokeInternal(WorkflowContext ctx,ProgressMonitor monitor,Issues issues) {
ResourceSet resourceSet = getResourceSet();
Multimap<String,URI> uris = getPathTraverser().resolvePathes(pathes,new Predicate<URI>() {
@Override
public boolean apply(URI input) {
boolean result = true;
if (getUriFilter() != null)
result = getUriFilter().matches(input);
if (result)
result = getRegistry().getResourceServiceProvider(input) != null;
return result;
}
});
IAllContaineRSState containeRSState = containeRSStateFactory.getContaineRSState(pathes,uris);
installAsAdapter(resourceSet,containeRSState);
populateResourceSet(resourceSet,uris);
getValidator().validate(resourceSet,getRegistry(),issues);
addModelElementsToContext(ctx,resourceSet);
}
@Override
protected void invokeInternal(WorkflowContext ctx,Issues issues) {
ResourceSet resourceSet = getResourceSet();
// due to some xcore peculiarity we have to access the IAllContainerState here
// to trigger some lazy init logic
IAllContaineRSState allContainerState = (IAllContaineRSState) EcoreUtil.getAdapter(resourceSet.eAdapters(),IAllContaineRSState.class);
allContainerState.isEmpty("");
Multimap<String,new Predicate<URI>() {
@Override
public boolean apply(URI input) {
return input.fileExtension().equals(xcore_FILE_EXT);
}
});
List<Resource> resources = new ArrayList<>();
for (URI uri : uris.values()) {
LOGGER.info(uri);
try {
resources.add(parse(uri,resourceSet));
} catch (Exception e) {
LOGGER.error("Problem during loading of resource @ " + uri,e);
}
}
installIndex(resourceSet);
for (Resource r : resources) {
EcoreUtil.resolveAll(r);
for (Diagnostic x : r.getErrors()) {
issues.addError(x.getMessage(),x);
}
}
ctx.set(slot,resources);
}
项目:xtext-extras
文件:ImplicitUiFragment.java
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
BindFactory bindFactory = new BindFactory()
.addTypetoProviderInstance(
IAllContaineRSState.class.getName(),"org.eclipse.xtext.ui.shared.Access.getJavaProjectsstate()");
if (XbaseGeneratorFragment.doesUseXbase(grammar)) {
bindFactory = bindFactory.addTypetoType("org.eclipse.xtext.ui.editor.XtextEditor","org.eclipse.xtext.xbase.ui.editor.XbaseEditor");
bindFactory = bindFactory.addTypetoType("org.eclipse.xtext.ui.editor.model.XtextDocumentProvider","org.eclipse.xtext.xbase.ui.editor.XbaseDocumentProvider");
bindFactory = bindFactory.addTypetoType("org.eclipse.xtext.ui.generator.trace.OpenGeneratedFileHandler","org.eclipse.xtext.xbase.ui.generator.trace.XbaSEOpenGeneratedFileHandler");
}
return bindFactory.getBindings();
}
public ResourceSet getinitializedResourceSet(List<String> pathes,UriFilter filter) {
ResourceSet resourceSet = resourceSetProvider.get();
Multimap<String,URI> pathToUriMap = getPathToUriMap(pathes,filter);
IAllContaineRSState containeRSState = factory.getContaineRSState(pathes,pathToUriMap);
resourceSet.eAdapters().add(new DelegatingIAllContainerAdapter(containeRSState));
for (URI uri : pathToUriMap.values()) {
resourceSet.createResource(uri);
}
return resourceSet;
}
项目:pokemon-tcgo-deck-generator
文件:AbstractPkmntcgoRuntimeModule.java
项目:pokemon-tcgo-deck-generator
文件:AbstractPkmntcgoUiModule.java
/**
* Bind a custom IAllContainerState in a testing context. See {@link N4JSTestsAllContainerState} for an explanation.
*/
public Class<? extends IAllContaineRSState.Provider> bindAllContainerState() {
return N4JSTestsAllContainerState.Provider.class;
}
项目:n4js
文件:N4JSTestsAllContainerState.java
@Override
public IAllContaineRSState get(IResourceDescriptions context) {
return new N4JSTestsAllContainerState(this.getResourceSet(context));
}
项目:n4js
文件:AbstractRegularExpressionRuntimeModule.java
项目:n4js
文件:AbstractN4JSUiModule.java
@Override
public IAllContaineRSState get() {
return instance;
}
项目:n4js
文件:N4JSUiModule.java
项目:n4js
文件:AbstractRegularExpressionUiModule.java
项目:n4js
文件:AbstractN4JSRuntimeModule.java
项目:n4js
文件:AbstractN4MFUiModule.java
项目:n4js
文件:AbstractN4MFRuntimeModule.java
项目:n4js
文件:AbstractTypeExpressionsUiModule.java
项目:n4js
文件:AbstractTypesUiModule.java
项目:Xtext_Xtend_HTML_Generator
文件:AbstractMyDslUiModule.java
项目:Xtext_Xtend_HTML_Generator
文件:AbstractMyDslRuntimeModule.java
项目:gw4e.project
文件:AbstractDSLPoliciesUiModule.java
项目:gw4e.project
文件:AbstractDSLPoliciesRuntimeModule.java
项目:lcdsl
文件:AbstractLcDslUiModule.java
项目:lcdsl
文件:AbstractLcDslRuntimeModule.java
项目:org.xtext.dsl.restaurante
文件:AbstractRestauranteRuntimeModule.java
项目:org.xtext.dsl.restaurante
文件:AbstractRestauranteUiModule.java
项目:xtext-extras
文件:AbstractPureXbaseRuntimeModule.java
项目:xtext-extras
文件:AbstractXbaseRuntimeModule.java
项目:xtext-extras
文件:AbstractXbaseWithAnnotationsRuntimeModule.java
项目:xtext-extras
文件:AbstractBuilderTestLanguageRuntimeModule.java
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。