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

Method addMacroTool

ij/src/main/java/ij/gui/Toolbar.java:1856–1879  ·  view source on GitHub ↗

Used by the MacroInstaller class to install a set of macro tools.

(String name, MacroInstaller macroInstaller, int id)

Source from the content-addressed store, hash-verified

1854
1855 /** Used by the MacroInstaller class to install a set of macro tools. */
1856 public void addMacroTool(String name, MacroInstaller macroInstaller, int id) {
1857 if (id==0) {
1858 resetTools();
1859 if (name.startsWith("Unused"))
1860 return;
1861 }
1862 if (name.endsWith(" Built-in Tool")) {
1863 name = name.substring(0,name.length()-14);
1864 doNotSavePrefs = true;
1865 boolean ok = installBuiltinTool(name);
1866 if (!ok) {
1867 Hashtable commands = Menus.getCommands();
1868 if (commands!=null && commands.get(name)!=null)
1869 IJ.run(name);
1870 }
1871 doNotSavePrefs = false;
1872 return;
1873 }
1874 this.macroInstaller = macroInstaller;
1875 int tool = addTool(name);
1876 this.macroInstaller = null;
1877 if (tool!=-1)
1878 tools[tool] = new MacroToolRunner(macroInstaller);
1879 }
1880
1881 private void resetTools() {
1882 for (int i=CUSTOM1; i<getNumTools()-1; i++) {

Callers 1

installMethod · 0.95

Calls 13

resetToolsMethod · 0.95
installBuiltinToolMethod · 0.95
getCommandsMethod · 0.95
runMethod · 0.95
addToolMethod · 0.95
setToolMethod · 0.95
setPrefsMethod · 0.95
startsWithMethod · 0.80
substringMethod · 0.80
lengthMethod · 0.65
getMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected