(String text, boolean installInPluginsMenu)
| 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) { |
no test coverage detected