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


Java IPresentationRepairer类代码示例

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


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

示例1: getPresentationReconciler

import org.eclipse.jface.text.presentation.IPresentationRepairer; //导入依赖的package包/类
@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
	XtextPresentationReconciler reconciler = getPresentationReconcilerProvider().get();
	reconciler.setDocumentPartitioning(getDocumentPartitioning(sourceViewer));
	IPresentationRepairer repairer = repairerProvider.get();
	IPresentationDamager damager = damagerProvider.get();
	String[] types = partitionTypesMapper.getSupportedPartitionTypes();
	for (String partitionType : types) {
		reconciler.setRepairer(repairer, partitionType);
		reconciler.setDamager(damager, partitionType);
	}
	return reconciler;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:14,代码来源:XtextSourceViewerConfiguration.java

示例2: getRepairer

import org.eclipse.jface.text.presentation.IPresentationRepairer; //导入依赖的package包/类
@Override
public IPresentationRepairer getRepairer(String contentType) {
	return null;
}
 
开发者ID:eclipse,项目名称:tm4e,代码行数:5,代码来源:TMPresentationReconciler.java

示例3: bindIPresentationRepairer

import org.eclipse.jface.text.presentation.IPresentationRepairer; //导入依赖的package包/类
public Class<? extends IPresentationRepairer> bindIPresentationRepairer() {
	return PresentationRepairer.class;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:4,代码来源:DefaultUiModule.java

示例4: createPresentation

import org.eclipse.jface.text.presentation.IPresentationRepairer; //导入依赖的package包/类
protected TextPresentation createPresentation(IRegion damage, IDocument document, IProgressMonitor monitor)
{
	try
	{
		int damageOffset = damage.getOffset();
		int damageLength = damage.getLength();
		if (damageOffset + damageLength > document.getLength())
		{
			int adjustedLength = document.getLength() - damageOffset;
			synchronized (this)
			{
				delayedRegions.remove(new Region(document.getLength(), damageLength - adjustedLength));
			}
			if (adjustedLength <= 0)
			{
				return null;
			}
			damageLength = adjustedLength;
		}
		TextPresentation presentation = new TextPresentation(damage, iterationPartitionLimit * 5);
		ITypedRegion[] partitioning = TextUtilities.computePartitioning(document, getDocumentPartitioning(),
				damageOffset, damageLength, false);
		if (partitioning.length == 0)
		{
			return presentation;
		}
		int limit = Math.min(iterationPartitionLimit, partitioning.length);
		int processingLength = partitioning[limit - 1].getOffset() + partitioning[limit - 1].getLength()
				- damageOffset;
		if (EclipseUtil.showSystemJobs())
		{
			monitor.subTask(MessageFormat.format(
					"processing region at offset {0}, length {1} in document of length {2}", damageOffset, //$NON-NLS-1$
					processingLength, document.getLength()));
		}

		for (int i = 0; i < limit; ++i)
		{
			ITypedRegion r = partitioning[i];
			IPresentationRepairer repairer = getRepairer(r.getType());
			if (monitor.isCanceled())
			{
				return null;
			}
			if (repairer != null)
			{
				repairer.createPresentation(presentation, r);
			}
			monitor.worked(r.getLength());
		}

		synchronized (this)
		{
			delayedRegions.remove(new Region(damageOffset, processingLength));
			if (limit < partitioning.length)
			{
				int offset = partitioning[limit].getOffset();
				delayedRegions.append(new Region(offset, damageOffset + damageLength - offset));
			}
		}
		return presentation;
	}
	catch (BadLocationException e)
	{
		return null;
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:68,代码来源:CommonPresentationReconciler.java


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