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

Method add

ij/src/main/java/ij/Menus.java:1803–1813  ·  view source on GitHub ↗

Adds a command to the ImageJ menu bar.

(String menuPath, String plugin)

Source from the content-addressed store, hash-verified

1801
1802 /** Adds a command to the ImageJ menu bar. */
1803 public static void add(String menuPath, String plugin) {
1804 if (pluginsTable==null)
1805 return;
1806 int index = menuPath.lastIndexOf(">");
1807 if (index==-1 || index==menuPath.length()-1)
1808 return;
1809 String label = menuPath.substring(index+1, menuPath.length());
1810 menuPath = menuPath.substring(0, index);
1811 pluginsTable.put(label, plugin);
1812 addItem(getMenu(menuPath), label, 0, false);
1813 }
1814
1815 /** Work around Windows bug that limits menu bar sub-menu to 17 points. */
1816 private static void fixFontSize(MenuItem item) {

Callers

nothing calls this directly

Calls 5

addItemMethod · 0.95
getMenuMethod · 0.95
substringMethod · 0.80
lengthMethod · 0.65
putMethod · 0.45

Tested by

no test coverage detected