本文整理汇总了Java中com.intellij.openapi.wm.ex.ProgressIndicatorEx类的典型用法代码示例。如果您正苦于以下问题:Java ProgressIndicatorEx类的具体用法?Java ProgressIndicatorEx怎么用?Java ProgressIndicatorEx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProgressIndicatorEx类属于com.intellij.openapi.wm.ex包,在下文中一共展示了ProgressIndicatorEx类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dropResolveCacheRegularly
import com.intellij.openapi.wm.ex.ProgressIndicatorEx; //导入依赖的package包/类
private static void dropResolveCacheRegularly(ProgressIndicator indicator, final Project project) {
if (indicator instanceof ProgressIndicatorEx) {
((ProgressIndicatorEx)indicator).addStateDelegate(new ProgressIndicatorBase() {
volatile long lastCleared = System.currentTimeMillis();
public void setFraction(double fraction) {
super.setFraction(fraction);
long current = System.currentTimeMillis();
if (current - this.lastCleared >= 500L) {
this.lastCleared = current;
PsiManager.getInstance(project).dropResolveCaches();
}
}
});
}
}
示例2: runSingleTask
import com.intellij.openapi.wm.ex.ProgressIndicatorEx; //导入依赖的package包/类
private static void runSingleTask(final DumbModeTask task, final ProgressIndicatorEx taskIndicator) {
if (ApplicationManager.getApplication().isInternal()) LOG.info("Running dumb mode task: " + task);
// nested runProcess is needed for taskIndicator to be honored in ProgressManager.checkCanceled calls deep inside tasks
ProgressManager.getInstance().runProcess(new Runnable() {
@Override
public void run() {
try {
taskIndicator.checkCanceled();
taskIndicator.setIndeterminate(true);
taskIndicator.setText(IdeBundle.message("progress.indexing.scanning"));
task.performInDumbMode(taskIndicator);
}
catch (ProcessCanceledException ignored) {
}
catch (Throwable unexpected) {
LOG.error(unexpected);
}
}
}, taskIndicator);
}
示例3: addProgress
import com.intellij.openapi.wm.ex.ProgressIndicatorEx; //导入依赖的package包/类
public void addProgress(@NotNull ProgressIndicatorEx original, @NotNull TaskInfo info) {
synchronized (myOriginals) {
final boolean veryFirst = !hasProgressIndicators();
myOriginals.add(original);
myInfos.add(info);
final InlineProgressIndicator expanded = createInlineDelegate(info, original, false);
final InlineProgressIndicator compact = createInlineDelegate(info, original, true);
myPopup.addIndicator(expanded);
myProgressIcon.resume();
if (veryFirst && !myPopup.isShowing()) {
buildInInlineIndicator(compact);
}
else {
buildInProcessCount();
if (myInfos.size() > 1 && Registry.is("ide.windowSystem.autoShowProcessPopup")) {
openProcessPopup(false);
}
}
runQuery();
}
}
示例4: removeFromMaps
import com.intellij.openapi.wm.ex.ProgressIndicatorEx; //导入依赖的package包/类
private ProgressIndicatorEx removeFromMaps(@NotNull InlineProgressIndicator progress) {
final ProgressIndicatorEx original = myInline2Original.get(progress);
myInline2Original.remove(progress);
synchronized (myDirtyIndicators) {
myDirtyIndicators.remove(progress);
}
myOriginal2Inlines.remove(original, progress);
if (myOriginal2Inlines.get(original) == null) {
final int originalIndex = myOriginals.indexOf(original);
myOriginals.remove(originalIndex);
myInfos.remove(originalIndex);
}
return original;
}
示例5: finish
import com.intellij.openapi.wm.ex.ProgressIndicatorEx; //导入依赖的package包/类
@Override
public void finish(@NotNull final TaskInfo task) {
WeakList<TaskInfo> finished = myFinished;
if (finished == null) {
synchronized (this) {
finished = myFinished;
if (finished == null) {
myFinished = finished = new WeakList<TaskInfo>();
}
}
}
if (!finished.addIfAbsent(task)) return;
delegateRunningChange(new IndicatorAction() {
@Override
public void execute(@NotNull final ProgressIndicatorEx each) {
each.finish(task);
}
});
}
示例6: run
import com.intellij.openapi.wm.ex.ProgressIndicatorEx; //导入依赖的package包/类
@Override
public void run() {
try {
getTask().run(myIndicator);
}
finally {
try {
if (myIndicator instanceof ProgressIndicatorEx) {
((ProgressIndicatorEx)myIndicator).finish(getTask());
}
}
finally {
if (myContinuation != null) {
myContinuation.run();
}
}
}
}
示例7: dropResolveCacheRegularly
import com.intellij.openapi.wm.ex.ProgressIndicatorEx; //导入依赖的package包/类
private static void dropResolveCacheRegularly(ProgressIndicator indicator, @NotNull final Project project) {
if (indicator instanceof ProgressIndicatorEx) {
((ProgressIndicatorEx)indicator).addStateDelegate(new ProgressIndicatorBase() {
volatile long lastCleared = System.currentTimeMillis();
@Override
public void setFraction(double fraction) {
super.setFraction(fraction);
long current = System.currentTimeMillis();
if (current - lastCleared >= 500) {
lastCleared = current;
// fraction is changed when each file is processed =>
// resolve caches used when searching in that file are likely to be not needed anymore
PsiManager.getInstance(project).dropResolveCaches();
}
}
});
}
}
示例8: addProgress
import com.intellij.openapi.wm.ex.ProgressIndicatorEx; //导入依赖的package包/类
public void addProgress(final ProgressIndicatorEx original, TaskInfo info) {
synchronized (myOriginals) {
final boolean veryFirst = !hasProgressIndicators();
myOriginals.add(original);
myInfos.add(info);
final InlineProgressIndicator expanded = createInlineDelegate(info, original, false);
final InlineProgressIndicator compact = createInlineDelegate(info, original, true);
myPopup.addIndicator(expanded);
myProgressIcon.resume();
if (veryFirst && !myPopup.isShowing()) {
buildInInlineIndicator(compact);
}
else {
buildInProcessCount();
if (myInfos.size() > 1 && Registry.is("ide.windowSystem.autoShowProcessPopup")) {
openProcessPopup(false);
}
}
runQuery();
}
}
示例9: runProcess
import com.intellij.openapi.wm.ex.ProgressIndicatorEx; //导入依赖的package包/类
@Override
public void runProcess(@NotNull final Runnable process, final ProgressIndicator progress) {
executeProcessUnderProgress(new Runnable(){
@Override
public void run() {
try {
if (progress != null && !progress.isRunning()) {
progress.start();
}
process.run();
maybeSleep();
}
finally {
if (progress != null && progress.isRunning()) {
progress.stop();
if (progress instanceof ProgressIndicatorEx) {
((ProgressIndicatorEx)progress).processFinish();
}
}
}
}
},progress);
}
示例10: dropResolveCacheRegularly
import com.intellij.openapi.wm.ex.ProgressIndicatorEx; //导入依赖的package包/类
private static void dropResolveCacheRegularly(ProgressIndicator indicator, final Project project) {
if (indicator instanceof ProgressIndicatorEx) {
((ProgressIndicatorEx)indicator).addStateDelegate(new ProgressIndicatorBase() {
volatile long lastCleared = System.currentTimeMillis();
@Override
public void setFraction(double fraction) {
super.setFraction(fraction);
long current = System.currentTimeMillis();
if (current - lastCleared >= 500) {
lastCleared = current;
// fraction is changed when each file is processed =>
// resolve caches used when searching in that file are likely to be not needed anymore
PsiManager.getInstance(project).dropResolveCaches();
}
}
});
}
}
示例11: runSingleTask
import com.intellij.openapi.wm.ex.ProgressIndicatorEx; //导入依赖的package包/类
private static void runSingleTask(final DumbModeTask task, final ProgressIndicatorEx taskIndicator) {
if (ApplicationManager.getApplication().isInternal()) LOG.info("Running dumb mode task: " + task);
// nested runProcess is needed for taskIndicator to be honored in ProgressManager.checkCanceled calls deep inside tasks
ProgressManager.getInstance().runProcess(() -> {
try {
taskIndicator.checkCanceled();
taskIndicator.setIndeterminate(true);
taskIndicator.setText(IdeBundle.message("progress.indexing.scanning"));
task.performInDumbMode(taskIndicator);
}
catch (ProcessCanceledException ignored) {
}
catch (Throwable unexpected) {
LOG.error(unexpected);
}
}, taskIndicator);
}
示例12: getNextTask
import com.intellij.openapi.wm.ex.ProgressIndicatorEx; //导入依赖的package包/类
@Nullable
private Pair<DumbModeTask, ProgressIndicatorEx> getNextTask(@Nullable DumbModeTask prevTask, @Nonnull ProgressIndicator indicator) {
CompletableFuture<Pair<DumbModeTask, ProgressIndicatorEx>> result = new CompletableFuture<>();
UIUtil.invokeLaterIfNeeded(() -> {
if (myProject.isDisposed()) {
result.completeExceptionally(new ProcessCanceledException());
return;
}
if (prevTask != null) {
Disposer.dispose(prevTask);
}
if (PowerSaveMode.isEnabled() && Registry.is("pause.indexing.in.power.save.mode")) {
indicator.setText("Indexing paused during Power Save mode...");
runWhenPowerSaveModeChanges(() -> result.complete(pollTaskQueue()));
completeWhenProjectClosed(result);
} else {
result.complete(pollTaskQueue());
}
});
return waitForFuture(result);
}
示例13: pollTaskQueue
import com.intellij.openapi.wm.ex.ProgressIndicatorEx; //导入依赖的package包/类
@Nullable
private Pair<DumbModeTask, ProgressIndicatorEx> pollTaskQueue() {
while (true) {
if (myUpdatesQueue.isEmpty()) {
queueUpdateFinished();
return null;
}
DumbModeTask queuedTask = myUpdatesQueue.pullFirst();
myQueuedEquivalences.remove(queuedTask.getEquivalenceObject());
ProgressIndicatorEx indicator = myProgresses.get(queuedTask);
if (indicator.isCanceled()) {
Disposer.dispose(queuedTask);
continue;
}
return Pair.create(queuedTask, indicator);
}
}
示例14: addProgress
import com.intellij.openapi.wm.ex.ProgressIndicatorEx; //导入依赖的package包/类
void addProgress(@Nonnull ProgressIndicatorEx original, @Nonnull TaskInfo info) {
synchronized (myOriginals) {
final boolean veryFirst = !hasProgressIndicators();
myOriginals.add(original);
myInfos.add(info);
MyInlineProgressIndicator expanded = createInlineDelegate(info, original, false);
MyInlineProgressIndicator compact = createInlineDelegate(info, original, true);
myPopup.addIndicator(expanded);
updateProgressIcon();
if (veryFirst && !myPopup.isShowing()) {
buildInInlineIndicator(compact);
}
else {
buildInProcessCount();
if (myInfos.size() > 1 && Registry.is("ide.windowSystem.autoShowProcessPopup")) {
openProcessPopup(false);
}
}
runQuery();
}
}
示例15: removeFromMaps
import com.intellij.openapi.wm.ex.ProgressIndicatorEx; //导入依赖的package包/类
private ProgressIndicatorEx removeFromMaps(@Nonnull MyInlineProgressIndicator progress) {
final ProgressIndicatorEx original = myInline2Original.get(progress);
myInline2Original.remove(progress);
synchronized (myDirtyIndicators) {
myDirtyIndicators.remove(progress);
}
myOriginal2Inlines.remove(original, progress);
if (myOriginal2Inlines.get(original) == null) {
final int originalIndex = myOriginals.indexOf(original);
myOriginals.remove(originalIndex);
myInfos.remove(originalIndex);
}
return original;
}