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