@@ -1942,18 +1942,20 @@ public void rebuildSketchbook() {
1942
1942
1943
1943
1944
1944
public void populateSketchbookMenu (JMenu menu ) {
1945
- boolean found = false ;
1946
- try {
1947
- found = addSketches (menu , sketchbookFolder );
1948
- } catch (Exception e ) {
1949
- Messages .showWarning ("Sketchbook Menu Error" ,
1950
- "An error occurred while trying to list the sketchbook." , e );
1951
- }
1952
- if (!found ) {
1953
- JMenuItem empty = new JMenuItem (Language .text ("menu.file.sketchbook.empty" ));
1954
- empty .setEnabled (false );
1955
- menu .add (empty );
1956
- }
1945
+ new Thread (() -> {
1946
+ boolean found = false ;
1947
+ try {
1948
+ found = addSketches (menu , sketchbookFolder );
1949
+ } catch (Exception e ) {
1950
+ Messages .showWarning ("Sketchbook Menu Error" ,
1951
+ "An error occurred while trying to list the sketchbook." , e );
1952
+ }
1953
+ if (!found ) {
1954
+ JMenuItem empty = new JMenuItem (Language .text ("menu.file.sketchbook.empty" ));
1955
+ empty .setEnabled (false );
1956
+ menu .add (empty );
1957
+ }
1958
+ }).start ();
1957
1959
}
1958
1960
1959
1961
@@ -1964,11 +1966,17 @@ public void populateSketchbookMenu(JMenu menu) {
1964
1966
* sketch should open in a new window.
1965
1967
*/
1966
1968
protected boolean addSketches (JMenu menu , File folder ) {
1969
+ Messages .log ("scanning " + folder .getAbsolutePath ());
1967
1970
// skip .DS_Store files, etc. (this shouldn't actually be necessary)
1968
1971
if (!folder .isDirectory ()) {
1969
1972
return false ;
1970
1973
}
1971
1974
1975
+ // Don't look inside the 'android' folders in the sketchbook
1976
+ if (folder .getName ().equals ("android" )) {
1977
+ return false ;
1978
+ }
1979
+
1972
1980
if (folder .getName ().equals ("libraries" )) {
1973
1981
return false ; // let's not go there
1974
1982
}
@@ -2054,13 +2062,19 @@ protected boolean addSketches(JMenu menu, File folder) {
2054
2062
*/
2055
2063
public boolean addSketches (DefaultMutableTreeNode node , File folder ,
2056
2064
boolean examples ) throws IOException {
2065
+ Messages .log ("scanning " + folder .getAbsolutePath ());
2057
2066
// skip .DS_Store files, etc. (this shouldn't actually be necessary)
2058
2067
if (!folder .isDirectory ()) {
2059
2068
return false ;
2060
2069
}
2061
2070
2062
2071
final String folderName = folder .getName ();
2063
2072
2073
+ // Don't look inside the 'android' folders in the sketchbook
2074
+ if (folderName .equals ("android" )) {
2075
+ return false ;
2076
+ }
2077
+
2064
2078
// Don't look inside the 'libraries' folders in the sketchbook
2065
2079
if (folderName .equals ("libraries" )) {
2066
2080
return false ;
0 commit comments