void (@NotNull ActionContext context, @NotNull PsiClass myClass, @NotNull ModPsiUpdater updater) { PsiDirectory dir = updater.getWritable(context.file().getContainingDirectory()); String name = myClass.getName(); if (name == null) return; JavaDirectoryService directoryService = JavaDirectoryService.getInstance(); PsiClass placeHolder = myClass.isInterface() ? directoryService.createInterface(dir, name) : directoryService.createClass(dir, name); PsiClass newClass = (PsiClass)placeHolder.replace(myClass); myClass.delete(); updater.moveTo(newClass.getContainingFile()); }