public void setCompilerLibraryById(LibraryId id) { if (id.isEmpty()) { // myCompilerLibrary.addItem(null); myCompilerLibrary.setSelectedItem(null); } else { LibraryDescriptor descriptor = findLibraryDescriptorFor(id); if (descriptor == null) { LibraryDescriptor newId = LibraryDescriptor.createFor(id); myCompilerLibrary.addItem(newId); myCompilerLibrary.setSelectedItem(newId); } else { myCompilerLibrary.setSelectedItem(descriptor); } } }
private LibraryLevel getCompilerLibraryLevel() { LibraryId id = getCompilerLibraryId(); return id == null ? null : id.level(); }
private LibraryId getCompilerLibraryId() { LibraryDescriptor descriptor = (LibraryDescriptor) myCompilerLibrary.getSelectedItem(); return descriptor == null ? LibraryId.empty() : descriptor.id(); }
private String getCompilerLibraryName() { LibraryId id = getCompilerLibraryId(); return id == null ? "" : id.name(); }