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


Java CurrentDescriptions类代码示例

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


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

示例1: setContext

import org.eclipse.xtext.builder.clustering.CurrentDescriptions; //导入依赖的package包/类
/**
 * Set the context.
 * 
 * @param ctx
 *          The context
 */
@Override
public void setContext(final Notifier ctx) {
  super.setContext(ctx);
  final ResourceSet resourceSet = EcoreUtil2.getResourceSet(ctx);
  IResourceDescriptions adapter = (IResourceDescriptions) EcoreUtil2.getAdapter(resourceSet.eAdapters(), CurrentDescriptions.class);
  if (adapter instanceof IResourceDescriptions2) {
    delegate = (IResourceDescriptions2) adapter;
  } else {
    delegate = new ResourceDescriptions2(adapter);
  }
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:18,代码来源:CurrentDescriptions2.java

示例2: configureIResourceDescriptionsBuilderScope

import org.eclipse.xtext.builder.clustering.CurrentDescriptions; //导入依赖的package包/类
public void configureIResourceDescriptionsBuilderScope(Binder binder) {
	binder.bind(IResourceDescriptions.class).annotatedWith(Names.named(ResourceDescriptionsProvider.NAMED_BUILDER_SCOPE)).to(CurrentDescriptions.ResourceSetAware.class);
}
 
开发者ID:rehne93,项目名称:pokemon-tcgo-deck-generator,代码行数:4,代码来源:AbstractPkmntcgoUiModule.java

示例3: queueAffectedResources

import org.eclipse.xtext.builder.clustering.CurrentDescriptions; //导入依赖的package包/类
/**
 * Overriding this method to make sure that resources of all affected URIs are fully re-loaded if needed, instead of
 * only loading the TModule from the corresponding resource description.
 * <p>
 * This is required in case the URIs in an affected resource contain indices of a changed resource; just loading the
 * TModule from the user data won't update these indices. For details see the example provided in IDEBUG-347.
 * <p>
 * NOTE: this should be removed once the URI scheme has been changed to use names instead of indices.
 */
@Override
protected void queueAffectedResources(
		Set<URI> allRemainingURIs,
		IResourceDescriptions oldState,
		CurrentDescriptions newState,
		Collection<Delta> changedDeltas,
		Collection<Delta> allDeltas,
		BuildData buildData,
		final IProgressMonitor monitor) {

	// don't wanna copy super-class method, so using this helper to get the set of affected URIs:
	final Set<URI> affectedURIs = new HashSet<>(allRemainingURIs);

	super.queueAffectedResources(allRemainingURIs, oldState, newState, changedDeltas, allDeltas, buildData,
			monitor);

	// affected URIs have been removed from allRemainingURIs by super class
	affectedURIs.removeAll(allRemainingURIs);

	for (URI currAffURI : affectedURIs) {
		final IResourceDescription resDesc = this.getResourceDescription(currAffURI);
		if (!N4MF_MANIFEST.equals(currAffURI.lastSegment())) {

			/*-
			 * This logic here is required to get rid of the invalid serialized TModules information from the index
			 * which are working with an index based approach. Consider the below example:
			 *
			 * -------Module A------
			 *1    //class XYZ { }
			 *2    function foo() { }
			 *3    export public class A { }
			 *
			 * -------Module B------
			 *1    import { A } from "A"
			 *2    import { C } from "C"
			 *3
			 *4    var arrCC : Array<A>;
			 *5    var t2 : C = new C();
			 *6    t2.m(arrCC);
			 *
			 * -------Module C------
			 *1    import { A } from "A"
			 *2
			 *3    export public class C {
			 *4        m(param : Array<A>) { }
			 *5    }
			 *
			 *
			 * Commenting out line 1 in module A will trigger rebuild of A, and related module B and C in this order.
			 * When loading module B, module C has to be resolved as it imports it, quickly jump to module C and load
			 * class A from module A, class A used to have index 1 (in the serialized TModule in the Xtext index) as
			 * it was the second top level element, but that is not true any more, because 'foo' was just commented out,
			 * so index 1 in module A is not class A any more but 'foo'. With this, line 6 in module B will fail,
			 * because it will think that the method 'm' accepts an array of 'foo' and not A any more.
			 *
			 * The following code will be executed after A was processed and B and C are the "affectedURIs". With this
			 * code, we make sure that the cached TModule of C (in the user data of C's resource description) won't be
			 * used while processing B during proxy resolution.
			 */
			newState.register(new DefaultResourceDescriptionDelta(resDesc,
					new ResourceDescriptionWithoutModuleUserData(resDesc)));
		}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:74,代码来源:N4JSGenerateImmediatelyBuilderState.java


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