Opens a file from the File/Open Recent menu and returns 'true' if successful.
(String cmd)
| 245 | /** Opens a file from the File/Open Recent menu |
| 246 | and returns 'true' if successful. */ |
| 247 | boolean openRecent(String cmd) { |
| 248 | Menu menu = Menus.getOpenRecentMenu(); |
| 249 | if (menu==null) return false; |
| 250 | for (int i=0; i<menu.getItemCount(); i++) { |
| 251 | if (menu.getItem(i).getLabel().equals(cmd)) { |
| 252 | IJ.open(cmd); |
| 253 | return true; |
| 254 | } |
| 255 | } |
| 256 | return false; |
| 257 | } |
| 258 | |
| 259 | /** Returns the last command executed. Returns null |
| 260 | if no command has been executed. */ |
no test coverage detected