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

Method addPlugInTool

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

Adds a plugin tool to the first available toolbar slot, or to the last slot if the toolbar is full.

(PlugInTool tool)

Source from the content-addressed store, hash-verified

1953 /** Adds a plugin tool to the first available toolbar slot,
1954 or to the last slot if the toolbar is full. */
1955 public static void addPlugInTool(PlugInTool tool) {
1956 if (instance==null) return;
1957 String nameAndIcon = tool.getToolName()+" - "+tool.getToolIcon();
1958 instance.addingSingleTool = true;
1959 int id = instance.addTool(nameAndIcon);
1960 instance.addingSingleTool = false;
1961 if (id!=-1) {
1962 instance.tools[id] = tool;
1963 if (instance.menus[id]!=null)
1964 instance.menus[id].removeAll();
1965 instance.repaintTool(id);
1966 if (!instance.installingStartupTool)
1967 instance.setTool(id);
1968 else
1969 instance.installingStartupTool = false;
1970 instance.setPrefs(id);
1971 }
1972 }
1973
1974 public static PlugInTool getPlugInTool() {
1975 PlugInTool tool = null;

Callers 2

runMethod · 0.95
runMethod · 0.95

Calls 7

addToolMethod · 0.80
repaintToolMethod · 0.80
setPrefsMethod · 0.80
getToolNameMethod · 0.45
getToolIconMethod · 0.45
removeAllMethod · 0.45
setToolMethod · 0.45

Tested by

no test coverage detected