public static FolderEditWindow create(boolean isAppFolder, boolean adding, Folder folder, Presentations presentations, Runnable commitHandler) { Configuration configuration = AppBeans.get(Configuration.NAME); GlobalConfig globalConfig = configuration.getConfig(GlobalConfig.class); String className = isAppFolder ? globalConfig.getAppFolderEditWindowClassName() : globalConfig.getFolderEditWindowClassName(); if (className != null) { Class<FolderEditWindow> aClass = ReflectionHelper.getClass(className); try { Constructor constructor = aClass. getConstructor(boolean.class, Folder.class, Presentations.class, Runnable.class); return (FolderEditWindow) constructor.newInstance(adding, folder, presentations, commitHandler); } catch (Exception e) { throw new RuntimeException("Unable to create FolderEditWindow", e); } } else return isAppFolder ? new AppFolderEditWindow(adding, (AppFolder) folder, presentations, commitHandler) : new FolderEditWindow(adding, folder, presentations, commitHandler); }