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)
| 236 | * first removed so it doesn't show up multiple times. |
| 237 | */ |
| 238 | synchronized static public void append(Editor editor) { |
| 239 | if (!editor.getSketch().isUntitled()) { |
| 240 | // If this sketch is already in the menu, remove it |
| 241 | remove(editor); |
| 242 | |
| 243 | // If the list is full, remove the first entry |
| 244 | if (records.size() == Preferences.getInteger("recent.count")) { |
| 245 | records.remove(0); // remove the first entry |
| 246 | } |
| 247 | |
| 248 | records.add(new Record(editor)); |
| 249 | save(); |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | |
| 254 | synchronized static public void rename(Editor editor, String oldPath) { |