本文整理匯總了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);
}
}