Demo/Testing: use IntelliJ Theme Laf classes (from package com.formdev.flatlaf.intellijthemes) in Demo and Testing apps instead of directly loading .theme.json (preparation for #824)

This commit is contained in:
Karl Tauber
2025-02-25 15:50:30 +01:00
parent 68b8769d0d
commit d26eb2674f
9 changed files with 133 additions and 129 deletions

View File

@@ -28,7 +28,6 @@ import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.FlatLightLaf;
import com.formdev.flatlaf.FlatPropertiesLaf;
import com.formdev.flatlaf.IntelliJTheme;
import com.formdev.flatlaf.demo.intellijthemes.IJThemesPanel;
import com.formdev.flatlaf.util.LoggingFacade;
import com.formdev.flatlaf.util.StringUtils;
import com.formdev.flatlaf.util.SystemInfo;
@@ -38,15 +37,10 @@ import com.formdev.flatlaf.util.SystemInfo;
*/
public class DemoPrefs
{
public static final String KEY_LAF = "laf";
public static final String KEY_LAF_THEME = "lafTheme";
public static final String KEY_LAF_CLASS_NAME = "lafClassName";
public static final String KEY_LAF_THEME_FILE = "lafThemeFile";
public static final String KEY_SYSTEM_SCALE_FACTOR = "systemScaleFactor";
public static final String RESOURCE_PREFIX = "res:";
public static final String FILE_PREFIX = "file:";
public static final String THEME_UI_KEY = "__FlatLaf.demo.theme";
private static Preferences state;
public static Preferences getState() {
@@ -63,29 +57,21 @@ public class DemoPrefs
if( args.length > 0 )
UIManager.setLookAndFeel( args[0] );
else {
String lafClassName = state.get( KEY_LAF, FlatLightLaf.class.getName() );
if( IntelliJTheme.ThemeLaf.class.getName().equals( lafClassName ) ) {
String theme = state.get( KEY_LAF_THEME, "" );
if( theme.startsWith( RESOURCE_PREFIX ) )
IntelliJTheme.setup( IJThemesPanel.class.getResourceAsStream( IJThemesPanel.THEMES_PACKAGE + theme.substring( RESOURCE_PREFIX.length() ) ) );
else if( theme.startsWith( FILE_PREFIX ) )
FlatLaf.setup( IntelliJTheme.createLaf( new FileInputStream( theme.substring( FILE_PREFIX.length() ) ) ) );
else
FlatLightLaf.setup();
String lafClassName = state.get( KEY_LAF_CLASS_NAME, FlatLightLaf.class.getName() );
if( FlatPropertiesLaf.class.getName().equals( lafClassName ) ||
IntelliJTheme.ThemeLaf.class.getName().equals( lafClassName ) )
{
String themeFileName = state.get( KEY_LAF_THEME_FILE, "" );
if( !themeFileName.isEmpty() ) {
File themeFile = new File( themeFileName );
if( !theme.isEmpty() )
UIManager.getLookAndFeelDefaults().put( THEME_UI_KEY, theme );
} else if( FlatPropertiesLaf.class.getName().equals( lafClassName ) ) {
String theme = state.get( KEY_LAF_THEME, "" );
if( theme.startsWith( FILE_PREFIX ) ) {
File themeFile = new File( theme.substring( FILE_PREFIX.length() ) );
String themeName = StringUtils.removeTrailing( themeFile.getName(), ".properties" );
FlatLaf.setup( new FlatPropertiesLaf( themeName, themeFile ) );
if( themeFileName.endsWith( ".properties" ) ) {
String themeName = StringUtils.removeTrailing( themeFile.getName(), ".properties" );
FlatLaf.setup( new FlatPropertiesLaf( themeName, themeFile ) );
} else
FlatLaf.setup( IntelliJTheme.createLaf( new FileInputStream( themeFile ) ) );
} else
FlatLightLaf.setup();
if( !theme.isEmpty() )
UIManager.getLookAndFeelDefaults().put( THEME_UI_KEY, theme );
} else
UIManager.setLookAndFeel( lafClassName );
}
@@ -99,7 +85,7 @@ public class DemoPrefs
// remember active look and feel
UIManager.addPropertyChangeListener( e -> {
if( "lookAndFeel".equals( e.getPropertyName() ) )
state.put( KEY_LAF, UIManager.getLookAndFeel().getClass().getName() );
state.put( KEY_LAF_CLASS_NAME, UIManager.getLookAndFeel().getClass().getName() );
} );
}

View File

@@ -58,6 +58,7 @@ class IJThemesManager
String name = value.get( "name" );
boolean discontinued = Boolean.parseBoolean( value.get( "discontinued" ) );
boolean dark = Boolean.parseBoolean( value.get( "dark" ) );
String lafClassName = value.get( "lafClassName" );
String license = value.get( "license" );
String licenseFile = value.get( "licenseFile" );
String pluginUrl = value.get( "pluginUrl" );
@@ -65,7 +66,7 @@ class IJThemesManager
String sourceCodePath = value.get( "sourceCodePath" );
bundledThemes.add( new IJThemeInfo( name, resourceName, discontinued, dark,
license, licenseFile, pluginUrl, sourceCodeUrl, sourceCodePath, null, null ) );
license, licenseFile, pluginUrl, sourceCodeUrl, sourceCodePath, null, lafClassName ) );
}
}

View File

@@ -33,8 +33,6 @@ import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
@@ -59,7 +57,6 @@ import com.formdev.flatlaf.extras.FlatSVGIcon;
import com.formdev.flatlaf.themes.*;
import com.formdev.flatlaf.ui.FlatListUI;
import com.formdev.flatlaf.util.LoggingFacade;
import com.formdev.flatlaf.util.StringUtils;
import net.miginfocom.swing.*;
/**
@@ -82,14 +79,13 @@ public class IJThemesPanel
};
private Window window;
private File lastDirectory;
private boolean isAdjustingThemesList;
private long lastLafChangeTime = System.currentTimeMillis();
public IJThemesPanel() {
initComponents();
saveButton.setEnabled( false );
pluginButton.setEnabled( false );
sourceCodeButton.setEnabled( false );
// create renderer
@@ -144,7 +140,7 @@ public class IJThemesPanel
private String buildToolTip( IJThemeInfo ti ) {
if( ti.themeFile != null )
return ti.themeFile.getPath();
if( ti.resourceName == null )
if( ti.license == null )
return ti.name;
return "Name: " + ti.name
@@ -238,7 +234,6 @@ public class IJThemesPanel
for( int i = 0; i < themes.size(); i++ ) {
IJThemeInfo theme = themes.get( i );
if( oldSel.name.equals( theme.name ) &&
Objects.equals( oldSel.resourceName, theme.resourceName ) &&
Objects.equals( oldSel.themeFile, theme.themeFile ) &&
Objects.equals( oldSel.lafClassName, theme.lafClassName ) )
{
@@ -274,9 +269,8 @@ public class IJThemesPanel
private void themesListValueChanged( ListSelectionEvent e ) {
IJThemeInfo themeInfo = themesList.getSelectedValue();
boolean bundledTheme = (themeInfo != null && themeInfo.resourceName != null);
saveButton.setEnabled( bundledTheme );
sourceCodeButton.setEnabled( bundledTheme );
pluginButton.setEnabled( themeInfo != null && themeInfo.pluginUrl != null );
sourceCodeButton.setEnabled( themeInfo != null && themeInfo.sourceCodePath != null );
if( e.getValueIsAdjusting() || isAdjustingThemesList )
return;
@@ -307,21 +301,21 @@ public class IJThemesPanel
FlatAnimatedLafChange.showSnapshot();
try {
if( themeInfo.themeFile.getName().endsWith( ".properties" ) ) {
if( themeInfo.themeFile.getName().endsWith( ".properties" ) )
FlatLaf.setup( new FlatPropertiesLaf( themeInfo.name, themeInfo.themeFile ) );
} else
else
FlatLaf.setup( IntelliJTheme.createLaf( new FileInputStream( themeInfo.themeFile ) ) );
DemoPrefs.getState().put( DemoPrefs.KEY_LAF_THEME, DemoPrefs.FILE_PREFIX + themeInfo.themeFile );
DemoPrefs.getState().put( DemoPrefs.KEY_LAF_THEME_FILE, themeInfo.themeFile.getAbsolutePath() );
} catch( Exception ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
showInformationDialog( "Failed to load '" + themeInfo.themeFile + "'.", ex );
}
} else {
FlatAnimatedLafChange.showSnapshot();
IntelliJTheme.setup( getClass().getResourceAsStream( THEMES_PACKAGE + themeInfo.resourceName ) );
DemoPrefs.getState().put( DemoPrefs.KEY_LAF_THEME, DemoPrefs.RESOURCE_PREFIX + themeInfo.resourceName );
JOptionPane.showMessageDialog( SwingUtilities.windowForComponent( this ),
"Missing lafClassName for '" + themeInfo.name + "'",
"FlatLaf", JOptionPane.INFORMATION_MESSAGE );
return;
}
// update all components
@@ -329,56 +323,31 @@ public class IJThemesPanel
FlatAnimatedLafChange.hideSnapshotWithAnimation();
}
private void saveTheme() {
private void browsePlugin() {
IJThemeInfo themeInfo = themesList.getSelectedValue();
if( themeInfo == null || themeInfo.resourceName == null )
if( themeInfo == null || themeInfo.pluginUrl == null )
return;
JFileChooser fileChooser = new JFileChooser();
fileChooser.setSelectedFile( new File( lastDirectory, themeInfo.resourceName ) );
if( fileChooser.showSaveDialog( SwingUtilities.windowForComponent( this ) ) != JFileChooser.APPROVE_OPTION )
return;
File file = fileChooser.getSelectedFile();
lastDirectory = file.getParentFile();
// save theme
try {
Files.copy( getClass().getResourceAsStream( THEMES_PACKAGE + themeInfo.resourceName ),
file.toPath(), StandardCopyOption.REPLACE_EXISTING );
} catch( IOException ex ) {
showInformationDialog( "Failed to save theme to '" + file + "'.", ex );
return;
}
// save license
if( themeInfo.licenseFile != null ) {
try {
File licenseFile = new File( file.getParentFile(),
StringUtils.removeTrailing( file.getName(), ".theme.json" ) +
themeInfo.licenseFile.substring( themeInfo.licenseFile.indexOf( '.' ) ) );
Files.copy( getClass().getResourceAsStream( THEMES_PACKAGE + themeInfo.licenseFile ),
licenseFile.toPath(), StandardCopyOption.REPLACE_EXISTING );
} catch( IOException ex ) {
showInformationDialog( "Failed to save theme license to '" + file + "'.", ex );
return;
}
}
browse( themeInfo.pluginUrl );
}
private void browseSourceCode() {
IJThemeInfo themeInfo = themesList.getSelectedValue();
if( themeInfo == null || themeInfo.resourceName == null )
if( themeInfo == null || themeInfo.sourceCodeUrl == null )
return;
String themeUrl = themeInfo.sourceCodeUrl;
if( themeInfo.sourceCodePath != null )
themeUrl += '/' + themeInfo.sourceCodePath;
themeUrl = themeUrl.replace( " ", "%20" );
browse( themeUrl );
}
private void browse( String url ) {
url = url.replace( " ", "%20" );
try {
Desktop.getDesktop().browse( new URI( themeUrl ) );
Desktop.getDesktop().browse( new URI( url ) );
} catch( IOException | URISyntaxException ex ) {
showInformationDialog( "Failed to browse '" + themeUrl + "'.", ex );
showInformationDialog( "Failed to browse '" + url + "'.", ex );
}
}
@@ -414,7 +383,10 @@ public class IJThemesPanel
private void lafChanged( PropertyChangeEvent e ) {
if( "lookAndFeel".equals( e.getPropertyName() ) ) {
selectedCurrentLookAndFeel();
// use invokeLater() because KEY_LAF_THEME_FILE is updated after this event
EventQueue.invokeLater( () -> {
selectedCurrentLookAndFeel();
} );
lastLafChangeTime = System.currentTimeMillis();
}
}
@@ -430,19 +402,19 @@ public class IJThemesPanel
if( laf instanceof FlatLaf ) {
List<Class<?>> lafClasses = new ArrayList<>();
// same as in UIDefaultsLoader.getLafClassesForDefaultsLoading()
for( Class<?> lafClass = laf.getClass();
FlatLaf.class.isAssignableFrom( lafClass );
lafClass = lafClass.getSuperclass() )
{
lafClasses.add( 0, lafClass );
}
// same as in IntelliJTheme.ThemeLaf.getLafClassesForDefaultsLoading()
if( laf instanceof IntelliJTheme.ThemeLaf ) {
boolean dark = ((FlatLaf)laf).isDark();
lafClasses.add( FlatLaf.class );
lafClasses.add( dark ? FlatDarkLaf.class : FlatLightLaf.class );
lafClasses.add( dark ? FlatDarculaLaf.class : FlatIntelliJLaf.class );
lafClasses.add( IntelliJTheme.ThemeLaf.class );
} else {
for( Class<?> lafClass = laf.getClass();
FlatLaf.class.isAssignableFrom( lafClass );
lafClass = lafClass.getSuperclass() )
{
lafClasses.add( 0, lafClass );
}
lafClasses.add( 1, dark ? FlatDarkLaf.class : FlatLightLaf.class );
lafClasses.add( 2, dark ? FlatDarculaLaf.class : FlatIntelliJLaf.class );
}
boolean reload = false;
@@ -469,23 +441,19 @@ public class IJThemesPanel
}
private void selectedCurrentLookAndFeel() {
LookAndFeel lookAndFeel = UIManager.getLookAndFeel();
String theme = UIManager.getLookAndFeelDefaults().getString( DemoPrefs.THEME_UI_KEY );
if( theme == null && (lookAndFeel instanceof IntelliJTheme.ThemeLaf || lookAndFeel instanceof FlatPropertiesLaf) )
return;
Predicate<IJThemeInfo> test;
if( theme != null && theme.startsWith( DemoPrefs.RESOURCE_PREFIX ) ) {
String resourceName = theme.substring( DemoPrefs.RESOURCE_PREFIX.length() );
test = ti -> Objects.equals( ti.resourceName, resourceName );
} else if( theme != null && theme.startsWith( DemoPrefs.FILE_PREFIX ) ) {
File themeFile = new File( theme.substring( DemoPrefs.FILE_PREFIX.length() ) );
String lafClassName = UIManager.getLookAndFeel().getClass().getName();
if( FlatPropertiesLaf.class.getName().equals( lafClassName ) ||
IntelliJTheme.ThemeLaf.class.getName().equals( lafClassName ) )
{
String themeFileName = DemoPrefs.getState().get( DemoPrefs.KEY_LAF_THEME_FILE, "" );
if( themeFileName == null )
return;
File themeFile = new File( themeFileName );
test = ti -> Objects.equals( ti.themeFile, themeFile );
} else {
String lafClassName = lookAndFeel.getClass().getName();
} else
test = ti -> Objects.equals( ti.lafClassName, lafClassName );
}
int newSel = -1;
for( int i = 0; i < themes.size(); i++ ) {
@@ -512,7 +480,7 @@ public class IJThemesPanel
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
JLabel themesLabel = new JLabel();
toolBar = new JToolBar();
saveButton = new JButton();
pluginButton = new JButton();
sourceCodeButton = new JButton();
filterComboBox = new JComboBox<>();
themesScrollPane = new JScrollPane();
@@ -535,11 +503,11 @@ public class IJThemesPanel
{
toolBar.setFloatable(false);
//---- saveButton ----
saveButton.setToolTipText("Save .theme.json of selected IntelliJ theme to file.");
saveButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/demo/icons/download.svg"));
saveButton.addActionListener(e -> saveTheme());
toolBar.add(saveButton);
//---- pluginButton ----
pluginButton.setToolTipText("Opens the IntelliJ plugin page of selected IntelliJ theme in the browser.");
pluginButton.setIcon(new FlatSVGIcon("com/formdev/flatlaf/demo/icons/plugin.svg"));
pluginButton.addActionListener(e -> browsePlugin());
toolBar.add(pluginButton);
//---- sourceCodeButton ----
sourceCodeButton.setToolTipText("Opens the source code repository of selected IntelliJ theme in the browser.");
@@ -574,7 +542,7 @@ public class IJThemesPanel
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
private JToolBar toolBar;
private JButton saveButton;
private JButton pluginButton;
private JButton sourceCodeButton;
private JComboBox<String> filterComboBox;
private JScrollPane themesScrollPane;

View File

@@ -1,4 +1,4 @@
JFDML JFormDesigner: "8.1.0.0.283" Java: "19.0.2" encoding: "UTF-8"
JFDML JFormDesigner: "8.3" encoding: "UTF-8"
new FormModel {
contentType: "form/swing"
@@ -22,10 +22,10 @@ new FormModel {
name: "toolBar"
"floatable": false
add( new FormComponent( "javax.swing.JButton" ) {
name: "saveButton"
"toolTipText": "Save .theme.json of selected IntelliJ theme to file."
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/demo/icons/download.svg" )
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "saveTheme", false ) )
name: "pluginButton"
"toolTipText": "Opens the IntelliJ plugin page of selected IntelliJ theme in the browser."
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/demo/icons/plugin.svg" )
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "browsePlugin", false ) )
} )
add( new FormComponent( "javax.swing.JButton" ) {
name: "sourceCodeButton"

View File

@@ -1,7 +0,0 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd">
<polygon fill="#6E6E6E" points="9 7 12 7 8 11 4 7 7 7 7 2 9 2" transform="matrix(-1 0 0 1 16 0)"/>
<rect width="12" height="2" x="2" y="12" fill="#6E6E6E"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 448 B

View File

@@ -0,0 +1,4 @@
<!-- Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M11 4H7C5.34315 4 4 5.34315 4 7V9C4 10.6569 5.34315 12 7 12H11V11V10V6V5V4ZM12 5V4C12 3.44772 11.5523 3 11 3H7C5.13616 3 3.57006 4.27477 3.12602 6H1C0.447715 6 0 6.44772 0 7V9C0 9.55228 0.447715 10 1 10H3.12602C3.57006 11.7252 5.13616 13 7 13H11C11.5523 13 12 12.5523 12 12V11H15.5C15.7761 11 16 10.7761 16 10.5C16 10.2239 15.7761 10 15.5 10H12V6H15.5C15.7761 6 16 5.77614 16 5.5C16 5.22386 15.7761 5 15.5 5H12ZM3 7V9H1V7L3 7Z" fill="#6C707E"/>
</svg>

After

Width:  |  Height:  |  Size: 724 B

View File

@@ -0,0 +1,4 @@
<!-- Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M11 4H7C5.34315 4 4 5.34315 4 7V9C4 10.6569 5.34315 12 7 12H11V11V10V6V5V4ZM12 5V4C12 3.44772 11.5523 3 11 3H7C5.13616 3 3.57006 4.27477 3.12602 6H1C0.447715 6 0 6.44772 0 7V9C0 9.55228 0.447715 10 1 10H3.12602C3.57006 11.7252 5.13616 13 7 13H11C11.5523 13 12 12.5523 12 12V11H15.5C15.7761 11 16 10.7761 16 10.5C16 10.2239 15.7761 10 15.5 10H12V6H15.5C15.7761 6 16 5.77614 16 5.5C16 5.22386 15.7761 5 15.5 5H12ZM3 7V9H1V7L3 7Z" fill="#CED0D6"/>
</svg>

After

Width:  |  Height:  |  Size: 724 B

View File

@@ -1,6 +1,7 @@
{
"arc-theme.theme.json": {
"name": "Arc",
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatArcIJTheme",
"license": "MIT",
"licenseFile": "arc-themes.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12451-arc-theme",
@@ -9,6 +10,7 @@
},
"arc-theme-orange.theme.json": {
"name": "Arc - Orange",
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatArcOrangeIJTheme",
"license": "MIT",
"licenseFile": "arc-themes.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12451-arc-theme",
@@ -18,6 +20,7 @@
"arc_theme_dark.theme.json": {
"name": "Arc Dark",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatArcDarkIJTheme",
"license": "MIT",
"licenseFile": "arc-themes.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/15175-arc-theme-dark",
@@ -27,6 +30,7 @@
"arc_theme_dark_orange.theme.json": {
"name": "Arc Dark - Orange",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatArcDarkOrangeIJTheme",
"license": "MIT",
"licenseFile": "arc-themes.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/15175-arc-theme-dark",
@@ -36,6 +40,7 @@
"Carbon.theme.json": {
"name": "Carbon",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatCarbonIJTheme",
"license": "Apache License 2.0",
"licenseFile": "arc-themes.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12280-carbon",
@@ -45,6 +50,7 @@
"Cobalt_2.theme.json": {
"name": "Cobalt 2",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatCobalt2IJTheme",
"license": "MIT",
"licenseFile": "Cobalt_2.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/10745-cobalt-2",
@@ -54,6 +60,7 @@
"Cyan.theme.json": {
"name": "Cyan light",
"license": "MIT",
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatCyanLightIJTheme",
"licenseFile": "Cyan.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12102-cyan-light-theme",
"sourceCodeUrl": "https://github.com/OlyaB/CyanTheme",
@@ -62,6 +69,7 @@
"DarkFlatTheme.theme.json": {
"name": "Dark Flat",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatDarkFlatIJTheme",
"license": "MIT",
"licenseFile": "DarkFlatTheme.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12165-dark-flat-theme",
@@ -71,6 +79,7 @@
"DarkPurple.theme.json": {
"name": "Dark purple",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatDarkPurpleIJTheme",
"license": "MIT",
"licenseFile": "DarkPurple.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12100-dark-purple-theme",
@@ -80,6 +89,7 @@
"Dracula.theme.json": {
"name": "Dracula",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatDraculaIJTheme",
"license": "MIT",
"licenseFile": "Dracula.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12275-dracula-theme",
@@ -89,6 +99,7 @@
"Gradianto_dark_fuchsia.theme.json": {
"name": "Gradianto Dark Fuchsia",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatGradiantoDarkFuchsiaIJTheme",
"license": "MIT",
"licenseFile": "Gradianto.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12334-gradianto",
@@ -98,6 +109,7 @@
"Gradianto_deep_ocean.theme.json": {
"name": "Gradianto Deep Ocean",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatGradiantoDeepOceanIJTheme",
"license": "MIT",
"licenseFile": "Gradianto.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12334-gradianto",
@@ -107,6 +119,7 @@
"Gradianto_midnight_blue.theme.json": {
"name": "Gradianto Midnight Blue",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatGradiantoMidnightBlueIJTheme",
"license": "MIT",
"licenseFile": "Gradianto.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12334-gradianto",
@@ -116,6 +129,7 @@
"Gradianto_Nature_Green.theme.json": {
"name": "Gradianto Nature Green",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatGradiantoNatureGreenIJTheme",
"license": "MIT",
"licenseFile": "Gradianto.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12334-gradianto",
@@ -125,6 +139,7 @@
"Gray.theme.json": {
"name": "Gray",
"license": "MIT",
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatGrayIJTheme",
"licenseFile": "Gray.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12103-gray-theme",
"sourceCodeUrl": "https://github.com/OlyaB/GreyTheme",
@@ -133,6 +148,7 @@
"gruvbox_dark_hard.theme.json": {
"name": "Gruvbox Dark Hard",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatGruvboxDarkHardIJTheme",
"license": "MIT",
"licenseFile": "gruvbox_theme.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12310-gruvbox-theme",
@@ -142,6 +158,7 @@
"gruvbox_dark_medium.theme.json": {
"name": "Gruvbox Dark Medium",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatGruvboxDarkMediumIJTheme",
"license": "MIT",
"licenseFile": "gruvbox_theme.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12310-gruvbox-theme",
@@ -151,6 +168,7 @@
"gruvbox_dark_soft.theme.json": {
"name": "Gruvbox Dark Soft",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatGruvboxDarkSoftIJTheme",
"license": "MIT",
"licenseFile": "gruvbox_theme.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12310-gruvbox-theme",
@@ -160,6 +178,7 @@
"HiberbeeDark.theme.json": {
"name": "Hiberbee Dark",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatHiberbeeDarkIJTheme",
"license": "MIT",
"licenseFile": "Hiberbee.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12118-hiberbee-theme",
@@ -169,6 +188,7 @@
"HighContrast.theme.json": {
"name": "High Contrast",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatHighContrastIJTheme",
"license": "Apache License 2.0",
"licenseFile": "HighContrast.LICENSE.txt",
"sourceCodeUrl": "https://github.com/JetBrains/intellij-community",
@@ -177,6 +197,7 @@
"LightFlatTheme.theme.json": {
"name": "Light Flat",
"license": "MIT",
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatLightFlatIJTheme",
"licenseFile": "LightFlatTheme.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12169-light-flat-theme",
"sourceCodeUrl": "https://github.com/nerzhulart/LightFlatTheme",
@@ -185,6 +206,7 @@
"MaterialTheme.theme.json": {
"name": "Material Design Dark",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatMaterialDesignDarkIJTheme",
"license": "MIT",
"licenseFile": "MaterialTheme.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12134-material-design-dark-theme",
@@ -194,6 +216,7 @@
"Monocai.theme.json": {
"name": "Monocai",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatMonocaiIJTheme",
"license": "MIT",
"licenseFile": "Monocai.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12163-monocai-color-theme",
@@ -204,6 +227,7 @@
"name": "Monokai Pro",
"discontinued": true,
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatMonokaiProIJTheme",
"license": "MIT",
"licenseFile": "Monokai_Pro.LICENSE.txt",
"sourceCodeUrl": "https://github.com/subtheme-dev/monokai-pro"
@@ -211,6 +235,7 @@
"nord.theme.json": {
"name": "Nord",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatNordIJTheme",
"license": "MIT",
"licenseFile": "nord.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/10321-nord",
@@ -220,6 +245,7 @@
"one_dark.theme.json": {
"name": "One Dark",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatOneDarkIJTheme",
"license": "MIT",
"licenseFile": "one_dark.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/11938-one-dark-theme",
@@ -230,6 +256,7 @@
"name": "Solarized Dark",
"discontinued": true,
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatSolarizedDarkIJTheme",
"license": "The Unlicense",
"licenseFile": "Solarized.LICENSE.txt",
"sourceCodeUrl": "https://github.com/4lex4/intellij-platform-solarized",
@@ -238,6 +265,7 @@
"SolarizedLight.theme.json": {
"name": "Solarized Light",
"discontinued": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatSolarizedLightIJTheme",
"license": "The Unlicense",
"licenseFile": "Solarized.LICENSE.txt",
"sourceCodeUrl": "https://github.com/4lex4/intellij-platform-solarized",
@@ -246,6 +274,7 @@
"Spacegray.theme.json": {
"name": "Spacegray",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatSpacegrayIJTheme",
"license": "MIT",
"licenseFile": "Spacegray.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12122-spacegray-theme",
@@ -255,6 +284,7 @@
"vuesion_theme.theme.json": {
"name": "Vuesion",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatVuesionIJTheme",
"license": "MIT",
"licenseFile": "vuesion_theme.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/12226-vuesion-theme",
@@ -264,6 +294,7 @@
"Xcode-Dark.theme.json": {
"name": "Xcode-Dark",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.FlatXcodeDarkIJTheme",
"license": "MIT",
"licenseFile": "Xcode-Dark.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/13106-xcode-dark-theme",
@@ -274,6 +305,7 @@
"material-theme-ui-lite/Arc Dark.theme.json": {
"name": "Material Theme UI Lite / Arc Dark",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatArcDarkIJTheme",
"license": "MIT",
"licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/8006-material-theme-ui",
@@ -283,6 +315,7 @@
"material-theme-ui-lite/Atom One Dark.theme.json": {
"name": "Material Theme UI Lite / Atom One Dark",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatAtomOneDarkIJTheme",
"license": "MIT",
"licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/8006-material-theme-ui",
@@ -291,6 +324,7 @@
},
"material-theme-ui-lite/Atom One Light.theme.json": {
"name": "Material Theme UI Lite / Atom One Light",
"lafClassName": "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatAtomOneLightIJTheme",
"license": "MIT",
"licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/8006-material-theme-ui",
@@ -300,6 +334,7 @@
"material-theme-ui-lite/Dracula.theme.json": {
"name": "Material Theme UI Lite / Dracula",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatDraculaIJTheme",
"license": "MIT",
"licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/8006-material-theme-ui",
@@ -308,6 +343,7 @@
},
"material-theme-ui-lite/GitHub.theme.json": {
"name": "Material Theme UI Lite / GitHub",
"lafClassName": "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatGitHubIJTheme",
"license": "MIT",
"licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/8006-material-theme-ui",
@@ -317,6 +353,7 @@
"material-theme-ui-lite/GitHub Dark.theme.json": {
"name": "Material Theme UI Lite / GitHub Dark",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatGitHubDarkIJTheme",
"license": "MIT",
"licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/8006-material-theme-ui",
@@ -325,6 +362,7 @@
},
"material-theme-ui-lite/Light Owl.theme.json": {
"name": "Material Theme UI Lite / Light Owl",
"lafClassName": "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatLightOwlIJTheme",
"license": "MIT",
"licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/8006-material-theme-ui",
@@ -334,6 +372,7 @@
"material-theme-ui-lite/Material Darker.theme.json": {
"name": "Material Theme UI Lite / Material Darker",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialDarkerIJTheme",
"license": "MIT",
"licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/8006-material-theme-ui",
@@ -343,6 +382,7 @@
"material-theme-ui-lite/Material Deep Ocean.theme.json": {
"name": "Material Theme UI Lite / Material Deep Ocean",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialDeepOceanIJTheme",
"license": "MIT",
"licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/8006-material-theme-ui",
@@ -351,6 +391,7 @@
},
"material-theme-ui-lite/Material Lighter.theme.json": {
"name": "Material Theme UI Lite / Material Lighter",
"lafClassName": "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialLighterIJTheme",
"license": "MIT",
"licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/8006-material-theme-ui",
@@ -360,6 +401,7 @@
"material-theme-ui-lite/Material Oceanic.theme.json": {
"name": "Material Theme UI Lite / Material Oceanic",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialOceanicIJTheme",
"license": "MIT",
"licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/8006-material-theme-ui",
@@ -369,6 +411,7 @@
"material-theme-ui-lite/Material Palenight.theme.json": {
"name": "Material Theme UI Lite / Material Palenight",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialPalenightIJTheme",
"license": "MIT",
"licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/8006-material-theme-ui",
@@ -378,6 +421,7 @@
"material-theme-ui-lite/Monokai Pro.theme.json": {
"name": "Material Theme UI Lite / Monokai Pro",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMonokaiProIJTheme",
"license": "MIT",
"licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/8006-material-theme-ui",
@@ -387,6 +431,7 @@
"material-theme-ui-lite/Moonlight.theme.json": {
"name": "Material Theme UI Lite / Moonlight",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMoonlightIJTheme",
"license": "MIT",
"licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/8006-material-theme-ui",
@@ -396,6 +441,7 @@
"material-theme-ui-lite/Night Owl.theme.json": {
"name": "Material Theme UI Lite / Night Owl",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatNightOwlIJTheme",
"license": "MIT",
"licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/8006-material-theme-ui",
@@ -405,6 +451,7 @@
"material-theme-ui-lite/Solarized Dark.theme.json": {
"name": "Material Theme UI Lite / Solarized Dark",
"dark": true,
"lafClassName": "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatSolarizedDarkIJTheme",
"license": "MIT",
"licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/8006-material-theme-ui",
@@ -413,6 +460,7 @@
},
"material-theme-ui-lite/Solarized Light.theme.json": {
"name": "Material Theme UI Lite / Solarized Light",
"lafClassName": "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatSolarizedLightIJTheme",
"license": "MIT",
"licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt",
"pluginUrl": "https://plugins.jetbrains.com/plugin/8006-material-theme-ui",

View File

@@ -576,7 +576,7 @@ public class FlatTestFrame
UIManager.put( "defaultFont", null );
LookAndFeel lookAndFeel = UIManager.getLookAndFeel();
IntelliJTheme theme = (lookAndFeel instanceof IntelliJTheme.ThemeLaf)
IntelliJTheme theme = (lookAndFeel.getClass() == IntelliJTheme.ThemeLaf.class)
? ((IntelliJTheme.ThemeLaf)lookAndFeel).getTheme()
: null;
String nameForProperties = null;