本文整理汇总了Java中com.intellij.openapi.progress.ProgressIndicator.stop方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressIndicator.stop方法的具体用法?Java ProgressIndicator.stop怎么用?Java ProgressIndicator.stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.progress.ProgressIndicator
的用法示例。
在下文中一共展示了ProgressIndicator.stop方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getChildren
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@Override
@NotNull
public Collection<? extends AbstractTreeNode> getChildren() {
ProgressIndicator current = ProgressManager.getInstance().getProgressIndicator();
ProgressIndicator indicator = current == null ? new ProgressIndicatorBase() : current;
if (current == null) {
indicator.start();
}
final Collection[] nodes = new Collection[1];
ProgressManager.getInstance().executeProcessUnderProgress(new Runnable() {
@Override
public void run() {
nodes[0] = getChildrenUnderProgress(ProgressManager.getInstance().getProgressIndicator());
}
}, indicator);
if (current == null) {
indicator.stop();
}
return nodes[0];
}
示例2: perform
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@NotNull
@Override
protected File perform(@NotNull ProgressIndicator indicator, @NotNull File destination) throws WizardException {
indicator.setText("Installing Android SDK");
try {
FileUtil.ensureExists(destination);
if (!FileUtil.filesEqual(destination.getCanonicalFile(), myRepo.getCanonicalFile())) {
SdkMerger.mergeSdks(myRepo, destination, indicator);
myRepoWasMerged = true;
}
myContext.print(String.format("Android SDK was installed to %1$s\n", destination), ConsoleViewContentType.SYSTEM_OUTPUT);
return destination;
}
catch (IOException e) {
throw new WizardException(e.getMessage(), e);
}
finally {
indicator.stop();
}
}
示例3: run
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@Override
public void run(@NotNull ProgressIndicator indicator) {
try {
doRun(indicator);
}
catch (Exception e) {
LOG.info("Unexpected exception occurred during processing sequential task '" + myTitle + "'", e);
}
finally {
indicator.stop();
}
}
示例4: finish
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@CalledInAwt
private static void finish(@NotNull Runnable result, @NotNull ProgressIndicator indicator) {
if (indicator.isCanceled()) return;
result.run();
indicator.stop();
}
示例5: untar
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
/**
* @throws IOException when tar fails in a way that we may retry the operation
* @throws WizardException if retry is not possible (e.g. no tar executable)
*/
@NotNull
private static File untar(final File archive, File destination, final InstallContext context, final ProgressIndicator indicator)
throws IOException, WizardException {
if (!destination.mkdirs()) {
throw new WizardException("Cannot create temporary directory to extract files");
}
indicator.start();
indicator.setFraction(0.0); // 0%
try {
GeneralCommandLine line =
new GeneralCommandLine(getTarExecutablePath(), TAR_FLAGS_EXTRACT_UNPACK_VERBOSE_FILENAME_TARGETDIR, archive.getAbsolutePath(),
destination.getAbsolutePath());
CapturingAnsiEscapesAwareProcessHandler handler = new CapturingAnsiEscapesAwareProcessHandler(line);
handler.addProcessListener(new ProcessAdapter() {
@Override
public void onTextAvailable(ProcessEvent event, Key outputType) {
String string = event.getText();
if (!StringUtil.isEmptyOrSpaces(string)) {
if (string.startsWith(EXTRACT_OPERATION_OUTPUT)) { // Extract operation prefix
String fileName = string.substring(EXTRACT_OPERATION_OUTPUT.length()).trim();
indicator.setText(fileName);
}
else if (ProcessOutputTypes.STDOUT.equals(outputType)) {
indicator.setText(string.trim());
}
else {
context.print(string, ConsoleViewContentType.getConsoleViewType(outputType));
}
}
}
});
if (handler.runProcess().getExitCode() != 0) {
throw new IOException("Unable to unpack archive file");
}
return destination;
}
catch (ExecutionException e) {
throw new WizardException("Unable to run tar utility");
}
finally {
indicator.setFraction(1.0); // 100%
indicator.stop();
}
}
示例6: run
import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@Override
public void run(@NotNull ProgressIndicator indicator) {
if (isAndroidStudio()) {
// See https://code.google.com/p/android/issues/detail?id=169743
clearStoredGradleJvmArgs(getNotNullProject());
}
myIndicator = indicator;
ProjectManager projectManager = ProjectManager.getInstance();
Project project = getNotNullProject();
myCloseListener = new CloseListener();
projectManager.addProjectManagerListener(project, myCloseListener);
Semaphore semaphore = ((CompilerManagerImpl)CompilerManager.getInstance(project)).getCompilationSemaphore();
boolean acquired = false;
try {
try {
while (!acquired) {
acquired = semaphore.tryAcquire(300, MILLISECONDS);
if (indicator.isCanceled()) {
// Give up obtaining the semaphore, let compile work begin in order to stop gracefully on cancel event.
break;
}
}
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
if (!isHeadless()) {
addIndicatorDelegate();
}
invokeGradleTasks();
}
finally {
try {
indicator.stop();
projectManager.removeProjectManagerListener(project, myCloseListener);
}
finally {
if (acquired) {
semaphore.release();
}
}
}
}