use of com.intellij.ide.favoritesTreeView.smartPointerPsiNodes.ClassSmartPointerNode in project intellij-community by JetBrains.
the class PsiClassFavoriteNodeProvider method getFavoriteNodes.
@Override
public Collection<AbstractTreeNode> getFavoriteNodes(final DataContext context, final ViewSettings viewSettings) {
final Project project = CommonDataKeys.PROJECT.getData(context);
if (project == null)
return null;
PsiElement[] elements = LangDataKeys.PSI_ELEMENT_ARRAY.getData(context);
if (elements == null) {
final PsiElement element = CommonDataKeys.PSI_ELEMENT.getData(context);
if (element != null) {
elements = new PsiElement[] { element };
}
}
if (elements != null) {
final Collection<AbstractTreeNode> result = new ArrayList<>();
for (PsiElement element : elements) {
if (element instanceof PsiClass && checkClassUnderSources(element, project)) {
result.add(new ClassSmartPointerNode(project, element, viewSettings));
}
}
return result.isEmpty() ? null : result;
}
return null;
}
Aggregations