Styling: support styling for recently merged changes

This commit is contained in:
Karl Tauber
2021-09-14 22:43:44 +02:00
parent c5c0a3768a
commit ccd0597b35
5 changed files with 12 additions and 1 deletions

View File

@@ -139,6 +139,12 @@ public class FlatTableHeaderBorder
}
protected boolean hideTrailingVerticalLine( JTableHeader header ) {
if( header.getUI() instanceof FlatTableHeaderUI ) {
FlatTableHeaderUI ui = (FlatTableHeaderUI) header.getUI();
if( ui.showTrailingVerticalLine )
return false;
}
if( showTrailingVerticalLine )
return false;

View File

@@ -86,6 +86,7 @@ public class FlatTableHeaderUI
// for FlatTableHeaderBorder
@Styleable protected Insets cellMargins;
@Styleable protected Color separatorColor;
/** @since 2 */ @Styleable protected boolean showTrailingVerticalLine;
// for FlatAscendingSortIcon and FlatDescendingSortIcon
// (needs to be public because icon classes are in another package)

View File

@@ -98,7 +98,7 @@ public class FlatTableUI
{
protected boolean showHorizontalLines;
protected boolean showVerticalLines;
/** @since 1.6 */ protected boolean showTrailingVerticalLine;
/** @since 1.6 */ @Styleable protected boolean showTrailingVerticalLine;
protected Dimension intercellSpacing;
@Styleable protected Color selectionBackground;

View File

@@ -708,6 +708,7 @@ public class TestFlatStyleableInfo
FlatTableUI ui = (FlatTableUI) c.getUI();
Map<String, Class<?>> expected = expectedMap(
"showTrailingVerticalLine", boolean.class,
"selectionBackground", Color.class,
"selectionForeground", Color.class,
"selectionInactiveBackground", Color.class,
@@ -735,6 +736,7 @@ public class TestFlatStyleableInfo
// FlatTableHeaderBorder
"cellMargins", Insets.class,
"separatorColor", Color.class,
"showTrailingVerticalLine", boolean.class,
// FlatAscendingSortIcon and FlatDescendingSortIcon
"arrowType", String.class,

View File

@@ -806,6 +806,7 @@ public class TestFlatStyling
JTable c = new JTable();
FlatTableUI ui = (FlatTableUI) c.getUI();
ui.applyStyle( "showTrailingVerticalLine: true" );
ui.applyStyle( "selectionBackground: #fff" );
ui.applyStyle( "selectionForeground: #fff" );
ui.applyStyle( "selectionInactiveBackground: #fff" );
@@ -841,6 +842,7 @@ public class TestFlatStyling
// FlatTableHeaderBorder
ui.applyStyle( "cellMargins: 1,2,3,4" );
ui.applyStyle( "separatorColor: #fff" );
ui.applyStyle( "showTrailingVerticalLine: true" );
// FlatAscendingSortIcon and FlatDescendingSortIcon
ui.applyStyle( "arrowType: chevron" );