private static boolean isMultipleSelection(@NotNull DataContext dataContext) {
    Location<?> location = Location.DATA_KEY.getData(dataContext);
    Location<?>[] locations = Location.DATA_KEYS.getData(dataContext);
    PsiElement[] elements = LangDataKeys.PSI_ELEMENT_ARRAY.getData(dataContext);
    VirtualFile[] files = CommonDataKeys.VIRTUAL_FILE_ARRAY.getData(dataContext);
    return location != null && locations != null && locations.length > 1 ||
           elements != null && elements.length > 1 ||
           files != null && files.length > 1;
  }
private static boolean isMultipleSelection(@NotNull DataContext dataContext)