MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / installSubdirectorMacros

Method installSubdirectorMacros

ij/src/main/java/ij/Menus.java:1213–1225  ·  view source on GitHub ↗

Installs macros and scripts located in subdirectories.

(File f2, String dir)

Source from the content-addressed store, hash-verified

1211
1212 /** Installs macros and scripts located in subdirectories. */
1213 private static void installSubdirectorMacros(File f2, String dir) {
1214 if (dir.endsWith("Launchers")) return;
1215 String[] list = f2.list();
1216 if (list==null) return;
1217 for (int i=0; i<list.length; i++) {
1218 String name = list[i];
1219 boolean hasUnderscore = name.indexOf('_')>=0;
1220 if (validMacroName(name,hasUnderscore)) {
1221 if (macroFiles==null) macroFiles = new Vector();
1222 macroFiles.addElement(dir+"/"+name);
1223 }
1224 }
1225 }
1226
1227 private static boolean validMacroName(String name, boolean hasUnderscore) {
1228 return (hasUnderscore&&name.endsWith(".txt")) || name.endsWith(".ijm")

Callers 1

checkSubdirectoryMethod · 0.95

Calls 4

validMacroNameMethod · 0.95
listMethod · 0.45
indexOfMethod · 0.45
addElementMethod · 0.45

Tested by

no test coverage detected