Package com.formdev.flatlaf
Class IntelliJTheme
- java.lang.Object
-
- com.formdev.flatlaf.IntelliJTheme
-
public class IntelliJTheme extends java.lang.ObjectThis 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIntelliJTheme.ThemeLaf
-
Field Summary
Fields Modifier and Type Field Description java.lang.Stringauthorprivate static java.util.Map<java.lang.String,java.lang.String>checkboxDuplicateColorsprivate static java.util.Map<java.lang.String,java.lang.String>checkboxKeyMappingbooleandarkprivate java.util.Map<java.lang.String,java.lang.String>jsonColorsprivate java.util.Map<java.lang.String,java.lang.Object>jsonIconsprivate java.util.Map<java.lang.String,java.lang.Object>jsonUIjava.lang.Stringnameprivate java.util.Map<java.lang.String,java.lang.String>namedColorsprivate static java.util.Map<java.lang.String,java.lang.String>uiKeyCopyingCopy UI default keys (value --> key).private static java.util.Set<java.lang.String>uiKeyDoNotOverrideprivate static java.util.Set<java.lang.String>uiKeyExcludesprivate static java.util.Map<java.lang.String,java.lang.String>uiKeyInverseMappingprivate static java.util.Map<java.lang.String,java.lang.String>uiKeyMappingRename UI default keys (key --> value).
-
Constructor Summary
Constructors Constructor Description IntelliJTheme(java.io.InputStream in)Loads a IntelliJ .theme.json file from the given input stream.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private voidapply(java.lang.String key, java.lang.Object value, java.util.Properties properties, java.util.Set<java.lang.String> jsonUIKeys)http://www.jetbrains.org/intellij/sdk/docs/reference_guide/ui_themes/themes_customize.html#custom-ui-control-colorsprivate voidapplyCheckBoxColors(java.util.Properties properties)Because IDEA uses SVGs for check boxes and radio buttons, the colors for these two components are specified in "icons > ColorPalette".private voidapplyIconsColorPalette(java.util.Properties properties)private voidapplyProperties(java.util.Properties properties)private booleanapplyWildcard(java.util.Properties properties, java.lang.String key, java.lang.String value)private booleancanParseColor(java.lang.String value)private voidcopyIfSetInJson(java.util.Properties properties, java.util.Set<java.lang.String> jsonUIKeys, java.lang.String destKey, java.lang.String... srcKeys)static FlatLafcreateLaf(IntelliJTheme theme)Creates a Laf instance for the given IntelliJ theme.static FlatLafcreateLaf(java.io.InputStream in)Loads a IntelliJ .theme.json file from the given input stream and creates a Laf instance for it.private java.lang.StringfixColorIfValid(java.lang.String newColorStr, java.lang.String colorStr)private voidfixStartEnd(java.util.Properties properties, java.util.Set<java.lang.String> jsonUIKeys, java.lang.String startKey, java.lang.String endKey, java.lang.String key)private java.lang.Stringget(java.util.Properties properties, java.util.Map<java.lang.String,java.lang.String> themeSpecificProps, java.lang.String key)static booleaninstall(java.io.InputStream in)Deprecated.usesetup(InputStream)instead; this method will be removed in a future versionprivate voidloadNamedColors(java.util.Properties properties, java.util.Set<java.lang.String> jsonUIKeys)http://www.jetbrains.org/intellij/sdk/docs/reference_guide/ui_themes/themes_customize.html#defining-named-colorsprivate voidput(java.util.Properties properties, java.lang.Object key, java.lang.Object value)private voidputAll(java.util.Properties properties, java.lang.Object value, java.lang.String... keys)private java.util.Map<java.lang.String,java.lang.String>removeThemeSpecificProps(java.util.Properties properties)static booleansetup(java.io.InputStream in)Loads a IntelliJ .theme.json file from the given input stream, creates a Laf instance for it and sets it up.private java.lang.StringtoColor(java.lang.String value)
-
-
-
Field Detail
-
name
public final java.lang.String name
-
dark
public final boolean dark
-
author
public final java.lang.String author
-
jsonColors
private java.util.Map<java.lang.String,java.lang.String> jsonColors
-
jsonUI
private java.util.Map<java.lang.String,java.lang.Object> jsonUI
-
jsonIcons
private java.util.Map<java.lang.String,java.lang.Object> jsonIcons
-
namedColors
private java.util.Map<java.lang.String,java.lang.String> namedColors
-
uiKeyExcludes
private static final java.util.Set<java.lang.String> uiKeyExcludes
-
uiKeyDoNotOverride
private static final java.util.Set<java.lang.String> uiKeyDoNotOverride
-
uiKeyMapping
private static final java.util.Map<java.lang.String,java.lang.String> uiKeyMapping
Rename UI default keys (key --> value).
-
uiKeyCopying
private static final java.util.Map<java.lang.String,java.lang.String> uiKeyCopying
Copy UI default keys (value --> key).
-
uiKeyInverseMapping
private static final java.util.Map<java.lang.String,java.lang.String> uiKeyInverseMapping
-
checkboxKeyMapping
private static final java.util.Map<java.lang.String,java.lang.String> checkboxKeyMapping
-
checkboxDuplicateColors
private static final java.util.Map<java.lang.String,java.lang.String> checkboxDuplicateColors
-
-
Method Detail
-
setup
public static boolean setup(java.io.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(java.io.InputStream in)
Deprecated.usesetup(InputStream)instead; this method will be removed in a future version
-
createLaf
public static FlatLaf createLaf(java.io.InputStream in) throws java.io.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:
java.io.IOException
-
createLaf
public static FlatLaf createLaf(IntelliJTheme theme)
Creates a Laf instance for the given IntelliJ theme.
-
applyProperties
private void applyProperties(java.util.Properties properties)
-
get
private java.lang.String get(java.util.Properties properties, java.util.Map<java.lang.String,java.lang.String> themeSpecificProps, java.lang.String key)
-
put
private void put(java.util.Properties properties, java.lang.Object key, java.lang.Object value)
-
putAll
private void putAll(java.util.Properties properties, java.lang.Object value, java.lang.String... keys)
-
copyIfSetInJson
private void copyIfSetInJson(java.util.Properties properties, java.util.Set<java.lang.String> jsonUIKeys, java.lang.String destKey, java.lang.String... srcKeys)
-
fixStartEnd
private void fixStartEnd(java.util.Properties properties, java.util.Set<java.lang.String> jsonUIKeys, java.lang.String startKey, java.lang.String endKey, java.lang.String key)
-
removeThemeSpecificProps
private java.util.Map<java.lang.String,java.lang.String> removeThemeSpecificProps(java.util.Properties properties)
-
loadNamedColors
private void loadNamedColors(java.util.Properties properties, java.util.Set<java.lang.String> jsonUIKeys)http://www.jetbrains.org/intellij/sdk/docs/reference_guide/ui_themes/themes_customize.html#defining-named-colors
-
apply
private void apply(java.lang.String key, java.lang.Object value, java.util.Properties properties, java.util.Set<java.lang.String> jsonUIKeys)http://www.jetbrains.org/intellij/sdk/docs/reference_guide/ui_themes/themes_customize.html#custom-ui-control-colors
-
applyWildcard
private boolean applyWildcard(java.util.Properties properties, java.lang.String key, java.lang.String value)
-
fixColorIfValid
private java.lang.String fixColorIfValid(java.lang.String newColorStr, java.lang.String colorStr)
-
applyIconsColorPalette
private void applyIconsColorPalette(java.util.Properties properties)
-
toColor
private java.lang.String toColor(java.lang.String value)
-
canParseColor
private boolean canParseColor(java.lang.String value)
-
applyCheckBoxColors
private void applyCheckBoxColors(java.util.Properties properties)
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 properties.
-
-