当前位置: 首页>>代码示例>>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;未经允许,请勿转载。