private static boolean applyTempTheme(@NotNull VirtualFile json, @NotNull Project project) {
    try {
      FileDocumentManager.getInstance().saveAllDocuments();

      Module module = ModuleUtilCore.findModuleForFile(json, project);
      UITheme theme = TempUIThemeLookAndFeelInfo.loadTempTheme(json.getInputStream(), new IconPathPatcher() {
        @Override
        public @NotNull String patchPath(@NotNull String path, @Nullable ClassLoader classLoader) {
          String result = module == null ? null : findAbsoluteFilePathByRelativePath(module, path);
          return result == null ? path : result;
        }
      });

      if (module != null) {
        ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module);

        patchBackgroundImagePath(moduleRootManager, theme.getBackground());
        patchBackgroundImagePath(moduleRootManager, theme.getEmptyFrameBackground());
      }

      LafManager lafManager = LafManager.getInstance();
      lafManager.setCurrentUIThemeLookAndFeel(new TempUIThemeLookAndFeelInfo(theme, lafManager.getCurrentUIThemeLookAndFeel()));
      IconLoader.clearCache();
      lafManager.updateUI();
      return true;
    }
    catch (IOException ignore) {
    }
    return false;
  }
private static boolean applyTempTheme(@NotNull VirtualFile json, @NotNull Project project)