當前位置: 首頁>>代碼示例>>Java>>正文


Java DumbProgressIndicator類代碼示例

本文整理匯總了Java中com.intellij.openapi.progress.DumbProgressIndicator的典型用法代碼示例。如果您正苦於以下問題:Java DumbProgressIndicator類的具體用法?Java DumbProgressIndicator怎麽用?Java DumbProgressIndicator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DumbProgressIndicator類屬於com.intellij.openapi.progress包,在下文中一共展示了DumbProgressIndicator類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: calcPatchInnerDifferences

import com.intellij.openapi.progress.DumbProgressIndicator; //導入依賴的package包/類
@Nullable
private static List<DiffFragment> calcPatchInnerDifferences(@Nonnull PatchChangeBuilder.Hunk hunk,
                                                            @Nonnull ApplyPatchViewer viewer) {
  LineRange deletionRange = hunk.getPatchDeletionRange();
  LineRange insertionRange = hunk.getPatchInsertionRange();

  if (deletionRange.isEmpty() || insertionRange.isEmpty()) return null;

  try {
    DocumentEx patchDocument = viewer.getPatchEditor().getDocument();
    CharSequence deleted = DiffUtil.getLinesContent(patchDocument, deletionRange.start, deletionRange.end);
    CharSequence inserted = DiffUtil.getLinesContent(patchDocument, insertionRange.start, insertionRange.end);

    return ByWord.compare(deleted, inserted, ComparisonPolicy.DEFAULT, DumbProgressIndicator.INSTANCE);
  }
  catch (DiffTooBigException ignore) {
    return null;
  }
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:20,代碼來源:ApplyPatchChange.java

示例2: GtFetcher

import com.intellij.openapi.progress.DumbProgressIndicator; //導入依賴的package包/類
private GtFetcher(@NotNull Project project, @NotNull ProgressIndicator progress, Builder builder) {
  this.project = Preconditions.checkNotNull(project, "Null Project");
  progressIndicator = progress;
  fetcher = new GitFetcher(this.project, DumbProgressIndicator.INSTANCE, builder.fetchAll);
  repositoryManager = GitUtil.getRepositoryManager(this.project);
}
 
開發者ID:zielu,項目名稱:GitToolBox,代碼行數:7,代碼來源:GtFetcher.java

示例3: createPreviousBlock

import com.intellij.openapi.progress.DumbProgressIndicator; //導入依賴的package包/類
@Nonnull
public Block createPreviousBlock(@Nonnull String[] prevContent) {
  int start = -1;
  int end = -1;
  int shift = 0;

  try {
    FairDiffIterable iterable = ByLine.compare(Arrays.asList(prevContent), Arrays.asList(mySource),
                                               ComparisonPolicy.IGNORE_WHITESPACES, DumbProgressIndicator.INSTANCE);

    for (Pair<Range, Boolean> pair : DiffIterableUtil.iterateAll(iterable)) {
      Boolean equals = pair.second;
      Range range = pair.first;
      if (!equals) {
        if (Math.max(myStart, range.start2) < Math.min(myEnd, range.end2)) {
          // ranges intersect
          if (range.start2 <= myStart) start = range.start1;
          if (range.end2 > myEnd) end = range.end1;
        }
        if (range.start2 > myStart) {
          if (start == -1) start = myStart - shift;
          if (end == -1 && range.start2 >= myEnd) end = myEnd - shift;
        }

        shift += (range.end2 - range.start2) - (range.end1 - range.start1);
      }
      else {
        // intern strings, reducing memory usage
        int count = range.end1 - range.start1;
        for (int i = 0; i < count; i++) {
          int prevIndex = range.start1 + i;
          int sourceIndex = range.start2 + i;
          if (prevContent[prevIndex].equals(mySource[sourceIndex])) {
            prevContent[prevIndex] = mySource[sourceIndex];
          }
        }
      }
    }
    if (start == -1) start = myStart - shift;
    if (end == -1) end = myEnd - shift;

    if (start < 0 || end > prevContent.length || end < start) {
      LOG.error("Invalid block range: [" + start + ", " + end + "); length - " + prevContent.length);
    }

    return new Block(prevContent, start, end);
  }
  catch (DiffTooBigException e) {
    return new Block(prevContent, 0, 0);
  }
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:52,代碼來源:Block.java


注:本文中的com.intellij.openapi.progress.DumbProgressIndicator類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。