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


Java ExternalSystemTaskNotificationListener类代码示例

本文整理汇总了Java中com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener的典型用法代码示例。如果您正苦于以下问题:Java ExternalSystemTaskNotificationListener类的具体用法?Java ExternalSystemTaskNotificationListener怎么用?Java ExternalSystemTaskNotificationListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: executeTask

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener; //导入依赖的package包/类
/**
     * 执行task
     *
     * @param project
     * @param taskName
     * @param args
     * @param listener
     */
    public static void executeTask(Project project, String taskName, String args, ExternalSystemTaskNotificationListener listener) {
//        AndroidGradleTaskManager manager = new AndroidGradleTaskManager();
//        List<String> taskNames = new ArrayList<String>();
//        if (taskName != null) {
//            taskNames.add(taskName);
//        }
//        List<String> vmOptions = new ArrayList<String>();
//        List<String> params = new ArrayList<String>();
//        if (args != null) {
//            params.add(args);
//        }
//        if (listener == null) {
//            listener = new ExternalSystemTaskNotificationListenerAdapter() {};
//        }
//        manager.executeTasks(
//                ExternalSystemTaskId.create(GradleConstants.SYSTEM_ID, ExternalSystemTaskType.EXECUTE_TASK, project),
//                taskNames, project.getBasePath(), null, vmOptions, params, null, listener);
    }
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:27,代码来源:GradleUtil.java

示例2: equals

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener; //导入依赖的package包/类
@Override
public boolean equals(Object o) {
  if (this == o) return true;
  if (o == null || getClass() != o.getClass()) return false;

  ExternalSystemExecutionSettings that = (ExternalSystemExecutionSettings)o;

  if (myRemoteProcessIdleTtlInMs.get() != that.myRemoteProcessIdleTtlInMs.get()) return false;
  if (myVerboseProcessing.get() != that.myVerboseProcessing.get()) return false;
  ExternalSystemTaskNotificationListener notificationListener = myNotificationListener.get();
  ExternalSystemTaskNotificationListener thatNotificationListener = that.myNotificationListener.get();
  if ((notificationListener == null && thatNotificationListener != null)
      || (notificationListener != null && !notificationListener.equals(thatNotificationListener)))
  {
    return false;
  }

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

示例3: executeTasks

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener; //导入依赖的package包/类
@Override
public boolean executeTasks(@NotNull ExternalSystemTaskId id,
                            @NotNull List<String> taskNames,
                            @NotNull String projectPath,
                            @Nullable GradleExecutionSettings settings,
                            @NotNull final List<String> vmOptions,
                            @NotNull final List<String> scriptParameters,
                            @Nullable String debuggerSetup,
                            @NotNull ExternalSystemTaskNotificationListener listener) throws ExternalSystemException
{
  GradleInvoker invoker = getInvoker();
  if (invoker == null) {
    // Returning false gives control back to the framework, and the task(s) will be invoked by IDEA.
    return false;
  }
  invoker.executeTasks(taskNames, Collections.<String>emptyList(), id, listener, true);
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:AndroidGradleTaskManager.java

示例4: setUp

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
  super.setUp();
  myIdeaProject = new IdeaProjectStub("multiProject");
  myAndroidProject = TestProjects.createBasicProject(myIdeaProject.getRootDir());

  myAndroidModule = myIdeaProject.addModule(myAndroidProject.getName(), "androidTask");
  myUtilModule = myIdeaProject.addModule("util", "compileJava", "jar", "classes");
  myIdeaProject.addModule("notReallyAGradleProject");

  ProjectImportAction.AllModels allModels = new ProjectImportAction.AllModels(myIdeaProject);
  allModels.addExtraProject(myAndroidProject, AndroidProject.class, myAndroidModule);

  ExternalSystemTaskId id = ExternalSystemTaskId.create(SYSTEM_ID, RESOLVE_PROJECT, myIdeaProject.getName());
  String projectPath = FileUtil.toSystemDependentName(myIdeaProject.getBuildFile().getParent());
  ExternalSystemTaskNotificationListener notificationListener = new ExternalSystemTaskNotificationListenerAdapter() {};
  myResolverCtx = new ProjectResolverContext(id, projectPath, null, createMock(ProjectConnection.class), notificationListener, true);
  myResolverCtx.setModels(allModels);

  myProjectResolver = new AndroidGradleProjectResolver(createMock(ProjectImportErrorHandler.class));
  myProjectResolver.setProjectResolverContext(myResolverCtx);

  GradleProjectResolverExtension next = new BaseGradleProjectResolverExtension();
  next.setProjectResolverContext(myResolverCtx);
  myProjectResolver.setNext(next);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:AndroidGradleProjectResolverIdeaTest.java

示例5: cancelTask

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener; //导入依赖的package包/类
@Override
public boolean cancelTask(@NotNull ExternalSystemTaskId id, @NotNull ExternalSystemTaskNotificationListener listener)
  throws ExternalSystemException {

  // extension points are available only in IDE process
  if (ExternalSystemApiUtil.isInProcessMode(GradleConstants.SYSTEM_ID)) {
    for (GradleTaskManagerExtension gradleTaskManagerExtension : GradleTaskManagerExtension.EP_NAME.getExtensions()) {
      if (gradleTaskManagerExtension.cancelTask(id, listener)) return true;
    }
  }

  final CancellationTokenSource cancellationTokenSource = myCancellationMap.get(id);
  if (cancellationTokenSource != null) {
    cancellationTokenSource.cancel();
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:GradleTaskManager.java

示例6: resolveProjectInfo

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener; //导入依赖的package包/类
@Nullable
@Override
public DataNode<ProjectData> resolveProjectInfo(
  @NotNull ExternalSystemTaskId id,
  @NotNull String projectPath,
  boolean isPreviewMode,
  @Nullable PantsExecutionSettings settings,
  @NotNull ExternalSystemTaskNotificationListener listener
) throws ExternalSystemException, IllegalArgumentException, IllegalStateException {
  if (projectPath.startsWith(".pants.d")) {
    return null;
  }
  checkForDifferentPantsExecutables(id, projectPath);

  final PantsCompileOptionsExecutor executor = PantsCompileOptionsExecutor.create(projectPath, settings);
  task2executor.put(id, executor);
  final DataNode<ProjectData> projectDataNode =
    resolveProjectInfoImpl(id, executor, listener, isPreviewMode, settings.isEnableIncrementalImport());
  doViewSwitch(id, projectPath);
  task2executor.remove(id);
  return projectDataNode;
}
 
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:23,代码来源:PantsSystemProjectResolver.java

示例7: resolveUsingPantsGoal

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener; //导入依赖的package包/类
private void resolveUsingPantsGoal(
  @NotNull final ExternalSystemTaskId id,
  @NotNull PantsCompileOptionsExecutor executor,
  final ExternalSystemTaskNotificationListener listener,
  @NotNull DataNode<ProjectData> projectDataNode
) {
  final PantsResolver dependenciesResolver = new PantsResolver(executor);
  dependenciesResolver.resolve(
    new Consumer<String>() {
      @Override
      public void consume(String status) {
        listener.onStatusChange(new ExternalSystemTaskNotificationEvent(id, status));
      }
    },
    new ProcessAdapter() {
      @Override
      public void onTextAvailable(ProcessEvent event, Key outputType) {
        listener.onTaskOutput(id, event.getText(), outputType == ProcessOutputTypes.STDOUT);
      }
    }
  );
  dependenciesResolver.addInfoTo(projectDataNode);
}
 
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:24,代码来源:PantsSystemProjectResolver.java

示例8: doResolveProjectInfo

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener; //导入依赖的package包/类
@NotNull
private DataNode<ProjectData> doResolveProjectInfo(@NotNull final ExternalSystemTaskId id,
                                                   @NotNull String projectPath,
                                                   @Nullable GradleExecutionSettings settings,
                                                   @NotNull ProjectConnection connection,
                                                   @NotNull ExternalSystemTaskNotificationListener listener,
                                                   boolean downloadLibraries)
  throws IllegalArgumentException, IllegalStateException
{
  ModelBuilder<? extends IdeaProject> modelBuilder = myHelper.getModelBuilder(id, settings, connection, listener, downloadLibraries);
  IdeaProject project = modelBuilder.get();
  DataNode<ProjectData> result = populateProject(project, projectPath);

  // We need two different steps ('create' and 'populate') in order to handle module dependencies, i.e. when one module is
  // configured to be dependency for another one, corresponding dependency module object should be available during
  // populating dependent module object.
  Map<String, Pair<DataNode<ModuleData>, IdeaModule>> modules = createModules(project, result);
  populateModules(modules.values(), result);
  Collection<DataNode<LibraryData>> libraries = ExternalSystemApiUtil.getChildren(result, ProjectKeys.LIBRARY);
  myLibraryNamesMixer.mixNames(libraries);
  parseTasks(result, project);
  return result;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:GradleProjectResolver.java

示例9: executeTasks

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener; //导入依赖的package包/类
@Override
public void executeTasks(@NotNull final ExternalSystemTaskId id,
                         @NotNull final List<String> taskNames,
                         @NotNull String projectPath,
                         @Nullable final GradleExecutionSettings settings,
                         @Nullable final String vmOptions,
                         @NotNull final ExternalSystemTaskNotificationListener listener) throws ExternalSystemException
{
  Function<ProjectConnection, Void> f = new Function<ProjectConnection, Void>() {
    @Override
    public Void fun(ProjectConnection connection) {
      BuildLauncher launcher = myHelper.getBuildLauncher(id, connection, settings, listener);
      if (!StringUtil.isEmpty(vmOptions)) {
        assert vmOptions != null;
        launcher.setJvmArguments(vmOptions.trim());
      }
      launcher.forTasks(ArrayUtil.toStringArray(taskNames));
      launcher.run();
      return null;
    }
  };
  myHelper.execute(projectPath, settings, f); 
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:GradleTaskManager.java

示例10: hashCode

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener; //导入依赖的package包/类
@Override
public int hashCode() {
  int result = (int)(myRemoteProcessIdleTtlInMs.get() ^ (myRemoteProcessIdleTtlInMs.get() >>> 32));
  result = 31 * result + (myVerboseProcessing.get() ? 1 : 0);
  ExternalSystemTaskNotificationListener listener = myNotificationListener.get();
  return listener == null ? result : 31 * result + listener.hashCode();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ExternalSystemExecutionSettings.java

示例11: executeTasks

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener; //导入依赖的package包/类
void executeTasks(@NotNull ExternalSystemTaskId id,
@NotNull List<String> taskNames,
@NotNull String projectPath,
@Nullable S settings,
@NotNull final List<String> vmOptions,
@NotNull List<String> scriptParameters,
@Nullable String debuggerSetup,
@NotNull ExternalSystemTaskNotificationListener listener) throws ExternalSystemException;
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ExternalSystemTaskManager.java

示例12: executeTasks

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener; //导入依赖的package包/类
public abstract void executeTasks(@NotNull ExternalSystemTaskId id,
@NotNull List<String> taskNames,
@NotNull String projectPath,
@Nullable S settings,
@NotNull final List<String> vmOptions,
@NotNull List<String> scriptParameters,
@Nullable String debuggerSetup,
@NotNull ExternalSystemTaskNotificationListener listener) throws ExternalSystemException;
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:AbstractExternalSystemTaskManager.java

示例13: addNotificationListener

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener; //导入依赖的package包/类
@Override
public boolean addNotificationListener(@NotNull ExternalSystemTaskId taskId, @NotNull ExternalSystemTaskNotificationListener listener) {
  Set<ExternalSystemTaskId> ids = null;
  while (ids == null) {
    if (myListeners.containsKey(listener)) {
      ids = myListeners.get(listener);
    }
    else {
      ids = myListeners.putIfAbsent(listener, ContainerUtil.<ExternalSystemTaskId>newConcurrentSet());
    }
  }
  return ids.add(taskId);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ExternalSystemProgressNotificationManagerImpl.java

示例14: onQueued

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener; //导入依赖的package包/类
@Override
public void onQueued(@NotNull ExternalSystemTaskId id) {
  for (Map.Entry<ExternalSystemTaskNotificationListener, Set<ExternalSystemTaskId>> entry : myListeners.entrySet()) {
    final Set<ExternalSystemTaskId> ids = entry.getValue();
    if (Collections.EMPTY_SET == ids || ids.contains(id)) {
      entry.getKey().onQueued(id);
    }
  }

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ExternalSystemProgressNotificationManagerImpl.java

示例15: onStart

import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener; //导入依赖的package包/类
@Override
public void onStart(@NotNull ExternalSystemTaskId id) {
  for (Map.Entry<ExternalSystemTaskNotificationListener, Set<ExternalSystemTaskId>> entry : myListeners.entrySet()) {
    final Set<ExternalSystemTaskId> ids = entry.getValue();
    if (Collections.EMPTY_SET == ids || ids.contains(id)) {
      entry.getKey().onStart(id);
    }
  } 
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ExternalSystemProgressNotificationManagerImpl.java


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