public LibraryDescriptor findLibraryDescriptorFor(LibraryId id) { DefaultComboBoxModel model = (DefaultComboBoxModel) myCompilerLibrary.getModel(); for (int i = 0; i < model.getSize(); i++) { LibraryDescriptor entry = (LibraryDescriptor) model.getElementAt(i); if (entry != null && entry.id().equals(id)) { return entry; } } return null; }
private LibraryId getCompilerLibraryId() { LibraryDescriptor descriptor = (LibraryDescriptor) myCompilerLibrary.getSelectedItem(); return descriptor == null ? LibraryId.empty() : descriptor.id(); }