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


Java TextEdit.getCoverage方法代码示例

本文整理汇总了Java中org.eclipse.text.edits.TextEdit.getCoverage方法的典型用法代码示例。如果您正苦于以下问题:Java TextEdit.getCoverage方法的具体用法?Java TextEdit.getCoverage怎么用?Java TextEdit.getCoverage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.text.edits.TextEdit的用法示例。


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

示例1: getEditChangeOffsetUpdates

import org.eclipse.text.edits.TextEdit; //导入方法依赖的package包/类
/**
 * @param change
 * @return Map <Integer oldOffset, Integer updatedOffset>
 */
private static Map<Integer, Integer> getEditChangeOffsetUpdates(TextChange change) {
  TextEditChangeGroup[] editChanges = change.getTextEditChangeGroups();
  Map<Integer, Integer> offsetUpdates = new HashMap<Integer, Integer>(editChanges.length);
  for (int i = 0; i < editChanges.length; i++) {
    TextEditChangeGroup editChange = editChanges[i];
    IRegion oldRegion = editChange.getRegion();
    if (oldRegion == null) continue;
    IRegion updatedRegion =
        TextEdit.getCoverage(change.getPreviewEdits(editChange.getTextEdits()));
    if (updatedRegion == null) continue;

    offsetUpdates.put(new Integer(oldRegion.getOffset()), new Integer(updatedRegion.getOffset()));
  }
  return offsetUpdates;
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:RenameAnalyzeUtil.java

示例2: getNewRegion

import org.eclipse.text.edits.TextEdit; //导入方法依赖的package包/类
private IRegion getNewRegion(TextEditBasedChangeGroup[] changes) {
  if (changes == ALL_EDITS) {
    if (fEdit == null) return null;
    return fCopier.getCopy(fEdit).getRegion();
  } else {
    List result = new ArrayList();
    for (int c = 0; c < changes.length; c++) {
      TextEdit[] edits = changes[c].getTextEditGroup().getTextEdits();
      for (int e = 0; e < edits.length; e++) {
        TextEdit copy = fCopier.getCopy(edits[e]);
        if (copy != null) result.add(copy);
      }
    }
    if (result.size() == 0) return null;
    return TextEdit.getCoverage((TextEdit[]) result.toArray(new TextEdit[result.size()]));
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:TextChange.java

示例3: getCorrespondingEditChangeRange

import org.eclipse.text.edits.TextEdit; //导入方法依赖的package包/类
private static IRegion getCorrespondingEditChangeRange(
    SearchMatch searchResult, TextChangeManager manager) {
  TextChange change = getTextChange(searchResult, manager);
  if (change == null) return null;

  IRegion oldMatchRange = createTextRange(searchResult);
  TextEditChangeGroup[] editChanges = change.getTextEditChangeGroups();
  for (int i = 0; i < editChanges.length; i++) {
    if (oldMatchRange.equals(editChanges[i].getRegion()))
      return TextEdit.getCoverage(change.getPreviewEdits(editChanges[i].getTextEdits()));
  }
  return null;
}
 
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:RenameAnalyzeUtil.java

示例4: getRegion

import org.eclipse.text.edits.TextEdit; //导入方法依赖的package包/类
private IRegion getRegion(TextEditBasedChangeGroup[] changes) {
  if (changes == ALL_EDITS) {
    if (fEdit == null) return null;
    return fEdit.getRegion();
  } else {
    List edits = new ArrayList();
    for (int i = 0; i < changes.length; i++) {
      edits.addAll(Arrays.asList(changes[i].getTextEditGroup().getTextEdits()));
    }
    if (edits.size() == 0) return null;
    return TextEdit.getCoverage((TextEdit[]) edits.toArray(new TextEdit[edits.size()]));
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:TextChange.java


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