本文整理汇总了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;
}
}
示例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);
}
示例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);
}
}