当前位置: 首页>>代码示例>>Java>>正文


Java ProgressIndicatorEx类代码示例

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

            }
        });
    }

}
 
开发者ID:niorgai,项目名称:Android-Resource-Usage-Count,代码行数:19,代码来源:FindUsageUtils.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:DumbServiceImpl.java

示例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();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:InfoAndProgressPanel.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:InfoAndProgressPanel.java

示例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);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:AbstractProgressIndicatorExBase.java

示例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();
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:CoreProgressManager.java

示例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();
        }
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:FindUsagesManager.java

示例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();
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:27,代码来源:InfoAndProgressPanel.java

示例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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:ProgressManagerImpl.java

示例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();
        }
      }
    });
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:FindUsagesManager.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:DumbServiceImpl.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:DumbServiceImpl.java

示例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);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:DumbServiceImpl.java

示例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();
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:27,代码来源:InfoAndProgressPanel.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:InfoAndProgressPanel.java


注:本文中的com.intellij.openapi.wm.ex.ProgressIndicatorEx类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。