()
| 1669 | } |
| 1670 | |
| 1671 | void installStartupMacroSet() { |
| 1672 | if (macrosPath==null) { |
| 1673 | MacroInstaller.installFromJar("/macros/StartupMacros.txt"); |
| 1674 | return; |
| 1675 | } |
| 1676 | String path = macrosPath + "StartupMacros.txt"; |
| 1677 | File f = new File(path); |
| 1678 | if (!f.exists()) { |
| 1679 | path = macrosPath + "StartupMacros.ijm"; |
| 1680 | f = new File(path); |
| 1681 | if (!f.exists()) { |
| 1682 | (new MacroInstaller()).installFromIJJar("/macros/StartupMacros.txt"); |
| 1683 | return; |
| 1684 | } |
| 1685 | } else { |
| 1686 | if ("StartupMacros.fiji.ijm".equals(f.getName())) |
| 1687 | path = f.getPath(); |
| 1688 | } |
| 1689 | String libraryPath = macrosPath + "Library.txt"; |
| 1690 | f = new File(libraryPath); |
| 1691 | boolean isLibrary = f.exists(); |
| 1692 | try { |
| 1693 | MacroInstaller mi = new MacroInstaller(); |
| 1694 | if (isLibrary) mi.installLibrary(libraryPath); |
| 1695 | mi.installStartupMacros(path); |
| 1696 | nMacros += mi.getMacroCount(); |
| 1697 | } catch (Exception e) {} |
| 1698 | } |
| 1699 | |
| 1700 | static boolean validShortcut(String shortcut) { |
| 1701 | int len = shortcut.length(); |
no test coverage detected