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


Java ProgressIndicator.setIndeterminate方法代码示例

本文整理汇总了Java中com.intellij.openapi.progress.ProgressIndicator.setIndeterminate方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressIndicator.setIndeterminate方法的具体用法?Java ProgressIndicator.setIndeterminate怎么用?Java ProgressIndicator.setIndeterminate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.progress.ProgressIndicator的用法示例。


在下文中一共展示了ProgressIndicator.setIndeterminate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@Override
public void execute(@NotNull final ProgressIndicator indicator, @NotNull ExternalSystemTaskNotificationListener... listeners) {
  indicator.setIndeterminate(true);
  ExternalSystemTaskNotificationListenerAdapter adapter = new ExternalSystemTaskNotificationListenerAdapter() {
    @Override
    public void onStatusChange(@NotNull ExternalSystemTaskNotificationEvent event) {
      indicator.setText(wrapProgressText(event.getDescription()));
    }
  };
  final ExternalSystemTaskNotificationListener[] ls;
  if (listeners.length > 0) {
    ls = ArrayUtil.append(listeners, adapter);
  }
  else {
    ls = new ExternalSystemTaskNotificationListener[]{adapter};
  }

  execute(ls);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:AbstractExternalSystemTask.java

示例2: cancel

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@Override
public boolean cancel(@NotNull final ProgressIndicator indicator, @NotNull ExternalSystemTaskNotificationListener... listeners) {
  indicator.setIndeterminate(true);
  ExternalSystemTaskNotificationListenerAdapter adapter = new ExternalSystemTaskNotificationListenerAdapter() {
    @Override
    public void onStatusChange(@NotNull ExternalSystemTaskNotificationEvent event) {
      indicator.setText(wrapProgressText(event.getDescription()));
    }
  };
  final ExternalSystemTaskNotificationListener[] ls;
  if (listeners.length > 0) {
    ls = ArrayUtil.append(listeners, adapter);
  }
  else {
    ls = new ExternalSystemTaskNotificationListener[]{adapter};
  }

  return cancel(ls);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:AbstractExternalSystemTask.java

示例3: init

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
protected final void init(@Nullable ProgressIndicator indicator, @Nullable Runnable componentsRegistered) {
  List<ComponentConfig> componentConfigs = getComponentConfigs();
  for (ComponentConfig config : componentConfigs) {
    registerComponents(config);
  }
  myComponentConfigCount = componentConfigs.size();

  if (componentsRegistered != null) {
    componentsRegistered.run();
  }

  if (indicator != null) {
    indicator.setIndeterminate(false);
  }
  createComponents(indicator);
  myComponentsCreated = true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ComponentManagerImpl.java

示例4: run

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
public void run(@NotNull ProgressIndicator indicator) {
  indicator.setIndeterminate(true);
  indicator.setText2(VcsBundle.message("commit.wait.util.synched.text"));
  synchronized (myLock) {
    if (myStarted) {
      LOG.error("Waiter running under progress being started again.");
      return;
    }
    myStarted = true;
    while (! myDone) {
      try {
        // every second check whether we are canceled
        myLock.wait(500);
      }
      catch (InterruptedException e) {
        // ok
      }
      indicator.checkCanceled();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:Waiter.java

示例5: run

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@Override
public void run(@NotNull ProgressIndicator indicator) {
  indicator.setIndeterminate(true);
  if (myJdkDetectionInProgress.compareAndSet(false, true)) {
    try {
      myPath = detectJdkPath(myCancelled);
    }
    finally {
      myJdkDetectionInProgress.set(false);
    }
  }
  while (myJdkDetectionInProgress.get()) {
    try {
      // Just wait until previously run detection completes (progress dialog is shown then)
      //noinspection BusyWait
      Thread.sleep(300);
    }
    catch (InterruptedException ignore) {
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:JdkDetection.java

示例6: runTask

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@NotNull
@Override
protected List<ExecutionException> runTask(@NotNull ProgressIndicator indicator) {
  final PyPackageManager manager = PyPackageManagers.getInstance().forSdk(mySdk);
  indicator.setIndeterminate(true);
  try {
    manager.uninstall(myPackages);
    return Collections.emptyList();
  }
  catch (ExecutionException e) {
    return Collections.singletonList(e);
  }
  finally {
    manager.refresh();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:PyPackageManagerUI.java

示例7: run

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@Override
public void run(@NotNull ProgressIndicator indicator) {
  indicator.setIndeterminate(true);
  while (!myFuture.isDone()) {
    try {
      myFuture.get(200, TimeUnit.MILLISECONDS);
    }
    catch (Exception ignored) {
      // all we need to know is whether the future completed or not..
    }

    if (indicator.isCanceled()) {
      return;
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:AndroidSdkUtils.java

示例8: run

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@Override
public void run(@NotNull final ProgressIndicator progressIndicator) {
    isRunning = true;
    progressIndicator.setIndeterminate(true);

    try {
        runAnalysis(progressIndicator);
    } catch (final ProcessCanceledException canceledException) {
        progressIndicator.cancel();
    } catch (final Exception exception) {
        showErrorNotification("Exception: " + exception.getMessage());
    }
}
 
开发者ID:arso8,项目名称:StAnalysisRunner,代码行数:14,代码来源:AnalysisTask.java

示例9: run

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@Override
public void run(@NotNull ProgressIndicator indicator) {
  indicator.setIndeterminate(true);
  myCheckInProgress.set(true);
  boolean isRemote = myTask.getLesson().getCourse() instanceof RemoteCourse;
  myResult = isRemote ? checkOnRemote() : myChecker.check();
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:8,代码来源:StudyCheckAction.java

示例10: beforeCompare

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@Override
protected void beforeCompare() {
  final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
  if (indicator != null) {
    indicator.setIndeterminate(true);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:FileWithBranchComparer.java

示例11: performInDumbMode

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@Override
public void performInDumbMode(ProgressIndicator indicator) {
  indicator.setIndeterminate(true);
  indicator.setText("Prefetching files...");
  while (!future.isCancelled() && !future.isDone()) {
    indicator.checkCanceled();
    TimeoutUtil.sleep(100);
  }
  long end = System.currentTimeMillis();
  logger.info(String.format("Initial prefetching took: %d ms", (end - startTimeMillis)));
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:12,代码来源:PrefetchProjectInitializer.java

示例12: initializeProgress

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
private void initializeProgress() {
  ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
  if (indicator != null) {
    indicator.setText(IdeBundle.message("loading.editors"));
    indicator.setText2("");
    indicator.setIndeterminate(false);
    indicator.setFraction(0);

    myProgressMaximum = countFiles(mySplittersElement);
    myCurrentProgress = 0;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:EditorsSplitters.java

示例13: download

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
private static void download(@NotNull String url, @NotNull File destination, @NotNull ProgressIndicator indicator) throws IOException {
  indicator.setText(String.format("Downloading %s", destination.getName()));
  HttpURLConnection connection = HttpConfigurable.getInstance().openHttpConnection(url);
  int contentLength = connection.getContentLength();
  if (contentLength <= 0) {
    indicator.setIndeterminate(true);
  }
  InputStream readStream = null;
  OutputStream stream = null;
  try {
    readStream = connection.getInputStream();
    //noinspection IOResourceOpenedButNotSafelyClosed
    stream = new BufferedOutputStream(new FileOutputStream(destination));
    byte[] buffer = new byte[2 * 1024 * 1024];
    int read;
    int totalRead = 0;
    final long startTime = System.currentTimeMillis();
    for (read = readStream.read(buffer); read > 0; read = readStream.read(buffer)) {
      totalRead += read;
      stream.write(buffer, 0, read);
      long duration = System.currentTimeMillis() - startTime; // Duration is in ms
      long downloadRate = duration == 0 ? 0 : (totalRead / duration);
      String message =
        String.format("Downloading %1$s (%2$s/s)", destination.getName(), WelcomeUIUtils.getSizeLabel(downloadRate * 1000));
      indicator.setText(message);
      if (contentLength > 0) {
        indicator.setFraction(((double)totalRead) / contentLength);
      }
      indicator.checkCanceled();
    }
  }
  finally {
    if (stream != null) {
      stream.close();
    }
    if (readStream != null) {
      readStream.close();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:DownloadOperation.java

示例14: indicatorOnStart

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
private static void indicatorOnStart() {
  ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();

  if (indicator != null) {
    indicator.setIndeterminate(true);
    indicator.setText(SvnBundle.message("action.Subversion.integrate.changes.progress.integrating.text"));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:SvnIntegrateChangesTask.java

示例15: generateSkeletonsForList

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
private boolean generateSkeletonsForList(@NotNull final PySkeletonRefresher refresher,
                                         ProgressIndicator indicator,
                                         @Nullable final String currentBinaryFilesPath) throws InvalidSdkException {
  final PySkeletonGenerator generator = new PySkeletonGenerator(refresher.getSkeletonsPath(), mySdk, currentBinaryFilesPath);
  indicator.setIndeterminate(false);
  final String homePath = mySdk.getHomePath();
  if (homePath == null) return false;
  GeneralCommandLine cmd = PythonHelper.EXTRA_SYSPATH.newCommandLine(homePath, Lists.newArrayList(myQualifiedName));
  final ProcessOutput runResult = PySdkUtil.getProcessOutput(cmd,
                                                             new File(homePath).getParent(),
                                                             PythonSdkType.getVirtualEnvExtraEnv(homePath), 5000
  );
  if (runResult.getExitCode() == 0 && !runResult.isTimeout()) {
    final String extraPath = runResult.getStdout();
    final PySkeletonGenerator.ListBinariesResult binaries = generator.listBinaries(mySdk, extraPath);
    final List<String> names = Lists.newArrayList(binaries.modules.keySet());
    Collections.sort(names);
    final int size = names.size();
    for (int i = 0; i != size; ++i) {
      final String name = names.get(i);
      indicator.setFraction((double)i / size);
      if (needBinaryList(name)) {
        indicator.setText2(name);
        final PySkeletonRefresher.PyBinaryItem item = binaries.modules.get(name);
        final String modulePath = item != null ? item.getPath() : "";
        //noinspection unchecked
        refresher.generateSkeleton(name, modulePath, new ArrayList<String>(), Consumer.EMPTY_CONSUMER);
      }
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:GenerateBinaryStubsFix.java


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