@@ -1956,18 +1956,20 @@ public void rebuildSketchbook() {
1956
1956
1957
1957
1958
1958
public void populateSketchbookMenu (JMenu menu ) {
1959
- boolean found = false ;
1960
- try {
1961
- found = addSketches (menu , sketchbookFolder );
1962
- } catch (Exception e ) {
1963
- Messages .showWarning ("Sketchbook Menu Error" ,
1964
- "An error occurred while trying to list the sketchbook." , e );
1965
- }
1966
- if (!found ) {
1967
- JMenuItem empty = new JMenuItem (Language .text ("menu.file.sketchbook.empty" ));
1968
- empty .setEnabled (false );
1969
- menu .add (empty );
1970
- }
1959
+ new Thread (() -> {
1960
+ boolean found = false ;
1961
+ try {
1962
+ found = addSketches (menu , sketchbookFolder );
1963
+ } catch (Exception e ) {
1964
+ Messages .showWarning ("Sketchbook Menu Error" ,
1965
+ "An error occurred while trying to list the sketchbook." , e );
1966
+ }
1967
+ if (!found ) {
1968
+ JMenuItem empty = new JMenuItem (Language .text ("menu.file.sketchbook.empty" ));
1969
+ empty .setEnabled (false );
1970
+ menu .add (empty );
1971
+ }
1972
+ }).start ();
1971
1973
}
1972
1974
1973
1975
@@ -1978,11 +1980,17 @@ public void populateSketchbookMenu(JMenu menu) {
1978
1980
* sketch should open in a new window.
1979
1981
*/
1980
1982
protected boolean addSketches (JMenu menu , File folder ) {
1983
+ Messages .log ("scanning " + folder .getAbsolutePath ());
1981
1984
// skip .DS_Store files, etc. (this shouldn't actually be necessary)
1982
1985
if (!folder .isDirectory ()) {
1983
1986
return false ;
1984
1987
}
1985
1988
1989
+ // Don't look inside the 'android' folders in the sketchbook
1990
+ if (folder .getName ().equals ("android" )) {
1991
+ return false ;
1992
+ }
1993
+
1986
1994
if (folder .getName ().equals ("libraries" )) {
1987
1995
return false ; // let's not go there
1988
1996
}
@@ -2068,13 +2076,19 @@ protected boolean addSketches(JMenu menu, File folder) {
2068
2076
*/
2069
2077
public boolean addSketches (DefaultMutableTreeNode node , File folder ,
2070
2078
boolean examples ) throws IOException {
2079
+ Messages .log ("scanning " + folder .getAbsolutePath ());
2071
2080
// skip .DS_Store files, etc. (this shouldn't actually be necessary)
2072
2081
if (!folder .isDirectory ()) {
2073
2082
return false ;
2074
2083
}
2075
2084
2076
2085
final String folderName = folder .getName ();
2077
2086
2087
+ // Don't look inside the 'android' folders in the sketchbook
2088
+ if (folderName .equals ("android" )) {
2089
+ return false ;
2090
+ }
2091
+
2078
2092
// Don't look inside the 'libraries' folders in the sketchbook
2079
2093
if (folderName .equals ("libraries" )) {
2080
2094
return false ;
0 commit comments