Called by Base when a new sketch is opened, to add the sketch to the last entry on the Recent queue. If the sketch is already in the list, it is first removed so it doesn't show up multiple times.
(Editor editor)
| 289 | * first removed so it doesn't show up multiple times. |
| 290 | */ |
| 291 | synchronized static public void append(Editor editor) { |
| 292 | if (!editor.getSketch().isUntitled()) { |
| 293 | // If this sketch is already in the menu, remove it |
| 294 | remove(editor); |
| 295 | |
| 296 | // If the list is full, remove the first entry |
| 297 | if (records.size() == Preferences.getInteger("recent.count")) { |
| 298 | records.remove(0); // remove the first entry |
| 299 | } |
| 300 | |
| 301 | // new Exception("adding to recent: " + editor.getSketch().getMainFilePath()).printStackTrace(System.out); |
| 302 | // Record newRec = new Record(editor, editor.getSketch()); |
| 303 | // records.add(newRec); |
| 304 | records.add(new Record(editor)); |
| 305 | // updateMenu(); |
| 306 | save(); |
| 307 | // } else { |
| 308 | // new Exception("NOT adding to recent: " + editor.getSketch().getMainFilePath()).printStackTrace(System.out); |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | |
| 313 | synchronized static public void rename(Editor editor, String oldPath) { |