MCPcopy Index your code
hub / github.com/processing/processing / rebuildLibraryList

Method rebuildLibraryList

app/src/processing/app/Mode.java:358–397  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

356
357
358 public void rebuildLibraryList() {
359 //new Exception("Rebuilding library list").printStackTrace(System.out);
360 // reset the table mapping imports to libraries
361 Map<String, List<Library>> newTable = new HashMap<>();
362
363 Library core = getCoreLibrary();
364 if (core != null) {
365 core.addPackageList(newTable);
366 }
367
368 coreLibraries = Library.list(librariesFolder);
369 File contribLibrariesFolder = Base.getSketchbookLibrariesFolder();
370 contribLibraries = Library.list(contribLibrariesFolder);
371
372 // Check to see if video and sound are installed and move them
373 // from the contributed list to the core list.
374 List<Library> foundationLibraries = new ArrayList<>();
375 for (Library lib : contribLibraries) {
376 if (lib.isFoundation()) {
377 foundationLibraries.add(lib);
378 }
379 }
380 coreLibraries.addAll(foundationLibraries);
381 contribLibraries.removeAll(foundationLibraries);
382
383 for (Library lib : coreLibraries) {
384 lib.addPackageList(newTable);
385 }
386
387 for (Library lib : contribLibraries) {
388 lib.addPackageList(newTable);
389 }
390
391 // Make this Map thread-safe
392 importToLibraryTable = Collections.unmodifiableMap(newTable);
393
394 if (base != null) {
395 base.getEditors().forEach(Editor::librariesChanged);
396 }
397 }
398
399
400 public Library getCoreLibrary() {

Callers 3

ModeMethod · 0.95
rebuildImportMenuMethod · 0.95
BaseMethod · 0.80

Calls 8

getCoreLibraryMethod · 0.95
addPackageListMethod · 0.95
listMethod · 0.95
isFoundationMethod · 0.80
addAllMethod · 0.80
getEditorsMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected