| 1 | package com.jsql.view.swing.manager.util; | |
| 2 | ||
| 3 | import javax.swing.*; | |
| 4 | import java.awt.event.ActionEvent; | |
| 5 | import java.awt.event.ActionListener; | |
| 6 | ||
| 7 | public class SeparatorListener implements ActionListener { | |
| 8 | private final JComboBox<Object> comboBox; | |
| 9 | private Object currentItem; | |
| 10 | ||
| 11 | public SeparatorListener(JComboBox<Object> comboBox) { | |
| 12 | this.comboBox = comboBox; | |
| 13 |
1
1. <init> : removed call to javax/swing/JComboBox::setSelectedIndex → NO_COVERAGE |
comboBox.setSelectedIndex(0); |
| 14 | this.currentItem = comboBox.getSelectedItem(); | |
| 15 | } | |
| 16 | ||
| 17 | public void actionPerformed(ActionEvent e) { | |
| 18 |
1
1. actionPerformed : negated conditional → NO_COVERAGE |
if (this.comboBox.getSelectedItem() == ComboBoxMethodRenderer.SEPARATOR) { |
| 19 |
1
1. actionPerformed : removed call to javax/swing/JComboBox::setSelectedItem → NO_COVERAGE |
this.comboBox.setSelectedItem(this.currentItem); |
| 20 | } else { | |
| 21 | this.currentItem = this.comboBox.getSelectedItem(); | |
| 22 | } | |
| 23 | } | |
| 24 | } | |
Mutations | ||
| 13 |
1.1 |
|
| 18 |
1.1 |
|
| 19 |
1.1 |