當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。