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

Method isMacro

ij/src/main/java/ij/io/SaveDialog.java:71–92  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69 }
70
71 boolean isMacro() {
72 String macroOptions = Macro.getOptions();
73 if (macroOptions!=null) {
74 String path = Macro.getValue(macroOptions, title, null);
75 if (path==null)
76 path = Macro.getValue(macroOptions, "path", null);
77 if (path!=null && path.indexOf(".")==-1 && !((new File(path)).exists())) {
78 // Is 'path' a macro variable?
79 if (path.startsWith("&")) path=path.substring(1);
80 Interpreter interp = Interpreter.getInstance();
81 String path2 = interp!=null?interp.getStringVariable(path):null;
82 if (path2!=null) path = path2;
83 }
84 if (path!=null) {
85 Opener o = new Opener();
86 dir = o.getDir(path);
87 name = o.getName(path);
88 return true;
89 }
90 }
91 return false;
92 }
93
94 @AstroImageJ(reason = "Handle case of double extension for save dialog", modified = true)
95 public static String setExtension(String name, String extension) {

Callers 1

SaveDialogMethod · 0.95

Calls 10

getOptionsMethod · 0.95
getValueMethod · 0.95
getInstanceMethod · 0.95
getStringVariableMethod · 0.95
getDirMethod · 0.95
getNameMethod · 0.95
startsWithMethod · 0.80
substringMethod · 0.80
indexOfMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected