2121
2222package processing .app .ui ;
2323
24- import java .awt .event .*;
25- import java .io .*;
24+ import java .awt .event .ActionEvent ;
25+ import java .awt .event .ActionListener ;
26+ import java .io .BufferedReader ;
27+ import java .io .File ;
28+ import java .io .IOException ;
29+ import java .io .PrintWriter ;
2630import java .util .ArrayList ;
2731import java .util .List ;
2832
29- import javax .swing .*;
33+ import javax .swing .JMenu ;
34+ import javax .swing .JMenuItem ;
3035
3136import processing .app .Base ;
3237import processing .app .Language ;
@@ -128,7 +133,8 @@ static private void updateMenu(JMenu menu) {
128133 }
129134
130135
131- static private void updateMenuRecord (JMenu menu , final Record rec , String sketchbookPath ) {
136+ static private void updateMenuRecord (JMenu menu , final Record rec ,
137+ String sketchbookPath ) {
132138 try {
133139 String recPath = new File (rec .getPath ()).getParent ();
134140 String purtyPath = null ;
@@ -275,7 +281,7 @@ synchronized static public void remove(Editor editor) {
275281 * entry on the Recent queue. If the sketch is already in the list, it is
276282 * first removed so it doesn't show up multiple times.
277283 */
278- synchronized static public void handle (Editor editor ) {
284+ synchronized static public void append (Editor editor ) {
279285 if (!editor .getSketch ().isUntitled ()) {
280286 // If this sketch is already in the menu, remove it
281287 remove (editor );
@@ -295,18 +301,18 @@ synchronized static public void handle(Editor editor) {
295301 }
296302 }
297303
298- //handles renaming done within processing
299- synchronized static public void handleRename (Editor editor ,String oldPath ){
300- if (records .size () == Preferences .getInteger ("recent.count" )) {
301- records .remove (0 ); // remove the first entry
302- }
303- int index = findRecord (oldPath );
304- //check if record exists
305- if (index != -1 ) {
306- records .remove (index );
307- }
308- records .add (new Record (editor ));
309- save ();
304+
305+ synchronized static public void rename (Editor editor , String oldPath ) {
306+ if (records .size () == Preferences .getInteger ("recent.count" )) {
307+ records .remove (0 ); // remove the first entry
308+ }
309+ int index = findRecord (oldPath );
310+ //check if record exists
311+ if (index != -1 ) {
312+ records .remove (index );
313+ }
314+ records .add (new Record (editor ));
315+ save ();
310316 }
311317
312318
0 commit comments