protected boolean isCourseBasedProject(@NotNull final AbstractTreeNode parent) { final Project project = parent.getProject(); if (project != null) { final StudyTaskManager studyTaskManager = StudyTaskManager.getInstance(project); if (studyTaskManager.getCourse() == null) { return false; } } return true; }
@Override public void createToolWindowContent( @NotNull final Project project, @NotNull final ToolWindow toolWindow) { toolWindow.setIcon(InteractiveLearningIcons.TaskDescription); StudyTaskManager taskManager = StudyTaskManager.getInstance(project); final Course course = taskManager.getCourse(); if (course != null) { final StudyToolWindow studyToolWindow; if (StudyUtils.hasJavaFx() && StudyTaskManager.getInstance(project).shouldUseJavaFx()) { studyToolWindow = new StudyJavaFxToolWindow(); } else { studyToolWindow = new StudySwingToolWindow(); } studyToolWindow.init(project); final ContentManager contentManager = toolWindow.getContentManager(); final Content content = contentManager.getFactory().createContent(studyToolWindow, null, false); contentManager.addContent(content); Disposer.register(project, studyToolWindow); } }