1 | package com.jsql.view.swing.panel.consoles; | |
2 | ||
3 | import com.jsql.view.swing.util.UiUtil; | |
4 | ||
5 | import javax.swing.*; | |
6 | import javax.swing.table.DefaultTableCellRenderer; | |
7 | import java.awt.*; | |
8 | ||
9 | public class TooltipCellRenderer extends DefaultTableCellRenderer { | |
10 | | |
11 | @Override | |
12 | public Component getTableCellRendererComponent( | |
13 | JTable table, | |
14 | Object value, | |
15 | boolean isSelected, | |
16 | boolean hasFocus, | |
17 | int row, | |
18 | int column | |
19 | ) { | |
20 | | |
21 | JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); | |
22 | | |
23 |
1
1. getTableCellRendererComponent : removed call to javax/swing/JLabel::setToolTipText → NO_COVERAGE |
label.setToolTipText( |
24 | String.format( | |
25 | "<html><div style=\"font-size:10px;font-family:'%s'\">%s</div></html>", | |
26 | UiUtil.FONT_NAME_MONO_NON_ASIAN, | |
27 | label.getText().replaceAll("(.{100})(?!$)", "$1<br>") | |
28 | ) | |
29 | ); | |
30 | | |
31 |
1
1. getTableCellRendererComponent : replaced return value with null for com/jsql/view/swing/panel/consoles/TooltipCellRenderer::getTableCellRendererComponent → NO_COVERAGE |
return label; |
32 | } | |
33 | } | |
Mutations | ||
23 |
1.1 |
|
31 |
1.1 |