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

Method installMacros

ij/src/main/java/ij/plugin/frame/Editor.java:431–451  ·  view source on GitHub ↗
(String text, boolean installInPluginsMenu)

Source from the content-addressed store, hash-verified

429 }
430
431 void installMacros(String text, boolean installInPluginsMenu) {
432 if (rejectMacrosMsg != null){
433 if (rejectMacrosMsg.length()> 0)
434 IJ.showMessage("", rejectMacrosMsg);
435 return;
436 }
437 String functions = Interpreter.getAdditionalFunctions();
438 if (functions!=null && text!=null) {
439 if (!(text.endsWith("\n") || functions.startsWith("\n")))
440 text = text + "\n" + functions;
441 else
442 text = text + functions;
443 }
444 installer = new MacroInstaller();
445 installer.setFileName(getTitle());
446 int nShortcuts = installer.install(text, macrosMenu);
447 if (installInPluginsMenu || nShortcuts>0)
448 installer.install(null);
449 dontShowWindow = installer.isAutoRunAndHide();
450 currentMacroEditor = this;
451 }
452
453 /** Opens a file and replaces the text (if any) by the contents of the file. */
454 public void open(String dir, String name) {

Callers 2

createMethod · 0.95
actionPerformedMethod · 0.95

Calls 8

showMessageMethod · 0.95
startsWithMethod · 0.80
isAutoRunAndHideMethod · 0.80
lengthMethod · 0.65
getTitleMethod · 0.65
setFileNameMethod · 0.45
installMethod · 0.45

Tested by

no test coverage detected