本文整理汇总了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;
}
示例2: getRepairer
import org.eclipse.jface.text.presentation.IPresentationRepairer; //导入依赖的package包/类
@Override
public IPresentationRepairer getRepairer(String contentType) {
return null;
}
示例3: bindIPresentationRepairer
import org.eclipse.jface.text.presentation.IPresentationRepairer; //导入依赖的package包/类
public Class<? extends IPresentationRepairer> bindIPresentationRepairer() {
return PresentationRepairer.class;
}
示例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;
}
}