public void loadChapter(String selChapter) throws IOException { undoStack.clear(); setSelectedScene(null); try { chapter.load(selChapter); firePropertyChange(NOTIFY_CHAPTER_LOADED); getEditorConfig().setProperty("project.selectedChapter", selChapter); } catch (SerializationException ex) { // check for not compiled custom actions if (ex.getCause() != null && ex.getCause() instanceof ClassNotFoundException) { EditorLogger.msg("Custom action class not found. Trying to compile..."); if (RunProccess.runGradle(getProjectDir(), "desktop:compileJava")) { ((FolderClassLoader)ActionFactory.getActionClassLoader()).reload(); chapter.load(selChapter); } else { throw new IOException("Failed to run Gradle."); } } else { throw ex; } } i18n.load(selChapter); }