Adds a command to the ImageJ menu bar.
(String menuPath, String plugin)
| 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) { |