public ProjectStructureChooseLibrariesDialog( ClasspathPanel classpathPanel, StructureConfigurableContext context, Predicate<Library> acceptedLibraries) { super(classpathPanel.getComponent(), "Choose Libraries", classpathPanel.getProject(), true); myClasspathPanel = classpathPanel; myContext = context; myAcceptedLibraries = acceptedLibraries; setOKButtonText("Add Selected"); init(); }
@Override protected void collectChildren(Object element, List<Object> result) { if (element instanceof Application && !myCreatedModuleLibraries.isEmpty()) { result.add(myClasspathPanel.getRootModel().getModuleLibraryTable()); } super.collectChildren(element, result); }
private void removeCreatedModuleLibraries(Collection<Library> selected) { for (Library library : myCreatedModuleLibraries) { if (!selected.contains(library)) { myClasspathPanel.getRootModel().getModuleLibraryTable().removeLibrary(library); } } }