Class IntelliJTheme

java.lang.Object
com.formdev.flatlaf.IntelliJTheme

public class IntelliJTheme extends Object
This class supports loading IntelliJ .theme.json files and using them as a Laf. .theme.json files are used by Theme plugins for IntelliJ IDEA and other JetBrains IDEs that are based on IntelliJ platform. Here you can find IntelliJ Theme plugins: https://plugins.jetbrains.com/search?tags=Theme The IntelliJ .theme.json file are documented here: http://www.jetbrains.org/intellij/sdk/docs/reference_guide/ui_themes/themes_customize.html
  • Field Details

    • name

      public final String name
    • dark

      public final boolean dark
    • author

      public final String author
    • isMaterialUILite

      private final boolean isMaterialUILite
    • colors

      private Map<String,String> colors
    • ui

      private Map<String,Object> ui
    • icons

      private Map<String,Object> icons
    • namedColors

      private Map<String,ColorUIResource> namedColors
    • uiKeyExcludes

      private static final Set<String> uiKeyExcludes
    • uiKeyDoNotOverride

      private static final Set<String> uiKeyDoNotOverride
    • uiKeyMapping

      private static final Map<String,String> uiKeyMapping
      Rename UI default keys (key --> value).
    • uiKeyCopying

      private static final Map<String,String> uiKeyCopying
      Copy UI default keys (value --> key).
    • uiKeyInverseMapping

      private static final Map<String,String> uiKeyInverseMapping
    • checkboxKeyMapping

      private static final Map<String,String> checkboxKeyMapping
    • checkboxDuplicateColors

      private static final Map<String,String> checkboxDuplicateColors
  • Constructor Details

    • IntelliJTheme

      public IntelliJTheme(InputStream in) throws IOException
      Loads a IntelliJ .theme.json file from the given input stream. The input stream is automatically closed. Using a buffered input stream is not necessary.
      Throws:
      IOException
  • Method Details

    • setup

      public static boolean setup(InputStream in)
      Loads a IntelliJ .theme.json file from the given input stream, creates a Laf instance for it and sets it up. The input stream is automatically closed. Using a buffered input stream is not necessary.
      Since:
      1.2
    • install

      @Deprecated public static boolean install(InputStream in)
      Deprecated.
      use setup(InputStream) instead; this method will be removed in a future version
    • createLaf

      public static FlatLaf createLaf(InputStream in) throws IOException
      Loads a IntelliJ .theme.json file from the given input stream and creates a Laf instance for it. The input stream is automatically closed. Using a buffered input stream is not necessary.
      Throws:
      IOException
    • createLaf

      public static FlatLaf createLaf(IntelliJTheme theme)
      Creates a Laf instance for the given IntelliJ theme.
    • applyProperties

      private void applyProperties(UIDefaults defaults)
    • get

      private Object get(UIDefaults defaults, Map<Object,Object> themeSpecificDefaults, String key)
    • putAll

      private void putAll(UIDefaults defaults, Object value, String... keys)
    • removeThemeSpecificDefaults

      private Map<Object,Object> removeThemeSpecificDefaults(UIDefaults defaults)
    • loadNamedColors

      private void loadNamedColors(UIDefaults defaults)
      http://www.jetbrains.org/intellij/sdk/docs/reference_guide/ui_themes/themes_customize.html#defining-named-colors
    • apply

      private void apply(String key, Object value, UIDefaults defaults, ArrayList<Object> defaultsKeysCache, Set<String> uiKeys)
      http://www.jetbrains.org/intellij/sdk/docs/reference_guide/ui_themes/themes_customize.html#custom-ui-control-colors
    • fixColorIfValid

      private String fixColorIfValid(String newColorStr, String colorStr)
    • applyColorPalette

      private void applyColorPalette(UIDefaults defaults)
    • toColor

      private ColorUIResource toColor(String value)
    • parseColor

      private ColorUIResource parseColor(String value)
    • applyCheckBoxColors

      private void applyCheckBoxColors(UIDefaults defaults)
      Because IDEA uses SVGs for check boxes and radio buttons, the colors for these two components are specified in "icons > ColorPalette". FlatLaf uses vector icons and expects colors for the two components in UI defaults.
    • copyIfNotSet

      private void copyIfNotSet(UIDefaults defaults, String destKey, String srcKey, Set<String> uiKeys)