diff --git a/designer-base/src/main/java/com/fine/theme/light/ui/FineTableHeaderUI.java b/designer-base/src/main/java/com/fine/theme/light/ui/FineTableHeaderUI.java index 89a5e738ab..da6a4c9c5e 100644 --- a/designer-base/src/main/java/com/fine/theme/light/ui/FineTableHeaderUI.java +++ b/designer-base/src/main/java/com/fine/theme/light/ui/FineTableHeaderUI.java @@ -84,6 +84,16 @@ public class FineTableHeaderUI extends FlatTableHeaderUI { setHorizontalAlignment(SwingConstants.LEFT); } + /** + * 是否选中修改背景 + * @param isSelected 被选中 + * @param columnClass 列类型 + * @return 是否修改 + */ + public boolean checkSelected(boolean isSelected, Class columnClass) { + return isSelected && columnClass != Boolean.class; + } + @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Class columnClass = table.getColumnClass(0); @@ -95,7 +105,7 @@ public class FineTableHeaderUI extends FlatTableHeaderUI { border = BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")), UIManager.getBorder("Table.cellNoFocusBorder")); } - if (isSelected && columnClass != Boolean.class) { + if (checkSelected(isSelected, columnClass)) { selectionBackground = UIManager.getColor( "Table.selectionBackground"); } else { selectionBackground = UIManager.getColor("Table.background"); diff --git a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java index ed477aab2c..17849321fd 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java @@ -1220,6 +1220,11 @@ public class DBManipulationPane extends BasicBeanPane { return this; } + + @Override + public boolean checkSelected(boolean isSelected, Class columnClass) { + return isSelected; + } } /* @@ -1245,6 +1250,11 @@ public class DBManipulationPane extends BasicBeanPane { return this; } + + @Override + public boolean checkSelected(boolean isSelected, Class columnClass) { + return isSelected; + } } /** @@ -1263,7 +1273,11 @@ public class DBManipulationPane extends BasicBeanPane { setSelected((value != null && ((Boolean) value).booleanValue())); setUI(getUICheckBoxUI()); setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor"))); - setBackground(Color.WHITE); + if (isSelected) { + setBackground(UIManager.getColor( "Table.selectionBackground")); + } else { + setBackground(UIManager.getColor("Table.background")); + } return this; } } diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index 819b817796..7c2ded7244 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java @@ -580,6 +580,11 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { return this; } + + @Override + public boolean checkSelected(boolean isSelected, Class columnClass) { + return isSelected; + } } private class ColumnRowGroupCellRenderer2 extends FineTableHeaderUI.TableRenderer { @@ -613,6 +618,11 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { return this; } + + @Override + public boolean checkSelected(boolean isSelected, Class columnClass) { + return isSelected; + } } } }