MCPcopy Index your code
hub / github.com/benfry/processing4 / rebuildLibraryList

Method rebuildLibraryList

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

Source from the content-addressed store, hash-verified

309
310
311 public void rebuildLibraryList() {
312 // reset the table mapping imports to libraries
313 Map<String, List<Library>> newTable = new HashMap<>();
314
315 Library core = getCoreLibrary();
316 if (core != null) {
317 core.addPackageList(newTable);
318 }
319
320 coreLibraries = Library.list(librariesFolder);
321 File contribLibrariesFolder = Base.getSketchbookLibrariesFolder();
322 contribLibraries = Library.list(contribLibrariesFolder);
323
324 // Check to see if video and sound are installed and move them
325 // from the contributed list to the core list.
326 foundationLibraries = new ArrayList<>();
327 for (Library lib : contribLibraries) {
328 if (lib.isFoundation()) {
329 foundationLibraries.add(lib);
330 }
331 }
332 coreLibraries.addAll(foundationLibraries);
333 contribLibraries.removeAll(foundationLibraries);
334
335 for (Library lib : coreLibraries) {
336 lib.addPackageList(newTable);
337 }
338
339 for (Library lib : contribLibraries) {
340 lib.addPackageList(newTable);
341 }
342
343 // Make this Map thread-safe
344 importToLibraryTable = Collections.unmodifiableMap(newTable);
345
346 if (base != null) {
347 base.getEditors().forEach(Editor::librariesChanged);
348 }
349 }
350
351
352 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