()
| 86 | } |
| 87 | |
| 88 | void removeHotkey() { |
| 89 | String[] shortcuts = getShortcuts(); |
| 90 | if (shortcuts==null) { |
| 91 | IJ.showMessage("Remove...", "No shortcuts found."); |
| 92 | return; |
| 93 | } |
| 94 | GenericDialog gd = new GenericDialog("Remove"); |
| 95 | gd.addChoice("Shortcut:", shortcuts, ""); |
| 96 | if (shortcuts.length>1) |
| 97 | gd.addCheckbox("Remove all "+shortcuts.length+" shortcuts", false); |
| 98 | gd.addMessage("Shortcuts are not removed\nuntil ImageJ is restarted."); |
| 99 | gd.showDialog(); |
| 100 | if (gd.wasCanceled()) |
| 101 | return; |
| 102 | command = gd.getNextChoice(); |
| 103 | boolean removeAll = false; |
| 104 | if (shortcuts.length>1) |
| 105 | removeAll = gd.getNextBoolean(); |
| 106 | if (removeAll) { |
| 107 | boolean ok = IJ.showMessageWithCancel("Remove", "Remove all "+shortcuts.length+" shortcuts?"); |
| 108 | if (!ok) |
| 109 | return; |
| 110 | command = ""; |
| 111 | } else { |
| 112 | shortcuts = new String[1]; |
| 113 | shortcuts[0] = command; |
| 114 | } |
| 115 | int count = 0; |
| 116 | for (int i=0; i<shortcuts.length; i++) { |
| 117 | int err = Menus.uninstallPlugin(shortcuts[i]); |
| 118 | if (err==Menus.NORMAL_RETURN) |
| 119 | count++; |
| 120 | } |
| 121 | if (count==0) |
| 122 | IJ.showStatus("No shortcuts removed"); |
| 123 | else |
| 124 | IJ.showStatus(count+" shortcut"+(count>1?"s":"")+" removed; ImageJ restart required"); |
| 125 | } |
| 126 | |
| 127 | private void listCommands() { |
| 128 | String[] commands = getAllCommands(); |
no test coverage detected