private void appendMoreUsages(
     Editor editor,
     @NotNull RelativePoint popupPosition,
     @NotNull FindUsagesHandler handler,
     int maxUsages) {
   showElementUsages(
       handler, editor, popupPosition, maxUsages + USAGES_PAGE_SIZE, getDefaultOptions(handler));
 }
 private void searchEverywhere(
     @NotNull FindUsagesOptions options,
     @NotNull FindUsagesHandler handler,
     Editor editor,
     @NotNull RelativePoint popupPosition,
     int maxUsages) {
   FindUsagesOptions cloned = options.clone();
   cloned.searchScope = FindUsagesManager.getMaximalScope(handler);
   showElementUsages(handler, editor, popupPosition, maxUsages, cloned);
 }
 private void showDialogAndFindUsages(
     @NotNull FindUsagesHandler handler,
     @NotNull RelativePoint popupPosition,
     Editor editor,
     int maxUsages) {
   AbstractFindUsagesDialog dialog = handler.getFindUsagesDialog(false, false, false);
   dialog.show();
   if (dialog.isOK()) {
     dialog.calcFindUsagesOptions();
     showElementUsages(handler, editor, popupPosition, maxUsages, getDefaultOptions(handler));
   }
 }
 private void startFindUsages(
     @NotNull PsiElement element,
     @NotNull RelativePoint popupPosition,
     Editor editor,
     int maxUsages) {
   Project project = element.getProject();
   FindUsagesManager findUsagesManager =
       ((FindManagerImpl) FindManager.getInstance(project)).getFindUsagesManager();
   FindUsagesHandler handler = findUsagesManager.getNewFindUsagesHandler(element, false);
   if (handler == null) return;
   if (showSettingsDialogBefore) {
     showDialogAndFindUsages(handler, popupPosition, editor, maxUsages);
     return;
   }
   showElementUsages(handler, editor, popupPosition, maxUsages, getDefaultOptions(handler));
 }