mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 07:17:13 -06:00
UIDefaultsLoader: further reduced need for value type prefixes in properties files and in CSS styles
This commit is contained in:
@@ -340,6 +340,7 @@ class UIDefaultsLoader
|
||||
|
||||
private static ValueType[] tempResultValueType = new ValueType[1];
|
||||
private static Map<Class<?>, ValueType> javaValueTypes;
|
||||
private static Map<String, ValueType> knownValueTypes;
|
||||
|
||||
static Object parseValue( String key, String value, Class<?> valueType ) {
|
||||
return parseValue( key, value, valueType, null, v -> v, Collections.emptyList() );
|
||||
@@ -446,6 +447,28 @@ class UIDefaultsLoader
|
||||
}
|
||||
}
|
||||
|
||||
if( valueType == ValueType.UNKNOWN ) {
|
||||
if( knownValueTypes == null ) {
|
||||
// create lazy
|
||||
knownValueTypes = new HashMap<>();
|
||||
// SplitPane
|
||||
knownValueTypes.put( "SplitPane.dividerSize", ValueType.INTEGER );
|
||||
knownValueTypes.put( "SplitPaneDivider.gripDotSize", ValueType.INTEGER );
|
||||
knownValueTypes.put( "dividerSize", ValueType.INTEGER );
|
||||
knownValueTypes.put( "gripDotSize", ValueType.INTEGER );
|
||||
// TabbedPane
|
||||
knownValueTypes.put( "TabbedPane.closeCrossPlainSize", ValueType.FLOAT );
|
||||
knownValueTypes.put( "TabbedPane.closeCrossFilledSize", ValueType.FLOAT );
|
||||
knownValueTypes.put( "closeCrossPlainSize", ValueType.FLOAT );
|
||||
knownValueTypes.put( "closeCrossFilledSize", ValueType.FLOAT );
|
||||
// Table
|
||||
knownValueTypes.put( "Table.intercellSpacing", ValueType.DIMENSION );
|
||||
knownValueTypes.put( "intercellSpacing", ValueType.DIMENSION );
|
||||
}
|
||||
|
||||
valueType = knownValueTypes.getOrDefault( key, ValueType.UNKNOWN );
|
||||
}
|
||||
|
||||
// determine value type from key
|
||||
if( valueType == ValueType.UNKNOWN ) {
|
||||
if( key.endsWith( "UI" ) )
|
||||
|
||||
@@ -563,7 +563,7 @@ Spinner.buttonStyle = button
|
||||
|
||||
#---- SplitPane ----
|
||||
|
||||
SplitPane.dividerSize = {integer}5
|
||||
SplitPane.dividerSize = 5
|
||||
SplitPane.continuousLayout = true
|
||||
SplitPane.border = null
|
||||
SplitPane.centerOneTouchButtons = true
|
||||
@@ -578,7 +578,7 @@ SplitPaneDivider.oneTouchPressedArrowColor = @buttonPressedArrowColor
|
||||
SplitPaneDivider.style = grip
|
||||
SplitPaneDivider.gripColor = @icon
|
||||
SplitPaneDivider.gripDotCount = 3
|
||||
SplitPaneDivider.gripDotSize = {integer}3
|
||||
SplitPaneDivider.gripDotSize = 3
|
||||
SplitPaneDivider.gripGap = 2
|
||||
|
||||
|
||||
@@ -624,7 +624,7 @@ TabbedPane.scrollButtonsPlacement = both
|
||||
TabbedPane.closeIcon = com.formdev.flatlaf.icons.FlatTabbedPaneCloseIcon
|
||||
TabbedPane.closeSize = 16,16
|
||||
TabbedPane.closeArc = 4
|
||||
TabbedPane.closeCrossPlainSize = {float}7.5
|
||||
TabbedPane.closeCrossPlainSize = 7.5
|
||||
TabbedPane.closeCrossFilledSize = $TabbedPane.closeCrossPlainSize
|
||||
TabbedPane.closeCrossLineWidth = 1
|
||||
|
||||
@@ -636,7 +636,7 @@ Table.showHorizontalLines = false
|
||||
Table.showVerticalLines = false
|
||||
Table.showTrailingVerticalLine = false
|
||||
Table.consistentHomeEndKeyBehavior = true
|
||||
Table.intercellSpacing = {dimension}0,0
|
||||
Table.intercellSpacing = 0,0
|
||||
Table.scrollPaneBorder = com.formdev.flatlaf.ui.FlatBorder
|
||||
Table.ascendingSortIcon = com.formdev.flatlaf.icons.FlatAscendingSortIcon
|
||||
Table.descendingSortIcon = com.formdev.flatlaf.icons.FlatDescendingSortIcon
|
||||
|
||||
Reference in New Issue
Block a user