@@ -345,11 +345,11 @@ public File getReferenceFolder() {
345345 public void rebuildLibraryList () {
346346 //new Exception("Rebuilding library list").printStackTrace(System.out);
347347 // reset the table mapping imports to libraries
348- HashMap <String , List <Library >> importToLibraryTable = new HashMap <>();
348+ Map <String , List <Library >> newTable = new HashMap <>();
349349
350350 Library core = getCoreLibrary ();
351351 if (core != null ) {
352- core .addPackageList (importToLibraryTable );
352+ core .addPackageList (newTable );
353353 }
354354
355355 coreLibraries = Library .list (librariesFolder );
@@ -367,28 +367,16 @@ public void rebuildLibraryList() {
367367 coreLibraries .addAll (foundationLibraries );
368368 contribLibraries .removeAll (foundationLibraries );
369369
370- /*
371- File sketchbookLibs = Base.getSketchbookLibrariesFolder();
372- File videoFolder = new File(sketchbookLibs, "video");
373- if (videoFolder.exists()) {
374- coreLibraries.add(new Library(videoFolder));
375- }
376- File soundFolder = new File(sketchbookLibs, "sound");
377- if (soundFolder.exists()) {
378- coreLibraries.add(new Library(soundFolder));
379- }
380- */
381-
382370 for (Library lib : coreLibraries ) {
383- lib .addPackageList (importToLibraryTable );
371+ lib .addPackageList (newTable );
384372 }
385373
386374 for (Library lib : contribLibraries ) {
387- lib .addPackageList (importToLibraryTable );
375+ lib .addPackageList (newTable );
388376 }
389377
390378 // Make this Map thread-safe
391- this . importToLibraryTable = Collections .unmodifiableMap (importToLibraryTable );
379+ importToLibraryTable = Collections .unmodifiableMap (newTable );
392380
393381 if (base != null ) {
394382 base .getEditors ().forEach (Editor ::librariesChanged );
@@ -630,6 +618,18 @@ public void actionPerformed(ActionEvent e) {
630618 }
631619
632620
621+ /**
622+ * Require examples to explicitly state that they're compatible with this
623+ * Mode before they're included. Helpful for Modes like p5js or Python
624+ * where the .java examples cannot be used.
625+ * @since 3.2
626+ * @return true if an examples package must list this Mode's identifier
627+ */
628+ public boolean requireExampleCompatibility () {
629+ return false ;
630+ }
631+
632+
633633 /**
634634 * Override this to control the order of the first set of example folders
635635 * and how they appear in the examples window.
0 commit comments