@NotNull private static Course getCourse( @NotNull Project project, @NotNull String name, @NotNull String[] authors, @NotNull String description) { final Course course = new Course(); course.setName(name); course.setAuthors(authors); course.setDescription(description); course.setLanguage(PythonLanguage.getInstance().getID()); course.setCourseMode(CCUtils.COURSE_MODE); File coursesDir = new File(PathManager.getConfigPath(), "courses"); File courseDir = new File(coursesDir, name + "-" + project.getName()); course.setCourseDirectory(courseDir.getPath()); StudyTaskManager.getInstance(project).setCourse(course); StudyProjectComponent.getInstance(project).registerStudyToolWindow(course); return course; }
@Override public void actionPerformed(@NotNull AnActionEvent e) { Project project = e.getProject(); if (project == null) { return; } Course course = StudyTaskManager.getInstance(project).getCourse(); if (course == null) { return; } CCNewProjectPanel panel = new CCNewProjectPanel( course.getName(), Course.getAuthorsString(course.getAuthors()), course.getDescription()); DialogBuilder builder = createChangeInfoDialog(project, panel); if (builder.showAndGet()) { course.setAuthors(panel.getAuthors()); course.setName(panel.getName()); course.setDescription(panel.getDescription()); ProjectView.getInstance(project).refresh(); } }