mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do not listed to files if project is already closed + don't forget to add lesson to the course
This commit is contained in:
+2
@@ -233,6 +233,7 @@ public class StudyProjectComponent implements ProjectComponent {
|
||||
}
|
||||
}
|
||||
}
|
||||
myListener = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -285,6 +286,7 @@ public class StudyProjectComponent implements ProjectComponent {
|
||||
private class FileCreatedByUserListener extends VirtualFileAdapter {
|
||||
@Override
|
||||
public void fileCreated(@NotNull VirtualFileEvent event) {
|
||||
if (myProject.isDisposed()) return;
|
||||
final VirtualFile createdFile = event.getFile();
|
||||
final VirtualFile taskDir = createdFile.getParent();
|
||||
final Course course = StudyTaskManager.getInstance(myProject).getCourse();
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.intellij.lang.Language;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class Course {
|
||||
@@ -17,7 +18,11 @@ public class Course {
|
||||
private String myLanguage;
|
||||
|
||||
public List<Lesson> getLessons() {
|
||||
return lessons;
|
||||
return Collections.unmodifiableList(lessons);
|
||||
}
|
||||
|
||||
public void addLesson(@NotNull final Lesson lesson) {
|
||||
lessons.add(lesson);
|
||||
}
|
||||
|
||||
public String getAuthor() {
|
||||
|
||||
Reference in New Issue
Block a user