boolean (@NotNull AnActionEvent e) { Project project = e.getProject(); if (project == null) return false; VirtualFile file = e.getData(CommonDataKeys.VIRTUAL_FILE); if (!isThemeFile(file)) { file = null; } if (file == null) { for (VirtualFile virtualFile : FileEditorManager.getInstance(project).getOpenFiles()) { if (isThemeFile(virtualFile)) { file = virtualFile; break; } } } if (file == null) { file = ContainerUtil.getFirstItem(FilenameIndex.getAllFilesByExt(project, "theme.json", GlobalSearchScope.projectScope(project))); } if (file != null && isThemeFile(file)) { return applyTempTheme(file, project); } return false; }