boolean (final ComponentItem item, final LibraryOrderEntry libraryOrderEntry) { int rc = Messages.showYesNoCancelDialog( myEditor, UIDesignerBundle.message("add.library.dependency.prompt", item.getClassName(), libraryOrderEntry.getPresentableName(), myEditor.getModule().getName()), UIDesignerBundle.message("add.library.dependency.title"), Messages.getQuestionIcon()); if (rc == Messages.CANCEL) return false; if (rc == Messages.YES) { ApplicationManager.getApplication().runWriteAction(() -> { final ModifiableRootModel model = ModuleRootManager.getInstance(myEditor.getModule()).getModifiableModel(); if (libraryOrderEntry.isModuleLevel()) { copyModuleLevelLibrary(libraryOrderEntry.getLibrary(), model); } else { model.addLibraryEntry(libraryOrderEntry.getLibrary()); } model.commit(); }); } return true; }