@Override @NotNull public AbstractFindUsagesDialog getFindUsagesDialog( boolean isSingleFile, boolean toShowInNewTab, boolean mustOpenInNewTab) { PsiElement element = getPsiElement(); if (element instanceof PsiPackage) { return new FindPackageUsagesDialog( element, getProject(), myFactory.getFindPackageOptions(), toShowInNewTab, mustOpenInNewTab, isSingleFile, this); } if (element instanceof PsiClass) { return new FindClassUsagesDialog( element, getProject(), myFactory.getFindClassOptions(), toShowInNewTab, mustOpenInNewTab, isSingleFile, this); } if (element instanceof PsiMethod) { return new FindMethodUsagesDialog( element, getProject(), myFactory.getFindMethodOptions(), toShowInNewTab, mustOpenInNewTab, isSingleFile, this); } if (element instanceof PsiVariable) { return new FindVariableUsagesDialog( element, getProject(), myFactory.getFindVariableOptions(), toShowInNewTab, mustOpenInNewTab, isSingleFile, this); } if (ThrowSearchUtil.isSearchable(element)) { return new FindThrowUsagesDialog( element, getProject(), myFactory.getFindThrowOptions(), toShowInNewTab, mustOpenInNewTab, isSingleFile, this); } return super.getFindUsagesDialog(isSingleFile, toShowInNewTab, mustOpenInNewTab); }
@Override @NotNull public FindUsagesOptions getFindUsagesOptions(@Nullable final DataContext dataContext) { PsiElement element = getPsiElement(); if (element instanceof PsiPackage) { return myFactory.getFindPackageOptions(); } if (element instanceof PsiClass) { return myFactory.getFindClassOptions(); } if (element instanceof PsiMethod) { return myFactory.getFindMethodOptions(); } if (element instanceof PsiVariable) { return myFactory.getFindVariableOptions(); } if (ThrowSearchUtil.isSearchable(element)) { return myFactory.getFindThrowOptions(); } return super.getFindUsagesOptions(dataContext); }