Search in sources :

Example 1 with SelectableTreeStructureProvider

use of com.intellij.ide.projectView.SelectableTreeStructureProvider in project intellij-community by JetBrains.

the class ProjectViewSelectInTarget method select.

@Override
public void select(PsiElement element, final boolean requestFocus) {
    PsiElement toSelect = null;
    for (TreeStructureProvider provider : getProvidersDumbAware()) {
        if (provider instanceof SelectableTreeStructureProvider) {
            toSelect = ((SelectableTreeStructureProvider) provider).getTopLevelElement(element);
        }
        if (toSelect != null)
            break;
    }
    toSelect = findElementToSelect(element, toSelect);
    if (toSelect != null) {
        VirtualFile virtualFile = PsiUtilCore.getVirtualFile(toSelect);
        select(toSelect, virtualFile, requestFocus);
    }
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) SelectableTreeStructureProvider(com.intellij.ide.projectView.SelectableTreeStructureProvider) PsiElement(com.intellij.psi.PsiElement) TreeStructureProvider(com.intellij.ide.projectView.TreeStructureProvider) SelectableTreeStructureProvider(com.intellij.ide.projectView.SelectableTreeStructureProvider)

Aggregations

SelectableTreeStructureProvider (com.intellij.ide.projectView.SelectableTreeStructureProvider)1 TreeStructureProvider (com.intellij.ide.projectView.TreeStructureProvider)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 PsiElement (com.intellij.psi.PsiElement)1