Library (@NotNull NewLibraryEditor libraryEditor, @NotNull LibraryLevel level) { if (level == LibraryLevel.MODULE && myRootModel != null) { return createLibraryInTable(libraryEditor, myRootModel.getModuleLibraryTable()); } LibraryTablesRegistrar registrar = LibraryTablesRegistrar.getInstance(); LibraryTable table; if (level == LibraryLevel.GLOBAL) { table = registrar.getLibraryTable(); } else if (level == LibraryLevel.PROJECT && myProject != null) { table = registrar.getLibraryTable(myProject); } else { return null; } return createLibraryInTable(libraryEditor, table); }