@@ -518,6 +518,22 @@ public TextEditor(final Context context) {
518518 final JCheckBoxMenuItem jcmi2 = new JCheckBoxMenuItem ("Console" , true );
519519 jcmi2 .addItemListener (e -> collapseSplitPane (1 , !jcmi2 .isSelected ()));
520520 tabsMenu .add (jcmi2 );
521+ final JMenuItem mi = new JMenuItem ("Reset Layout..." );
522+ mi .addActionListener (e -> {
523+ final int choice = JOptionPane .showConfirmDialog (TextEditor .this ,//
524+ "Reset Location of Console and File Explorer?" ,
525+ "Reset Layout?" , JOptionPane .OK_CANCEL_OPTION );
526+ if (JOptionPane .OK_OPTION == choice ) {
527+ body .setDividerLocation (.2d );
528+ getTab ().setDividerLocation (.75d );
529+ if (incremental )
530+ getTab ().setREPLVisible (incremental );
531+ getTab ().getScreenAndPromptSplit ().setDividerLocation (.5d );
532+ jcmi1 .setSelected (true );
533+ jcmi2 .setSelected (true );
534+ }
535+ });
536+ tabsMenu .add (mi );
521537 addSeparator (tabsMenu , "Tabs:" );
522538 nextTab = addToMenu (tabsMenu , "Next Tab" , KeyEvent .VK_PAGE_DOWN , ctrl );
523539 nextTab .setMnemonic (KeyEvent .VK_N );
@@ -636,10 +652,7 @@ public TextEditor(final Context context) {
636652 getContentPane ().setLayout (new BoxLayout (getContentPane (), BoxLayout .Y_AXIS ));
637653
638654 // Tweaks for JSplitPane
639- // TF: disable setOneTouchExpandable() due to inconsistent behavior when
640- // applying preferences at startup. Also, it does not apply to all L&Fs.
641- // Users can use the controls in the menu bar to toggle the pane
642- body .setOneTouchExpandable (false );
655+ body .setOneTouchExpandable (true );
643656 body .addPropertyChangeListener (evt -> {
644657 if ("dividerLocation" .equals (evt .getPropertyName ())) saveWindowSizeToPrefs ();
645658 });
0 commit comments