show in project view only active subtask test
[idea/community.git] / python / educational-core / course-creator / src / com / jetbrains / edu / coursecreator / projectView / CCStudentInvisibleFileNode.java
1 package com.jetbrains.edu.coursecreator.projectView;
2
3 import com.intellij.ide.projectView.PresentationData;
4 import com.intellij.ide.projectView.ViewSettings;
5 import com.intellij.ide.projectView.impl.nodes.PsiFileNode;
6 import com.intellij.openapi.project.Project;
7 import com.intellij.psi.PsiFile;
8 import com.intellij.ui.SimpleTextAttributes;
9
10 /**
11  * represents a file which is invisible for student in student mode
12  */
13 public class CCStudentInvisibleFileNode extends PsiFileNode {
14   private final String myName;
15
16   public CCStudentInvisibleFileNode(Project project,
17                                     PsiFile value,
18                                     ViewSettings viewSettings) {
19     super(project, value, viewSettings);
20     myName = value.getName();
21   }
22
23   public CCStudentInvisibleFileNode(Project project,
24                                     PsiFile value,
25                                     ViewSettings viewSettings,
26                                     String name) {
27     super(project, value, viewSettings);
28     myName = name;
29   }
30
31
32   @Override
33   protected void updateImpl(PresentationData data) {
34     super.updateImpl(data);
35     data.clearText();
36     data.addText(myName, SimpleTextAttributes.GRAY_ATTRIBUTES);
37   }
38 }