use of com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode in project intellij-community by JetBrains.
the class StudyTreeStructureProvider method modify.
@NotNull
@Override
public Collection<AbstractTreeNode> modify(@NotNull AbstractTreeNode parent, @NotNull Collection<AbstractTreeNode> children, ViewSettings settings) {
Project project = parent.getProject();
if (project == null || !shouldModify(project)) {
return children;
}
Course course = StudyTaskManager.getInstance(project).getCourse();
if (course == null) {
return children;
}
Collection<AbstractTreeNode> modifiedNodes = new ArrayList<>();
for (AbstractTreeNode node : children) {
if (parent instanceof ProjectViewProjectNode && node instanceof PsiDirectoryNode) {
modifiedNodes.add(createCourseNode(project, node, settings, course));
continue;
}
if (parent instanceof StudyDirectoryNode) {
AbstractTreeNode modifiedNode = ((StudyDirectoryNode) parent).modifyChildNode(node);
if (modifiedNode != null) {
modifiedNodes.add(modifiedNode);
}
}
}
return modifiedNodes;
}
Aggregations