Theme Editor: added editor theme

This commit is contained in:
Karl Tauber
2020-04-05 11:52:31 +02:00
parent d59d353c2e
commit 54c14d0dc8
2 changed files with 87 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ import java.nio.charset.StandardCharsets;
import javax.swing.JPanel;
import org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory;
import org.fife.ui.rsyntaxtextarea.FileLocation;
import org.fife.ui.rsyntaxtextarea.Theme;
import org.fife.ui.rsyntaxtextarea.TokenMakerFactory;
import org.fife.ui.rtextarea.RTextScrollPane;
import com.formdev.flatlaf.util.UIScale;
@@ -51,6 +52,14 @@ class FlatThemeEditorPane
textArea = new FlatSyntaxTextArea();
textArea.setSyntaxEditingStyle( FLATLAF_STYLE );
// theme
try {
Theme theme = Theme.load( getClass().getResourceAsStream( "light.xml" ) );
theme.apply( textArea );
} catch( IOException ex ) {
ex.printStackTrace();
}
// create scroll pane
scrollPane = new RTextScrollPane( textArea );
scrollPane.setLineNumbersEnabled( true );