use of com.intellij.ide.projectView.impl.nodes.PsiFileNode in project intellij-community by JetBrains.
the class ResourceBundleNode method getChildren.
@Override
@NotNull
public Collection<AbstractTreeNode> getChildren() {
List<PropertiesFile> propertiesFiles = ObjectUtils.notNull(getValue()).getPropertiesFiles();
Collection<AbstractTreeNode> children = new ArrayList<>();
for (PropertiesFile propertiesFile : propertiesFiles) {
AbstractTreeNode node = new PsiFileNode(myProject, propertiesFile.getContainingFile(), getSettings());
children.add(node);
}
return children;
}
use of com.intellij.ide.projectView.impl.nodes.PsiFileNode in project intellij-community by JetBrains.
the class FormNode method getChildren.
private static Collection<BasePsiNode<? extends PsiElement>> getChildren(final Project project, final Form form, final ViewSettings settings) {
final Set<BasePsiNode<? extends PsiElement>> children = new LinkedHashSet<>();
children.add(new ClassTreeNode(project, form.getClassToBind(), settings));
for (PsiFile formBoundToClass : form.getFormFiles()) {
children.add(new PsiFileNode(project, formBoundToClass, settings));
}
return children;
}
use of com.intellij.ide.projectView.impl.nodes.PsiFileNode in project intellij-community by JetBrains.
the class TreeFileChooserDialog method filterFiles.
private Object[] filterFiles(final Object[] list) {
Condition<PsiFile> condition = psiFile -> {
if (myFilter != null && !myFilter.accept(psiFile)) {
return false;
}
boolean accepted = myFileType == null || psiFile.getFileType() == myFileType;
VirtualFile virtualFile = psiFile.getVirtualFile();
if (virtualFile != null && !accepted) {
accepted = virtualFile.getFileType() == myFileType;
}
return accepted;
};
final List<Object> result = new ArrayList<>(list.length);
for (Object o : list) {
final PsiFile psiFile;
if (o instanceof PsiFile) {
psiFile = (PsiFile) o;
} else if (o instanceof PsiFileNode) {
psiFile = ((PsiFileNode) o).getValue();
} else {
psiFile = null;
}
if (psiFile != null && !condition.value(psiFile)) {
continue;
} else {
if (o instanceof ProjectViewNode) {
final ProjectViewNode projectViewNode = (ProjectViewNode) o;
if (!projectViewNode.canHaveChildrenMatching(condition)) {
continue;
}
}
}
result.add(o);
}
return ArrayUtil.toObjectArray(result);
}
use of com.intellij.ide.projectView.impl.nodes.PsiFileNode in project intellij-plugins by JetBrains.
the class DartNodeDecorator method decorate.
@Override
public void decorate(@NotNull final ProjectViewNode node, @NotNull final PresentationData presentation) {
if (node instanceof PsiFileNode || node instanceof PsiDirectoryNode) {
final VirtualFile nodeFile = node.getVirtualFile();
final Project project = node.getProject();
if (nodeFile != null && project != null && DartAnalysisServerService.getInstance(project).isFileWithErrors(nodeFile)) {
presentation.setAttributesKey(CodeInsightColors.ERRORS_ATTRIBUTES);
}
}
}
use of com.intellij.ide.projectView.impl.nodes.PsiFileNode in project android by JetBrains.
the class AndroidSourceTypeNode method annotateWithSourceProvider.
private Collection<AbstractTreeNode> annotateWithSourceProvider(Collection<AbstractTreeNode> directoryChildren) {
List<AbstractTreeNode> children = Lists.newArrayListWithExpectedSize(directoryChildren.size());
for (AbstractTreeNode child : directoryChildren) {
if (child instanceof PsiDirectoryNode) {
PsiDirectory directory = ((PsiDirectoryNode) child).getValue();
children.add(new AndroidPsiDirectoryNode(myProject, directory, getSettings(), findSourceProvider(directory.getVirtualFile())));
} else if (child instanceof PsiFileNode) {
PsiFile file = ((PsiFileNode) child).getValue();
children.add(new AndroidPsiFileNode(myProject, file, getSettings(), findSourceProvider(file.getVirtualFile())));
} else {
children.add(child);
}
}
return children;
}
Aggregations