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


Java TaskData.getLinkedExternalProjectPath方法代码示例

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


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

示例1: from

import com.intellij.openapi.externalSystem.model.task.TaskData; //导入方法依赖的package包/类
@NotNull
public static ExternalTaskPojo from(@NotNull TaskData data) {
  return new ExternalTaskPojo(data.getName(), data.getLinkedExternalProjectPath(), data.getDescription());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ExternalTaskPojo.java

示例2: extractLocation

import com.intellij.openapi.externalSystem.model.task.TaskData; //导入方法依赖的package包/类
@Nullable
private Location extractLocation() {
  final List<ExternalSystemNode> selectedNodes = getSelectedNodes(ExternalSystemNode.class);
  if (selectedNodes.isEmpty()) return null;

  List<TaskData> tasks = ContainerUtil.newSmartList();

  ExternalTaskExecutionInfo taskExecutionInfo = new ExternalTaskExecutionInfo();

  String projectPath = null;

  for (ExternalSystemNode node : selectedNodes) {
    final Object data = node.getData();
    if (data instanceof TaskData) {
      final TaskData taskData = (TaskData)data;
      if (projectPath == null) {
        projectPath = taskData.getLinkedExternalProjectPath();
      }
      else if (!taskData.getLinkedExternalProjectPath().equals(projectPath)) {
        return null;
      }

      taskExecutionInfo.getSettings().getTaskNames().add(taskData.getName());
      taskExecutionInfo.getSettings().getTaskDescriptions().add(taskData.getDescription());
      tasks.add(taskData);
    }
  }

  if(tasks.isEmpty()) return null;

  taskExecutionInfo.getSettings().setExternalSystemIdString(myExternalSystemId.toString());
  taskExecutionInfo.getSettings().setExternalProjectPath(projectPath);

  String name = myExternalSystemId.getReadableName() + projectPath + StringUtil.join(taskExecutionInfo.getSettings().getTaskNames(), " ");
  // We create a dummy text file instead of re-using external system file in order to avoid clashing with other configuration producers.
  // For example gradle files are enhanced groovy scripts but we don't want to run them via regular IJ groovy script runners.
  // Gradle tooling api should be used for running gradle tasks instead. IJ execution sub-system operates on Location objects
  // which encapsulate PsiElement and groovy runners are automatically applied if that PsiElement IS-A GroovyFile.
  PsiFile file = PsiFileFactory.getInstance(myProject).createFileFromText(name, PlainTextFileType.INSTANCE, "");
  return new ExternalSystemTaskLocation(myProject, file, taskExecutionInfo);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:42,代码来源:ExternalProjectsViewImpl.java

示例3: from

import com.intellij.openapi.externalSystem.model.task.TaskData; //导入方法依赖的package包/类
@Nonnull
public static ExternalTaskPojo from(@Nonnull TaskData data) {
  return new ExternalTaskPojo(data.getName(), data.getLinkedExternalProjectPath(), data.getDescription());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:5,代码来源:ExternalTaskPojo.java


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