From a23fdf10dbcadd410e4ef6c8f071171490d4f3b4 Mon Sep 17 00:00:00 2001 From: obo Date: Tue, 14 May 2024 20:06:15 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-119405=20fix:=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=84=B1=E6=95=8F=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view/rule/DesensitizationRuleChoosePane.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java index d37ed152d2..0cd81e32fa 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java @@ -16,8 +16,11 @@ import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.i18n.Toolkit; import com.fr.stable.StringUtils; import com.fr.stable.collections.CollectionUtils; +import sun.swing.table.DefaultTableCellHeaderRenderer; import javax.swing.AbstractCellEditor; +import javax.swing.BorderFactory; +import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTable; import javax.swing.SwingUtilities; @@ -132,6 +135,16 @@ public class DesensitizationRuleChoosePane extends JPanel { this.setDefaultRenderer(DesensitizationRuleStatusPane.class, new DesensitizationRuleStatusPane()); this.createTable().getColumnModel().getColumn(0).setMaxWidth(20); this.createTable().getColumnModel().getColumn(3).setMaxWidth(60); + this.createTable().getColumnModel().getColumn(3).setHeaderRenderer(new DefaultTableCellHeaderRenderer() { + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + JLabel headerLabel = new JLabel(value != null ? value.toString() : ""); + headerLabel.setToolTipText((String) value); + headerLabel.setHorizontalAlignment(JLabel.CENTER); + headerLabel.setBorder(BorderFactory.createMatteBorder(0, 0, 3, 0, new Color(216, 216, 216, 175))); + return headerLabel; + } + }); } @Override