private void registerActionShortcuts(@NotNull InspectionToolPresentation presentation) {
   final QuickFixAction[] fixes = presentation.getQuickFixes(RefEntity.EMPTY_ELEMENTS_ARRAY);
   if (fixes != null) {
     for (QuickFixAction fix : fixes) {
       fix.registerCustomShortcutSet(fix.getShortcutSet(), this);
     }
   }
 }
Пример #2
0
 public static String[] quickFixTexts(
     RefEntity where, @NotNull InspectionToolPresentation toolPresentation) {
   QuickFixAction[] quickFixes = toolPresentation.getQuickFixes(new RefEntity[] {where});
   if (quickFixes == null) {
     return null;
   }
   List<String> texts = new ArrayList<String>();
   for (QuickFixAction quickFix : quickFixes) {
     final String text = quickFix.getText(where);
     if (text == null) continue;
     texts.add(text);
   }
   return texts.toArray(new String[texts.size()]);
 }