use of com.intellij.ide.favoritesTreeView.smartPointerPsiNodes.FieldSmartPointerNode in project intellij-community by JetBrains.
the class PsiFieldFavoriteNodeProvider 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 PsiField) {
result.add(new FieldSmartPointerNode(project, element, viewSettings));
}
}
return result.isEmpty() ? null : result;
}
return null;
}
Aggregations