@@ -1212,34 +1212,17 @@ public void actionPerformed(ActionEvent event) {
1212
1212
1213
1213
for (String potentialName : list ) {
1214
1214
File libFolder = new File (folder , potentialName );
1215
- // File libraryFolder = new File(subfolder, "library");
1216
- // File libraryJar = new File(libraryFolder, potentialName + ".jar");
1217
- // // If a .jar file of the same prefix as the folder exists
1218
- // // inside the 'library' subfolder of the sketch
1219
- // if (libraryJar.exists()) {
1220
- String sanityCheck = Sketch .sanitizeName (potentialName );
1221
- if (!sanityCheck .equals (potentialName )) {
1222
- String mess = I18n .format (
1223
- _ ("The library \" {0}\" cannot be used.\n " +
1224
- "Library names must contain only basic letters and numbers.\n " +
1225
- "(ASCII only and no spaces, and it cannot start with a number)" ),
1226
- potentialName
1227
- );
1228
- Base .showMessage (_ ("Ignoring bad library name" ), mess );
1229
- continue ;
1230
- }
1215
+ String sanityCheck = Sketch .sanitizeName (potentialName );
1216
+ if (!sanityCheck .equals (potentialName )) {
1217
+ String mess = I18n .format (_ ("The library \" {0}\" cannot be used.\n "
1218
+ + "Library names must contain only basic letters and numbers.\n "
1219
+ + "(ASCII only and no spaces, and it cannot start with a number)" ),
1220
+ potentialName );
1221
+ Base .showMessage (_ ("Ignoring bad library name" ), mess );
1222
+ continue ;
1223
+ }
1231
1224
1232
- String libraryName = potentialName ;
1233
- // // get the path for all .jar files in this code folder
1234
- // String libraryClassPath =
1235
- // Compiler.contentsToClassPath(libraryFolder);
1236
- // // grab all jars and classes from this folder,
1237
- // // and append them to the library classpath
1238
- // librariesClassPath +=
1239
- // File.pathSeparatorChar + libraryClassPath;
1240
- // // need to associate each import with a library folder
1241
- // String packages[] =
1242
- // Compiler.packageListFromClassPath(libraryClassPath);
1225
+ String libraryName = potentialName ;
1243
1226
libraries .add (libFolder );
1244
1227
String libFolderPath = libFolder .getAbsolutePath ();
1245
1228
try {
@@ -1268,22 +1251,11 @@ public void actionPerformed(ActionEvent event) {
1268
1251
"Unable to list header files in {0}" , libFolder ), e );
1269
1252
}
1270
1253
1271
- JMenuItem item = new JMenuItem (libraryName );
1272
- item .addActionListener (listener );
1273
- item .setActionCommand (libFolderPath );
1274
- menu .add (item );
1275
- ifound = true ;
1276
-
1277
- // XXX: DAM: should recurse here so that library folders can be nested
1278
- // } else { // not a library, but is still a folder, so recurse
1279
- // JMenu submenu = new JMenu(libraryName);
1280
- // // needs to be separate var, otherwise would set ifound to false
1281
- // boolean found = addLibraries(submenu, subfolder);
1282
- // if (found) {
1283
- // menu.add(submenu);
1284
- // ifound = true;
1285
- // }
1286
- // }
1254
+ JMenuItem item = new JMenuItem (libraryName );
1255
+ item .addActionListener (listener );
1256
+ item .setActionCommand (libFolderPath );
1257
+ menu .add (item );
1258
+ ifound = true ;
1287
1259
}
1288
1260
return ifound ;
1289
1261
}
0 commit comments