Search in sources :

Example 1 with ProjectPaneSelectInTarget

use of com.intellij.ide.impl.ProjectPaneSelectInTarget in project intellij-community by JetBrains.

the class SelectInProjectViewAction method actionPerformed.

@Override
public void actionPerformed(AnActionEvent e) {
    final ProjectPaneSelectInTarget target = new ProjectPaneSelectInTarget(e.getProject());
    final SelectInContext context = SelectInContextImpl.createContext(e);
    if (context != null) {
        target.selectIn(context, true);
    }
}
Also used : SelectInContext(com.intellij.ide.SelectInContext) ProjectPaneSelectInTarget(com.intellij.ide.impl.ProjectPaneSelectInTarget)

Example 2 with ProjectPaneSelectInTarget

use of com.intellij.ide.impl.ProjectPaneSelectInTarget in project intellij-community by JetBrains.

the class SelectInProjectViewAction method update.

@Override
public void update(AnActionEvent e) {
    final Project project = e.getProject();
    if (project != null) {
        final ProjectPaneSelectInTarget target = new ProjectPaneSelectInTarget(project);
        final SelectInContext context = SelectInContextImpl.createContext(e);
        if (context != null && target.canSelect(context)) {
            e.getPresentation().setEnabled(true);
            return;
        }
    }
    e.getPresentation().setEnabled(false);
}
Also used : SelectInContext(com.intellij.ide.SelectInContext) Project(com.intellij.openapi.project.Project) ProjectPaneSelectInTarget(com.intellij.ide.impl.ProjectPaneSelectInTarget)

Example 3 with ProjectPaneSelectInTarget

use of com.intellij.ide.impl.ProjectPaneSelectInTarget in project android by JetBrains.

the class TemplateUtils method selectEditor.

/**
   * Selects the specified file in the project view.
   * <b>Note:</b> Must be called with read access.
   *
   * @param project the project
   * @param file    the file to select
   */
public static void selectEditor(Project project, VirtualFile file) {
    ApplicationManager.getApplication().assertReadAccessAllowed();
    PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
    if (psiFile != null) {
        ProjectPaneSelectInTarget selectAction = new ProjectPaneSelectInTarget(project);
        selectAction.select(psiFile, false);
    }
}
Also used : ProjectPaneSelectInTarget(com.intellij.ide.impl.ProjectPaneSelectInTarget) PsiFile(com.intellij.psi.PsiFile)

Aggregations

ProjectPaneSelectInTarget (com.intellij.ide.impl.ProjectPaneSelectInTarget)3 SelectInContext (com.intellij.ide.SelectInContext)2 Project (com.intellij.openapi.project.Project)1 PsiFile (com.intellij.psi.PsiFile)1