use of com.jetbrains.edu.coursecreator.creation.CCTaskCreator in project intellij-community by JetBrains.
the class CCCreateTask method createItemDir.
@Override
@Nullable
protected PsiDirectory createItemDir(@NotNull final Project project, @NotNull final StudyItem item, @Nullable final IdeView view, @NotNull final PsiDirectory parentDirectory, @NotNull final Course course) {
CCTaskCreator creator = CCTaskCreator.INSTANCE.forLanguage(course.getLanguageById());
if (creator != null) {
return creator.createTask(project, item, view, parentDirectory, course);
}
final Ref<PsiDirectory> taskDirectory = new Ref<>();
ApplicationManager.getApplication().runWriteAction(() -> {
String taskDirName = EduNames.TASK + item.getIndex();
taskDirectory.set(DirectoryUtil.createSubdirectories(taskDirName, parentDirectory, "\\/"));
if (taskDirectory.get() != null) {
CCUtils.createTaskContent(project, view, course, taskDirectory.get());
}
});
return taskDirectory.get();
}
Aggregations