1 | /******************************************************************************* | |
2 | * Copyhacked (H) 2012-2025. | |
3 | * This program and the accompanying materials | |
4 | * are made available under no term at all, use it like | |
5 | * you want, but share and discuss it | |
6 | * every time possible with every body. | |
7 | * | |
8 | * Contributors: | |
9 | * ron190 at ymail dot com - initial implementation | |
10 | *******************************************************************************/ | |
11 | package com.jsql.view.swing.panel; | |
12 | ||
13 | import com.jsql.model.InjectionModel; | |
14 | import com.jsql.util.I18nUtil; | |
15 | import com.jsql.util.LogLevelUtil; | |
16 | import com.jsql.util.PreferencesUtil; | |
17 | import com.jsql.view.swing.console.JTextPaneAppender; | |
18 | import com.jsql.view.swing.console.SimpleConsoleAdapter; | |
19 | import com.jsql.view.swing.panel.consoles.NetworkTable; | |
20 | import com.jsql.view.swing.panel.consoles.TabbedPaneNetworkTab; | |
21 | import com.jsql.view.swing.panel.split.SplitNS; | |
22 | import com.jsql.view.swing.tab.TabbedPaneWheeled; | |
23 | import com.jsql.view.swing.text.JPopupTextArea; | |
24 | import com.jsql.view.swing.text.JTextAreaPlaceholderConsole; | |
25 | import com.jsql.view.swing.text.JToolTipI18n; | |
26 | import com.jsql.view.swing.util.I18nViewUtil; | |
27 | import com.jsql.view.swing.util.MediatorHelper; | |
28 | import com.jsql.view.swing.util.UiUtil; | |
29 | import org.apache.commons.lang3.StringUtils; | |
30 | import org.apache.logging.log4j.LogManager; | |
31 | import org.apache.logging.log4j.Logger; | |
32 | ||
33 | import javax.swing.*; | |
34 | import javax.swing.table.DefaultTableModel; | |
35 | import java.awt.*; | |
36 | import java.awt.event.MouseAdapter; | |
37 | import java.awt.event.MouseEvent; | |
38 | import java.util.concurrent.atomic.AtomicReference; | |
39 | import java.util.prefs.Preferences; | |
40 | ||
41 | /** | |
42 | * A panel with different consoles displayed on the bottom. | |
43 | */ | |
44 | public class PanelConsoles extends JPanel { | |
45 | ||
46 | /** | |
47 | * Log4j logger sent to view. | |
48 | */ | |
49 | private static final Logger LOGGER = LogManager.getRootLogger(); | |
50 | ||
51 | public static final String CONSOLE_JAVA_TOOLTIP = "CONSOLE_JAVA_TOOLTIP"; | |
52 | public static final String CONSOLE_CHUNK_TOOLTIP = "CONSOLE_CHUNK_TOOLTIP"; | |
53 | public static final String CONSOLE_BINARY_TOOLTIP = "CONSOLE_BINARY_TOOLTIP"; | |
54 | public static final String CONSOLE_MAIN_TOOLTIP = "CONSOLE_MAIN_TOOLTIP"; | |
55 | ||
56 | /** | |
57 | * Console for java exception messages. | |
58 | */ | |
59 | private final SimpleConsoleAdapter javaTextPane = new SimpleConsoleAdapter("Java", I18nUtil.valueByKey(PanelConsoles.CONSOLE_JAVA_TOOLTIP)); | |
60 | | |
61 | /** | |
62 | * Console for raw SQL results. | |
63 | */ | |
64 | private JTextArea chunkTextArea; | |
65 | ||
66 | /** | |
67 | * Panel displaying table of HTTP requests and responses. | |
68 | */ | |
69 | private JSplitPane networkSplitPane; | |
70 | ||
71 | /** | |
72 | * Console for binary representation of characters found with blind/time injection. | |
73 | */ | |
74 | private JTextArea binaryTextArea; | |
75 | ||
76 | private final TabbedPaneWheeled tabConsoles = new TabbedPaneWheeled(); | |
77 | private TabbedPaneNetworkTab tabbedPaneNetworkTab; | |
78 | private NetworkTable networkTable; | |
79 | | |
80 | private final JLabel labelShowNorth = new JLabel(UiUtil.ARROW_UP.getIcon()); | |
81 | private int dividerLocation = 0; | |
82 | | |
83 | /** | |
84 | * Create panel at the bottom with different consoles to report injection process. | |
85 | */ | |
86 | public PanelConsoles() { | |
87 |
1
1. <init> : removed call to com/jsql/view/swing/util/I18nViewUtil::addComponentForKey → NO_COVERAGE |
I18nViewUtil.addComponentForKey(PanelConsoles.CONSOLE_JAVA_TOOLTIP, this.javaTextPane.getProxy()); |
88 |
1
1. <init> : removed call to javax/swing/JTextPane::setEditable → NO_COVERAGE |
this.javaTextPane.getProxy().setEditable(false); |
89 |
1
1. <init> : removed call to com/jsql/view/swing/console/JTextPaneAppender::registerJavaConsole → NO_COVERAGE |
JTextPaneAppender.registerJavaConsole(this.javaTextPane); |
90 | | |
91 |
1
1. <init> : removed call to com/jsql/view/swing/panel/PanelConsoles::initSplit → NO_COVERAGE |
this.initSplit(); |
92 | ||
93 |
1
1. <init> : removed call to com/jsql/view/swing/util/MediatorHelper::register → NO_COVERAGE |
MediatorHelper.register(this.tabConsoles); |
94 |
1
1. <init> : removed call to com/jsql/view/swing/panel/PanelConsoles::initTabsConsoles → NO_COVERAGE |
this.initTabsConsoles(); |
95 |
1
1. <init> : removed call to com/jsql/view/swing/panel/PanelConsoles::setLayout → NO_COVERAGE |
this.setLayout(new BorderLayout()); |
96 | ||
97 | JPanel expandPanel = this.initExpandPanel(); | |
98 |
1
1. <init> : removed call to com/jsql/view/swing/tab/TabbedPaneWheeled::putClientProperty → NO_COVERAGE |
this.tabConsoles.putClientProperty("JTabbedPane.trailingComponent", expandPanel); |
99 | this.add(this.tabConsoles); | |
100 | ||
101 |
1
1. <init> : removed call to com/jsql/view/swing/tab/TabbedPaneWheeled::setAlignmentX → NO_COVERAGE |
this.tabConsoles.setAlignmentX(FlowLayout.LEADING); |
102 | } | |
103 | ||
104 | private void initSplit() { | |
105 | this.networkSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); | |
106 |
1
1. initSplit : removed call to javax/swing/JSplitPane::setDividerLocation → NO_COVERAGE |
this.networkSplitPane.setDividerLocation(600); |
107 |
1
1. initSplit : removed call to javax/swing/JSplitPane::setPreferredSize → NO_COVERAGE |
this.networkSplitPane.setPreferredSize(new Dimension(0,0)); // required for correct scroll placement |
108 | ||
109 | this.tabbedPaneNetworkTab = new TabbedPaneNetworkTab(); | |
110 |
1
1. initSplit : removed call to javax/swing/JSplitPane::setRightComponent → NO_COVERAGE |
this.networkSplitPane.setRightComponent(this.tabbedPaneNetworkTab); |
111 | this.networkTable = new NetworkTable(this.tabbedPaneNetworkTab); | |
112 | | |
113 | JPanel panelTable = new JPanel(new BorderLayout()); // required for correct scroll placement | |
114 |
1
1. initSplit : removed call to javax/swing/JPanel::add → NO_COVERAGE |
panelTable.add(new JScrollPane(this.networkTable), BorderLayout.CENTER); |
115 |
1
1. initSplit : removed call to javax/swing/JSplitPane::setLeftComponent → NO_COVERAGE |
this.networkSplitPane.setLeftComponent(panelTable); |
116 | } | |
117 | ||
118 | private void initTabsConsoles() { | |
119 | var proxyChunk = new JTextAreaPlaceholderConsole(I18nUtil.valueByKey(PanelConsoles.CONSOLE_CHUNK_TOOLTIP)); | |
120 | this.chunkTextArea = new JPopupTextArea(proxyChunk).getProxy(); | |
121 |
1
1. initTabsConsoles : removed call to com/jsql/view/swing/util/I18nViewUtil::addComponentForKey → NO_COVERAGE |
I18nViewUtil.addComponentForKey(PanelConsoles.CONSOLE_CHUNK_TOOLTIP, proxyChunk); |
122 |
1
1. initTabsConsoles : removed call to javax/swing/JTextArea::setLineWrap → NO_COVERAGE |
this.chunkTextArea.setLineWrap(true); |
123 |
1
1. initTabsConsoles : removed call to javax/swing/JTextArea::setEditable → NO_COVERAGE |
this.chunkTextArea.setEditable(false); |
124 | ||
125 | var proxyBinary = new JTextAreaPlaceholderConsole(I18nUtil.valueByKey(PanelConsoles.CONSOLE_BINARY_TOOLTIP)); | |
126 |
1
1. initTabsConsoles : removed call to com/jsql/view/swing/util/I18nViewUtil::addComponentForKey → NO_COVERAGE |
I18nViewUtil.addComponentForKey(PanelConsoles.CONSOLE_BINARY_TOOLTIP, proxyBinary); |
127 | this.binaryTextArea = new JPopupTextArea(proxyBinary).getProxy(); | |
128 |
1
1. initTabsConsoles : removed call to javax/swing/JTextArea::setLineWrap → NO_COVERAGE |
this.binaryTextArea.setLineWrap(true); |
129 |
1
1. initTabsConsoles : removed call to javax/swing/JTextArea::setEditable → NO_COVERAGE |
this.binaryTextArea.setEditable(false); |
130 | ||
131 | var consoleTextPane = new SimpleConsoleAdapter("Console", I18nUtil.valueByKey(PanelConsoles.CONSOLE_MAIN_TOOLTIP)); | |
132 |
1
1. initTabsConsoles : removed call to com/jsql/view/swing/util/I18nViewUtil::addComponentForKey → NO_COVERAGE |
I18nViewUtil.addComponentForKey(PanelConsoles.CONSOLE_MAIN_TOOLTIP, consoleTextPane.getProxy()); |
133 |
1
1. initTabsConsoles : removed call to javax/swing/JTextPane::setEditable → NO_COVERAGE |
consoleTextPane.getProxy().setEditable(false); |
134 |
1
1. initTabsConsoles : removed call to com/jsql/view/swing/console/JTextPaneAppender::register → NO_COVERAGE |
JTextPaneAppender.register(consoleTextPane); |
135 | ||
136 |
1
1. initTabsConsoles : removed call to com/jsql/view/swing/panel/PanelConsoles::buildI18nTab → NO_COVERAGE |
this.buildI18nTab( |
137 | "CONSOLE_MAIN_LABEL", | |
138 | PanelConsoles.CONSOLE_MAIN_TOOLTIP, | |
139 | UiUtil.CONSOLE.getIcon(), | |
140 | new JScrollPane(consoleTextPane.getProxy()), | |
141 | 0 | |
142 | ); | |
143 | ||
144 | var preferences = Preferences.userRoot().node(InjectionModel.class.getName()); // Order is important | |
145 |
1
1. initTabsConsoles : negated conditional → NO_COVERAGE |
if (preferences.getBoolean(PreferencesUtil.JAVA_VISIBLE, false)) { |
146 |
1
1. initTabsConsoles : removed call to com/jsql/view/swing/panel/PanelConsoles::insertJavaTab → NO_COVERAGE |
this.insertJavaTab(); |
147 | } | |
148 |
1
1. initTabsConsoles : negated conditional → NO_COVERAGE |
if (preferences.getBoolean(PreferencesUtil.NETWORK_VISIBLE, true)) { |
149 |
1
1. initTabsConsoles : removed call to com/jsql/view/swing/panel/PanelConsoles::insertNetworkTab → NO_COVERAGE |
this.insertNetworkTab(); |
150 | } | |
151 |
1
1. initTabsConsoles : negated conditional → NO_COVERAGE |
if (preferences.getBoolean(PreferencesUtil.CHUNK_VISIBLE, true)) { |
152 |
1
1. initTabsConsoles : removed call to com/jsql/view/swing/panel/PanelConsoles::insertChunkTab → NO_COVERAGE |
this.insertChunkTab(); |
153 | } | |
154 |
1
1. initTabsConsoles : negated conditional → NO_COVERAGE |
if (preferences.getBoolean(PreferencesUtil.BINARY_VISIBLE, true)) { |
155 |
1
1. initTabsConsoles : removed call to com/jsql/view/swing/panel/PanelConsoles::insertBooleanTab → NO_COVERAGE |
this.insertBooleanTab(); |
156 | } | |
157 | ||
158 |
1
1. initTabsConsoles : removed call to com/jsql/view/swing/tab/TabbedPaneWheeled::addMouseListener → NO_COVERAGE |
this.tabConsoles.addMouseListener(new MouseAdapter() { |
159 | @Override | |
160 | public void mousePressed(MouseEvent e) { | |
161 | int tabIndex = PanelConsoles.this.tabConsoles.indexAtLocation(e.getX(), e.getY()); | |
162 |
2
1. mousePressed : negated conditional → NO_COVERAGE 2. mousePressed : negated conditional → NO_COVERAGE |
if (tabIndex == -1 && e.getButton() == MouseEvent.BUTTON2) { // middle click on header with no tab |
163 |
1
1. mousePressed : removed call to com/jsql/view/swing/panel/split/ActionHideShowConsole::actionPerformed → NO_COVERAGE |
SplitNS.getActionHideShowConsole().actionPerformed(null); |
164 | } | |
165 | } | |
166 | }); | |
167 |
1
1. initTabsConsoles : removed call to com/jsql/view/swing/tab/TabbedPaneWheeled::addChangeListener → NO_COVERAGE |
this.tabConsoles.addChangeListener(changeEvent -> { // Reset Font when tab is selected |
168 | JTabbedPane tabs = this.tabConsoles; | |
169 |
2
1. lambda$initTabsConsoles$0 : negated conditional → NO_COVERAGE 2. lambda$initTabsConsoles$0 : changed conditional boundary → NO_COVERAGE |
if (tabs.getSelectedIndex() > -1) { |
170 | var currentTabHeader = tabs.getTabComponentAt(tabs.getSelectedIndex()); | |
171 |
1
1. lambda$initTabsConsoles$0 : negated conditional → NO_COVERAGE |
if (currentTabHeader != null) { |
172 |
1
1. lambda$initTabsConsoles$0 : removed call to java/awt/Component::setFont → NO_COVERAGE |
currentTabHeader.setFont(currentTabHeader.getFont().deriveFont(Font.PLAIN)); |
173 |
1
1. lambda$initTabsConsoles$0 : removed call to java/awt/Component::setForeground → NO_COVERAGE |
currentTabHeader.setForeground(UIManager.getColor("TabbedPane.foreground")); |
174 | } | |
175 | } | |
176 | }); | |
177 | } | |
178 | ||
179 | private JPanel initExpandPanel() { | |
180 | var labelShowSouth = new JLabel(UiUtil.ARROW_DOWN.getIcon()); | |
181 |
1
1. initExpandPanel : removed call to javax/swing/JLabel::setName → NO_COVERAGE |
labelShowSouth.setName("buttonShowSouth"); |
182 |
1
1. initExpandPanel : removed call to javax/swing/JLabel::addMouseListener → NO_COVERAGE |
labelShowSouth.addMouseListener(new MouseAdapter() { |
183 | @Override | |
184 | public void mouseClicked(MouseEvent e) { | |
185 |
1
1. mouseClicked : removed call to com/jsql/view/swing/panel/split/ActionHideShowConsole::actionPerformed → NO_COVERAGE |
SplitNS.getActionHideShowConsole().actionPerformed(null); |
186 | } | |
187 | }); | |
188 | | |
189 |
1
1. initExpandPanel : removed call to javax/swing/JLabel::setName → NO_COVERAGE |
this.labelShowNorth.setName("buttonShowNorth"); |
190 |
1
1. initExpandPanel : removed call to javax/swing/JLabel::addMouseListener → NO_COVERAGE |
this.labelShowNorth.addMouseListener(new MouseAdapter() { |
191 | @Override | |
192 | public void mouseClicked(MouseEvent e) { | |
193 |
1
1. mouseClicked : removed call to com/jsql/view/swing/panel/split/ActionHideShowResult::actionPerformed → NO_COVERAGE |
SplitNS.getActionHideShowResult().actionPerformed(null); |
194 | } | |
195 | }); | |
196 | ||
197 | var panelExpander = new JPanel(); | |
198 |
1
1. initExpandPanel : removed call to javax/swing/JPanel::setLayout → NO_COVERAGE |
panelExpander.setLayout(new BoxLayout(panelExpander, BoxLayout.X_AXIS)); |
199 | panelExpander.add(Box.createGlue()); | |
200 | panelExpander.add(this.labelShowNorth); | |
201 | panelExpander.add(labelShowSouth); | |
202 |
1
1. initExpandPanel : replaced return value with null for com/jsql/view/swing/panel/PanelConsoles::initExpandPanel → NO_COVERAGE |
return panelExpander; |
203 | } | |
204 | ||
205 | public void reset() { | |
206 | // Empty infos tabs | |
207 |
1
1. reset : removed call to javax/swing/JTextArea::setText → NO_COVERAGE |
this.chunkTextArea.setText(StringUtils.EMPTY); |
208 |
1
1. reset : removed call to javax/swing/JTextArea::setText → NO_COVERAGE |
this.binaryTextArea.setText(StringUtils.EMPTY); |
209 |
1
1. reset : removed call to javax/swing/JTextPane::setText → NO_COVERAGE |
this.javaTextPane.getProxy().setText(StringUtils.EMPTY); |
210 | ||
211 |
1
1. reset : removed call to java/util/List::clear → NO_COVERAGE |
this.networkTable.getListHttpHeader().clear(); |
212 | // Fix #4657, Fix #1860: Multiple Exceptions on setRowCount() | |
213 | try { | |
214 |
1
1. reset : removed call to javax/swing/table/DefaultTableModel::setRowCount → NO_COVERAGE |
((DefaultTableModel) this.networkTable.getModel()).setRowCount(0); |
215 | } catch(NullPointerException | ArrayIndexOutOfBoundsException e) { | |
216 | LOGGER.log(LogLevelUtil.CONSOLE_JAVA, e, e); | |
217 | } | |
218 | ||
219 |
1
1. reset : removed call to com/jsql/view/swing/panel/consoles/TabbedPaneNetworkTab::reset → NO_COVERAGE |
this.tabbedPaneNetworkTab.reset(); |
220 | } | |
221 | ||
222 | /** | |
223 | * Add Chunk console to bottom panel. | |
224 | */ | |
225 | public void insertChunkTab() { | |
226 |
1
1. insertChunkTab : removed call to com/jsql/view/swing/panel/PanelConsoles::buildI18nTab → NO_COVERAGE |
this.buildI18nTab( |
227 | "CONSOLE_CHUNK_LABEL", | |
228 | PanelConsoles.CONSOLE_CHUNK_TOOLTIP, | |
229 | UiUtil.CHUNK.getIcon(), | |
230 | new JScrollPane(this.chunkTextArea), | |
231 | 1 | |
232 | ); | |
233 | } | |
234 | ||
235 | /** | |
236 | * Add Binary console to bottom panel. | |
237 | */ | |
238 | public void insertBooleanTab() { | |
239 |
1
1. insertBooleanTab : negated conditional → NO_COVERAGE |
var positionFromChunk = this.tabConsoles.indexOfTab(UiUtil.CHUNK.getIcon()) != -1 ? 1 : 0; |
240 |
1
1. insertBooleanTab : removed call to com/jsql/view/swing/panel/PanelConsoles::buildI18nTab → NO_COVERAGE |
this.buildI18nTab( |
241 | "CONSOLE_BINARY_LABEL", | |
242 | PanelConsoles.CONSOLE_BINARY_TOOLTIP, | |
243 |
1
1. insertBooleanTab : Replaced integer addition with subtraction → NO_COVERAGE |
UiUtil.BINARY.getIcon(), |
244 | new JScrollPane(this.binaryTextArea), | |
245 | 1 + positionFromChunk | |
246 | ); | |
247 | } | |
248 | ||
249 | /** | |
250 | * Add Network tab to bottom panel. | |
251 | */ | |
252 | public void insertNetworkTab() { | |
253 |
1
1. insertNetworkTab : negated conditional → NO_COVERAGE |
var positionFromJava = this.tabConsoles.indexOfTab(UiUtil.CUP.getIcon()) != -1 ? 1 : 0; |
254 |
1
1. insertNetworkTab : removed call to com/jsql/view/swing/panel/PanelConsoles::buildI18nTab → NO_COVERAGE |
this.buildI18nTab( |
255 | "CONSOLE_NETWORK_LABEL", | |
256 | "CONSOLE_NETWORK_TOOLTIP", | |
257 | UiUtil.NETWORK.getIcon(), | |
258 | new JScrollPane(this.networkSplitPane), | |
259 |
1
1. insertNetworkTab : Replaced integer subtraction with addition → NO_COVERAGE |
this.tabConsoles.getTabCount() - positionFromJava |
260 | ); | |
261 | } | |
262 | ||
263 | /** | |
264 | * Add Java console to bottom panel. | |
265 | */ | |
266 | public void insertJavaTab() { | |
267 |
1
1. insertJavaTab : removed call to com/jsql/view/swing/panel/PanelConsoles::buildI18nTab → NO_COVERAGE |
this.buildI18nTab( |
268 | "CONSOLE_JAVA_LABEL", | |
269 | PanelConsoles.CONSOLE_JAVA_TOOLTIP, | |
270 | UiUtil.CUP.getIcon(), | |
271 | new JScrollPane(this.javaTextPane.getProxy()), | |
272 | this.tabConsoles.getTabCount() | |
273 | ); | |
274 | } | |
275 | | |
276 | private void buildI18nTab(String keyLabel, String keyTooltip, Icon icon, Component manager, int position) { | |
277 | var refJToolTipI18n = new AtomicReference<>(new JToolTipI18n(I18nViewUtil.valueByKey(keyTooltip))); | |
278 | | |
279 | var labelTab = new JLabel(I18nViewUtil.valueByKey(keyLabel), icon, SwingConstants.CENTER) { | |
280 | @Override | |
281 | public JToolTip createToolTip() { | |
282 |
1
1. createToolTip : removed call to java/util/concurrent/atomic/AtomicReference::set → NO_COVERAGE |
refJToolTipI18n.set(new JToolTipI18n(I18nViewUtil.valueByKey(keyTooltip))); |
283 |
1
1. createToolTip : replaced return value with null for com/jsql/view/swing/panel/PanelConsoles$4::createToolTip → NO_COVERAGE |
return refJToolTipI18n.get(); |
284 | } | |
285 | }; | |
286 | | |
287 |
1
1. buildI18nTab : removed call to com/jsql/view/swing/panel/PanelConsoles$4::setName → NO_COVERAGE |
labelTab.setName(keyLabel); |
288 |
1
1. buildI18nTab : removed call to com/jsql/view/swing/panel/PanelConsoles$4::addMouseListener → NO_COVERAGE |
labelTab.addMouseListener(new MouseAdapter() { |
289 | @Override | |
290 | public void mousePressed(MouseEvent event) { | |
291 | // Fix #90428: IllegalArgumentException in setSelectedComponent() | |
292 | // ArrayIndexOutOfBoundsException #92973 on setSelectedComponent() | |
293 | try { | |
294 |
1
1. mousePressed : removed call to com/jsql/view/swing/tab/TabbedPaneWheeled::setSelectedComponent → NO_COVERAGE |
PanelConsoles.this.tabConsoles.setSelectedComponent(manager); |
295 | } catch (IllegalArgumentException e) { | |
296 | LOGGER.log(LogLevelUtil.CONSOLE_JAVA, e, e); | |
297 | } | |
298 | } | |
299 | }); | |
300 | | |
301 |
1
1. buildI18nTab : removed call to com/jsql/view/swing/tab/TabbedPaneWheeled::insertTab → NO_COVERAGE |
this.tabConsoles.insertTab(I18nViewUtil.valueByKey(keyLabel), icon, manager, null, position); |
302 |
1
1. buildI18nTab : removed call to com/jsql/view/swing/tab/TabbedPaneWheeled::setTabComponentAt → NO_COVERAGE |
this.tabConsoles.setTabComponentAt(this.tabConsoles.indexOfTab(I18nViewUtil.valueByKey(keyLabel)), labelTab); |
303 | | |
304 |
1
1. buildI18nTab : removed call to com/jsql/view/swing/util/I18nViewUtil::addComponentForKey → NO_COVERAGE |
I18nViewUtil.addComponentForKey(keyLabel, labelTab); |
305 |
1
1. buildI18nTab : removed call to com/jsql/view/swing/util/I18nViewUtil::addComponentForKey → NO_COVERAGE |
I18nViewUtil.addComponentForKey(keyTooltip, refJToolTipI18n.get()); |
306 |
1
1. buildI18nTab : removed call to com/jsql/view/swing/panel/PanelConsoles$4::setToolTipText → NO_COVERAGE |
labelTab.setToolTipText(I18nViewUtil.valueByKey(keyTooltip)); |
307 | } | |
308 | | |
309 | public void messageChunk(String text) { | |
310 | try { | |
311 |
1
1. messageChunk : removed call to javax/swing/JTextArea::append → NO_COVERAGE |
this.chunkTextArea.append(text +"\n"); |
312 |
1
1. messageChunk : removed call to javax/swing/JTextArea::setCaretPosition → NO_COVERAGE |
this.chunkTextArea.setCaretPosition(this.chunkTextArea.getDocument().getLength()); |
313 | } catch (NullPointerException | ArrayIndexOutOfBoundsException e) { | |
314 | // Fix #67063: NullPointerException on chunkTab.append() | |
315 | // Fix #4770 on chunkTab.append() | |
316 | LOGGER.log(LogLevelUtil.CONSOLE_JAVA, e.getMessage(), e); | |
317 | } | |
318 | } | |
319 | | |
320 | public void messageBinary(String text) { | |
321 | try { | |
322 |
1
1. messageBinary : removed call to javax/swing/JTextArea::append → NO_COVERAGE |
this.binaryTextArea.append(String.format("\t%s", text)); |
323 |
1
1. messageBinary : removed call to javax/swing/JTextArea::setCaretPosition → NO_COVERAGE |
this.binaryTextArea.setCaretPosition(this.binaryTextArea.getDocument().getLength()); |
324 | } catch (NullPointerException | ArrayIndexOutOfBoundsException e) { | |
325 | LOGGER.log(LogLevelUtil.CONSOLE_JAVA, e.getMessage(), e); | |
326 | } | |
327 | } | |
328 | | |
329 | | |
330 | // Getter and setter | |
331 | ||
332 | public int getDividerLocation() { | |
333 |
1
1. getDividerLocation : replaced int return with 0 for com/jsql/view/swing/panel/PanelConsoles::getDividerLocation → NO_COVERAGE |
return this.dividerLocation; |
334 | } | |
335 | ||
336 | public void setDividerLocation(int location) { | |
337 | this.dividerLocation = location; | |
338 | } | |
339 | ||
340 | public JLabel getLabelShowNorth() { | |
341 |
1
1. getLabelShowNorth : replaced return value with null for com/jsql/view/swing/panel/PanelConsoles::getLabelShowNorth → NO_COVERAGE |
return this.labelShowNorth; |
342 | } | |
343 | ||
344 | public NetworkTable getNetworkTable() { | |
345 |
1
1. getNetworkTable : replaced return value with null for com/jsql/view/swing/panel/PanelConsoles::getNetworkTable → NO_COVERAGE |
return this.networkTable; |
346 | } | |
347 | ||
348 | public TabbedPaneNetworkTab getTabbedPaneNetworkTab() { | |
349 |
1
1. getTabbedPaneNetworkTab : replaced return value with null for com/jsql/view/swing/panel/PanelConsoles::getTabbedPaneNetworkTab → NO_COVERAGE |
return this.tabbedPaneNetworkTab; |
350 | } | |
351 | } | |
Mutations | ||
87 |
1.1 |
|
88 |
1.1 |
|
89 |
1.1 |
|
91 |
1.1 |
|
93 |
1.1 |
|
94 |
1.1 |
|
95 |
1.1 |
|
98 |
1.1 |
|
101 |
1.1 |
|
106 |
1.1 |
|
107 |
1.1 |
|
110 |
1.1 |
|
114 |
1.1 |
|
115 |
1.1 |
|
121 |
1.1 |
|
122 |
1.1 |
|
123 |
1.1 |
|
126 |
1.1 |
|
128 |
1.1 |
|
129 |
1.1 |
|
132 |
1.1 |
|
133 |
1.1 |
|
134 |
1.1 |
|
136 |
1.1 |
|
145 |
1.1 |
|
146 |
1.1 |
|
148 |
1.1 |
|
149 |
1.1 |
|
151 |
1.1 |
|
152 |
1.1 |
|
154 |
1.1 |
|
155 |
1.1 |
|
158 |
1.1 |
|
162 |
1.1 2.2 |
|
163 |
1.1 |
|
167 |
1.1 |
|
169 |
1.1 2.2 |
|
171 |
1.1 |
|
172 |
1.1 |
|
173 |
1.1 |
|
181 |
1.1 |
|
182 |
1.1 |
|
185 |
1.1 |
|
189 |
1.1 |
|
190 |
1.1 |
|
193 |
1.1 |
|
198 |
1.1 |
|
202 |
1.1 |
|
207 |
1.1 |
|
208 |
1.1 |
|
209 |
1.1 |
|
211 |
1.1 |
|
214 |
1.1 |
|
219 |
1.1 |
|
226 |
1.1 |
|
239 |
1.1 |
|
240 |
1.1 |
|
243 |
1.1 |
|
253 |
1.1 |
|
254 |
1.1 |
|
259 |
1.1 |
|
267 |
1.1 |
|
282 |
1.1 |
|
283 |
1.1 |
|
287 |
1.1 |
|
288 |
1.1 |
|
294 |
1.1 |
|
301 |
1.1 |
|
302 |
1.1 |
|
304 |
1.1 |
|
305 |
1.1 |
|
306 |
1.1 |
|
311 |
1.1 |
|
312 |
1.1 |
|
322 |
1.1 |
|
323 |
1.1 |
|
333 |
1.1 |
|
341 |
1.1 |
|
345 |
1.1 |
|
349 |
1.1 |