當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。