2323
2424package processing .app ;
2525
26+ import processing .app .ui .Editor ;
27+ import processing .app .ui .ProgressFrame ;
28+ import processing .app .ui .Toolkit ;
2629import processing .core .*;
2730
2831import java .awt .Component ;
@@ -407,8 +410,8 @@ public void keyTyped(KeyEvent event) {
407410 JOptionPane .OK_CANCEL_OPTION ,
408411 JOptionPane .PLAIN_MESSAGE ,
409412 null , new Object [] {
410- Preferences .PROMPT_OK ,
411- Preferences .PROMPT_CANCEL },
413+ Toolkit .PROMPT_OK ,
414+ Toolkit .PROMPT_CANCEL },
412415 field );
413416
414417 if (userReply == JOptionPane .OK_OPTION ) {
@@ -604,7 +607,7 @@ protected void nameCode(String newName) {
604607 setCurrentCode (newName );
605608
606609 // update the tabs
607- editor .header . rebuild ();
610+ editor .rebuildHeader ();
608611 }
609612
610613
@@ -657,7 +660,7 @@ public void handleDeleteCode() {
657660 // make a new sketch, and i think this will rebuild the sketch menu
658661 //editor.handleNewUnchecked();
659662 //editor.handleClose2();
660- editor .base .handleClose (editor , false );
663+ editor .getBase () .handleClose (editor , false );
661664
662665 } else {
663666 // delete the file
@@ -675,7 +678,7 @@ public void handleDeleteCode() {
675678 setCurrentCode (0 );
676679
677680 // update the tabs
678- editor .header . repaint ();
681+ editor .repaintHeader ();
679682 }
680683 }
681684 }
@@ -737,7 +740,7 @@ protected void calcModified() {
737740 break ;
738741 }
739742 }
740- editor .header . repaint ();
743+ editor .repaintHeader ();
741744
742745 if (Base .isMacOS ()) {
743746 // http://developer.apple.com/qa/qa2001/qa1146.html
@@ -797,7 +800,7 @@ public boolean save() throws IOException {
797800 * Also removes the previously-generated .class and .jar files,
798801 * because they can cause trouble.
799802 */
800- protected boolean saveAs () throws IOException {
803+ public boolean saveAs () throws IOException {
801804 String newParentDir = null ;
802805 String newName = null ;
803806
@@ -1005,8 +1008,8 @@ protected void updateInternal(String sketchName, File sketchFolder) {
10051008 calcModified ();
10061009// System.out.println("modified is now " + modified);
10071010 editor .updateTitle ();
1008- editor .base .rebuildSketchbookMenus ();
1009- editor .base .handleRecentRename (editor ,oldPath );
1011+ editor .getBase () .rebuildSketchbookMenus ();
1012+ editor .getBase () .handleRecentRename (editor ,oldPath );
10101013// editor.header.rebuild();
10111014 }
10121015
@@ -1099,7 +1102,7 @@ public boolean addFile(File sourceFile) {
10991102 // check whether this file already exists
11001103 if (destFile .exists ()) {
11011104 Object [] options = { Language .text ("prompt.ok" ), Language .text ("prompt.cancel" ) };
1102- String prompt = Language .interpolate ("add_file.messages.confirm_replace" ,
1105+ String prompt = Language .interpolate ("add_file.messages.confirm_replace" ,
11031106 filename );
11041107 int result = JOptionPane .showOptionDialog (editor ,
11051108 prompt ,
@@ -1167,7 +1170,7 @@ public boolean addFile(File sourceFile) {
11671170 sortCode ();
11681171 }
11691172 setCurrentCode (filename );
1170- editor .header . repaint ();
1173+ editor .repaintHeader ();
11711174 if (isUntitled ()) { // TODO probably not necessary? problematic?
11721175 // Mark the new code as modified so that the sketch is saved
11731176 current .setModified (true );
@@ -1217,16 +1220,15 @@ public void setCurrentCode(int which) {
12171220 current .visited = System .currentTimeMillis ();
12181221
12191222 editor .setCode (current );
1220- // editor.header.rebuild();
1221- editor .header .repaint ();
1223+ editor .repaintHeader ();
12221224 }
12231225
12241226
12251227 /**
12261228 * Internal helper function to set the current tab based on a name.
12271229 * @param findName the file name (not pretty name) to be shown
12281230 */
1229- protected void setCurrentCode (String findName ) {
1231+ public void setCurrentCode (String findName ) {
12301232 for (int i = 0 ; i < codeCount ; i ++) {
12311233 if (findName .equals (code [i ].getFileName ()) ||
12321234 findName .equals (code [i ].getPrettyName ())) {
0 commit comments