private void findUsages( @NotNull final UsageInfoToUsageConverter.TargetElementsDescriptor descriptor, @NotNull final FindUsagesHandler handler, final boolean toSkipUsagePanelWhenOneUsage, final boolean toOpenInNewTab, @NotNull final FindUsagesOptions findUsagesOptions) { List<? extends PsiElement> elements = descriptor.getAllElements(); if (elements.isEmpty()) { throw new AssertionError(handler + " " + findUsagesOptions); } final UsageTarget[] targets = convertToUsageTargets(elements); myAnotherManager.searchAndShowUsages( targets, new Factory<UsageSearcher>() { @Override public UsageSearcher create() { return createUsageSearcher(descriptor, handler, findUsagesOptions, null); } }, !toSkipUsagePanelWhenOneUsage, true, createPresentation(elements.get(0), findUsagesOptions, toOpenInNewTab), null); addToHistory(elements, findUsagesOptions); }
private void initLastSearchElement( final FindUsagesOptions findUsagesOptions, UsageInfoToUsageConverter.TargetElementsDescriptor descriptor) { myLastSearchInFileData = createSearchData(descriptor.getAllElements(), findUsagesOptions); }