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