Read and apply new values from the preferences, either because the app is just starting up, or the user just finished messing with things in the Preferences window.
()
| 666 | * with things in the Preferences window. |
| 667 | */ |
| 668 | protected void applyPreferences() { |
| 669 | // Update fonts and other items controllable from the prefs |
| 670 | textarea.getPainter().updateAppearance(); |
| 671 | textarea.repaint(); |
| 672 | |
| 673 | console.updateAppearance(); |
| 674 | |
| 675 | // All of this code was specific to using an external editor. |
| 676 | /* |
| 677 | // // apply the setting for 'use external editor' |
| 678 | // boolean external = Preferences.getBoolean("editor.external"); |
| 679 | // textarea.setEditable(!external); |
| 680 | // saveMenuItem.setEnabled(!external); |
| 681 | // saveAsMenuItem.setEnabled(!external); |
| 682 | |
| 683 | TextAreaPainter painter = textarea.getPainter(); |
| 684 | // if (external) { |
| 685 | // // disable line highlight and turn off the caret when disabling |
| 686 | // Color color = mode.getColor("editor.external.bgcolor"); |
| 687 | // painter.setBackground(color); |
| 688 | // painter.setLineHighlightEnabled(false); |
| 689 | // textarea.setCaretVisible(false); |
| 690 | // } else { |
| 691 | Color color = mode.getColor("editor.bgcolor"); |
| 692 | painter.setBackground(color); |
| 693 | boolean highlight = Preferences.getBoolean("editor.linehighlight"); |
| 694 | painter.setLineHighlightEnabled(highlight); |
| 695 | textarea.setCaretVisible(true); |
| 696 | // } |
| 697 | |
| 698 | // apply changes to the font size for the editor |
| 699 | // painter.setFont(Preferences.getFont("editor.font")); |
| 700 | |
| 701 | // in case tab expansion stuff has changed |
| 702 | // removing this, just checking prefs directly instead |
| 703 | // listener.applyPreferences(); |
| 704 | |
| 705 | // in case moved to a new location |
| 706 | // For 0125, changing to async version (to be implemented later) |
| 707 | //sketchbook.rebuildMenus(); |
| 708 | // For 0126, moved into Base, which will notify all editors. |
| 709 | //base.rebuildMenusAsync(); |
| 710 | */ |
| 711 | } |
| 712 | |
| 713 | |
| 714 | // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
no test coverage detected