当前位置: 首页>>代码示例>>Java>>正文


Java DefaultResourceDescriptionManager类代码示例

本文整理汇总了Java中org.eclipse.xtext.resource.impl.DefaultResourceDescriptionManager的典型用法代码示例。如果您正苦于以下问题:Java DefaultResourceDescriptionManager类的具体用法?Java DefaultResourceDescriptionManager怎么用?Java DefaultResourceDescriptionManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DefaultResourceDescriptionManager类属于org.eclipse.xtext.resource.impl包,在下文中一共展示了DefaultResourceDescriptionManager类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import org.eclipse.xtext.resource.impl.DefaultResourceDescriptionManager; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	EObject copy = EcoreUtil.copy(EcorePackage.eINSTANCE);
	resource = new ResourceImpl();
	resource.getContents().add(copy);
	IQualifiedNameProvider nameProvider = new IQualifiedNameProvider.AbstractImpl() {
		@Override
		public QualifiedName getFullyQualifiedName(EObject obj) {
			if (obj instanceof ENamedElement)
				return QualifiedName.create(((ENamedElement) obj).getName());
			return null;
		}
	};
	DefaultResourceDescriptionStrategy descriptionStrategy = new DefaultResourceDescriptionStrategy();
	descriptionStrategy.setQualifiedNameProvider(nameProvider);
	resourceDescription = new DefaultResourceDescription(resource, descriptionStrategy) {
		@Override
		public Iterable<QualifiedName> getImportedNames() {
			return importedNames;
		}
	};
	manager = new DefaultResourceDescriptionManager();
	importedNames = Collections.emptySet();
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:25,代码来源:DefaultResourceDescriptionManagerTest.java

示例2: setUp

import org.eclipse.xtext.resource.impl.DefaultResourceDescriptionManager; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
	super.setUp();
	with(new IndexTestLanguageStandaloneSetup());

	globalScopeProvider = new ResourceSetGlobalScopeProvider();
	nameProvider = new DefaultDeclarativeQualifiedNameProvider();
	nameConverter = new IQualifiedNameConverter.DefaultImpl();
	final DefaultResourceDescriptionStrategy strategy = new DefaultResourceDescriptionStrategy();
	strategy.setQualifiedNameProvider(nameProvider);
	final DefaultResourceDescriptionManager resourceDescMnr = new DefaultResourceDescriptionManager() {
		@Override
		public IResourceDescription getResourceDescription(Resource resource) {
			DefaultResourceDescription resourceDescription = new DefaultResourceDescription(resource,
					strategy);
			return resourceDescription;
		}
		
	};
	final DefaultResourceServiceProvider provider = new DefaultResourceServiceProvider() {
		@Override
		public Manager getResourceDescriptionManager() {
			return resourceDescMnr;
		}
	};
	globalScopeProvider.setGlobalResourceDecriptionProvider(new GlobalResourceDescriptionProvider(new ResourceServiceProviderRegistryImpl() {
		@Override
		public IResourceServiceProvider getResourceServiceProvider(URI uri, String contentType) {
			return provider;
		}
	}));
	CaseInsensitivityHelper caseInsensitivityHelper = new CaseInsensitivityHelper();
	globalScopeProvider.setCaseInsensitivityHelper(caseInsensitivityHelper);
	scopeProvider = new ImportedNamespaceAwareLocalScopeProvider(globalScopeProvider, nameProvider, nameConverter, caseInsensitivityHelper);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:36,代码来源:ImportedNamespaceAwareLocalScopeProviderTest.java


注:本文中的org.eclipse.xtext.resource.impl.DefaultResourceDescriptionManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。