use of com.intellij.ide.util.gotoByName.ChooseByNameFilter in project intellij-community by JetBrains.
the class RunInspectionAction method gotoActionPerformed.
@Override
protected void gotoActionPerformed(final AnActionEvent e) {
final Project project = e.getData(CommonDataKeys.PROJECT);
if (project == null)
return;
PsiDocumentManager.getInstance(project).commitAllDocuments();
final PsiElement psiElement = CommonDataKeys.PSI_ELEMENT.getData(e.getDataContext());
final PsiFile psiFile = CommonDataKeys.PSI_FILE.getData(e.getDataContext());
final VirtualFile virtualFile = CommonDataKeys.VIRTUAL_FILE.getData(e.getDataContext());
FeatureUsageTracker.getInstance().triggerFeatureUsed("navigation.goto.inspection");
final GotoInspectionModel model = new GotoInspectionModel(project);
showNavigationPopup(e, model, new GotoActionCallback<Object>() {
@Override
protected ChooseByNameFilter<Object> createFilter(@NotNull ChooseByNamePopup popup) {
popup.setSearchInAnyPlace(true);
return super.createFilter(popup);
}
@Override
public void elementChosen(ChooseByNamePopup popup, final Object element) {
ApplicationManager.getApplication().invokeLater(() -> runInspection(project, ((InspectionToolWrapper) element).getShortName(), virtualFile, psiElement, psiFile));
}
}, false);
}
Aggregations