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