@@ -2228,6 +2228,17 @@ public void actionPerformed(ActionEvent ae) {
22282228 popup .setVisible (true );
22292229 }
22302230 };
2231+
2232+ /** Action that starts a new, blank, unconnected DrJava instance. */
2233+ private final Action _newDrJavaInstanceAction = new AbstractAction ("New DrJava Instance..." ) {
2234+ public void actionPerformed (ActionEvent ae ) {
2235+ try {
2236+ Process p = edu .rice .cs .plt .concurrent .JVMBuilder .DEFAULT .classPath (FileOps .getDrJavaFile ()).
2237+ start (edu .rice .cs .drjava .DrJava .class .getName (), "-new" );
2238+ }
2239+ catch (IOException ioe ) { MainFrameStatics .showIOError (MainFrame .this , ioe ); }
2240+ }
2241+ };
22312242
22322243 /** Action that switches to next document. Only runs in the event thread. */
22332244 private final Action _switchToNextAction = new AbstractAction ("Next Document" ) {
@@ -5276,6 +5287,14 @@ void quit() {
52765287 // on HP tc1100 and Toshiba Portege tablet PCs, but did not help in all cases
52775288 if (! _closeProject (true )) { return ; /* if user pressed cancel, do not quit */ }
52785289
5290+ _updateSavedConfiguration ();
5291+
5292+ //DrJava.consoleOut().println("Quitting DrJava...");
5293+ dispose (); // Free GUI elements of this frame
5294+ _model .quit ();
5295+ }
5296+
5297+ void _updateSavedConfiguration () {
52795298 _recentFileManager .saveRecentFiles ();
52805299 _recentProjectManager .saveRecentFiles ();
52815300 if (! _model .closeAllFilesOnQuit ()) { return ; /* if user pressed cancel, do not quit */ }
@@ -5287,9 +5306,6 @@ void quit() {
52875306 try { DrJava .getConfig ().saveConfiguration (); }
52885307 catch (IOException ioe ) { MainFrameStatics .showIOError (MainFrame .this , ioe ); }
52895308 }
5290- //DrJava.consoleOut().println("Quitting DrJava...");
5291- dispose (); // Free GUI elements of this frame
5292- _model .quit ();
52935309 }
52945310
52955311 private void _forceQuit () { _model .forceQuit (); }
@@ -6637,6 +6653,7 @@ public void actionPerformed(ActionEvent ae) {
66376653 DrJava .getConfig ().getSetting (OptionConstants .EXTERNAL_SAVED_COUNT )));
66386654 final JMenu advancedMenu = new JMenu ("Advanced" );
66396655 _addMenuItem (advancedMenu , _generateCustomDrJavaJarAction , KEY_GENERATE_CUSTOM_DRJAVA );
6656+ _addMenuItem (advancedMenu , _newDrJavaInstanceAction , KEY_NEW_DRJAVA_INSTANCE );
66406657 toolsMenu .add (advancedMenu );
66416658
66426659 toolsMenu .addSeparator ();
0 commit comments