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


Java Task.queue方法代码示例

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


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

示例1: actionPerformed

import com.intellij.openapi.progress.Task; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent anActionEvent) {
    Project project = anActionEvent.getProject();

    if (project != null) {

        try {
            initFiles(project);
        } catch (IOException e) {
            e.printStackTrace();
        }

        if (TextUtils.isEmpty(apkPath)) {
            chooseAndSaveApkFile(project);
        }

        packageName = PropertiesManager.getData(project, PropertyKeys.PACKAGE_NAME);

        if (TextUtils.isEmpty(packageName)) {
            setPackageName(project);
        }

        isInnerClassEnabled = PropertiesManager.getData(project, PropertyKeys.IS_INNER_CLASS_ENABLE, Strings.TRUE);

        if (!TextUtils.isEmpty(apkPath) && !TextUtils.isEmpty(packageName)) {
            Task task = generateDependencyInjectionGraph(project);
            task.queue();
        }
    }
}
 
开发者ID:kaygisiz,项目名称:Dependency-Injection-Graph,代码行数:31,代码来源:GenerateDependencyInjectionGraph.java

示例2: queueLater

import com.intellij.openapi.progress.Task; //导入方法依赖的package包/类
private static void queueLater(final Task task) {
  final Application app = ApplicationManager.getApplication();
  if (app.isDispatchThread()) {
    task.queue();
  } else {
    app.invokeLater(new Runnable() {
      public void run() {
        task.queue();
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:AntConfigurationImpl.java

示例3: perform

import com.intellij.openapi.progress.Task; //导入方法依赖的package包/类
private T perform(boolean modal, final Disposable disposable) {
  final Semaphore semaphore = new Semaphore();
  semaphore.down();

  final AtomicReference<T> result = new AtomicReference<T>();

  final Progressive progressive = new Progressive() {

    @Override
    public void run(@NotNull ProgressIndicator indicator) {
      indicator.setIndeterminate(true);
      while (!indicator.isCanceled()) {
        if (semaphore.waitFor(500)) {
          if (mySuccess.get()) {
            UIUtil.invokeLaterIfNeeded(new Runnable() {

              @Override
              public void run() {
                if (disposable == null || !Disposer.isDisposed(disposable)) {
                  postPerform(result.get());
                }
              }
            });
          }
          break;
        }
      }
    }
  };

  Task task;
  boolean cancellable = isCancellable(modal);
  if (modal) {
    task = new Task.Modal(myProject, myTitle, cancellable) {

      @Override
      public void run(@NotNull ProgressIndicator indicator) {
        progressive.run(indicator);
      }
    };
  }
  else {
    task = new Task.Backgroundable(myProject, myTitle, cancellable) {

      @Override
      public void run(@NotNull ProgressIndicator indicator) {
        progressive.run(indicator);
      }

      @Override
      public boolean shouldStartInBackground() {
        return CloudRuntimeTask.this.shouldStartInBackground();
      }
    };
  }

  mySuccess.set(false);
  myErrorMessage.set(null);

  run(semaphore, result);

  task.queue();

  return result.get();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:66,代码来源:CloudRuntimeTask.java

示例4: perform

import com.intellij.openapi.progress.Task; //导入方法依赖的package包/类
@Override
public ActionCallback perform(List<LibraryOrderEntry> orderEntriesContainingFile) {
  final ActionCallback callback = new ActionCallback();
  Task task = new Task.Backgroundable(myProject, "Downloading Sources", true) {
    @Override
    public void run(@NotNull final ProgressIndicator indicator) {
      final byte[] bytes;
      try {
        LOG.info("Downloading sources JAR: " + myUrl);
        indicator.checkCanceled();
        bytes = HttpRequests.request(myUrl).readBytes(indicator);
      }
      catch (IOException e) {
        LOG.warn(e);
        ApplicationManager.getApplication().invokeLater(new Runnable() {
          @Override
          public void run() {
            new Notification(myMessageGroupId,
                             "Downloading failed",
                             "Failed to download sources: " + myUrl,
                             NotificationType.ERROR)
              .notify(getProject());

            callback.setDone();
          }
        });
        return;
      }

      ApplicationManager.getApplication().invokeLater(new Runnable() {
        @Override
        public void run() {
          AccessToken accessToken = WriteAction.start();
          try {
            storeFile(bytes);
          }
          finally {
            accessToken.finish();
            callback.setDone();
          }
        }
      });
    }

    @Override
    public void onCancel() {
      callback.setRejected();
    }
  };

  task.queue();

  return callback;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:55,代码来源:AbstractAttachSourceProvider.java


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