@Override
  public void checkCreateFile(@NotNull String name) throws IncorrectOperationException {
    FileType type = FileTypeManager.getInstance().getFileTypeByFileName(name);
    if (type == JavaClassFileType.INSTANCE && ProjectRootManager.getInstance(getProject()).getFileIndex().isInSource(getVirtualFile())) {
      throw new IncorrectOperationException("Cannot create class-file");
    }

    super.checkCreateFile(name);
  }
@Override
  public void checkCreateFile(@NotNull String name)