ActionCloseTabResult.java

1
package com.jsql.view.swing.action;
2
3
import com.jsql.util.I18nUtil;
4
import com.jsql.view.swing.tab.TabHeader;
5
import com.jsql.view.swing.util.MediatorHelper;
6
7
import javax.swing.*;
8
import java.awt.*;
9
import java.awt.event.ActionEvent;
10
11
public class ActionCloseTabResult extends AbstractAction {
12
    
13
    @Override
14
    public void actionPerformed(ActionEvent e) {
15 1 1. actionPerformed : removed call to com/jsql/view/swing/action/ActionCloseTabResult::perform → NO_COVERAGE
        ActionCloseTabResult.perform(MediatorHelper.tabResults().getSelectedIndex());
16
    }
17
    
18
    public static void perform(int closeTabNumber) {
19 2 1. perform : negated conditional → NO_COVERAGE
2. perform : changed conditional boundary → NO_COVERAGE
        if (MediatorHelper.tabResults().getTabCount() > 0) {
20
            
21
            var tab = MediatorHelper.tabResults().getTabComponentAt(closeTabNumber);
22
            
23
            // Stop syntax color highlighter
24 1 1. perform : negated conditional → NO_COVERAGE
            if (
25
                tab instanceof TabHeader
26 1 1. perform : negated conditional → NO_COVERAGE
                && ((TabHeader) tab).getCleanableTab() != null
27
            ) {
28 1 1. perform : removed call to com/jsql/view/swing/tab/TabHeader$Cleanable::clean → NO_COVERAGE
                ((TabHeader) tab).getCleanableTab().clean();
29
            }
30
31 1 1. perform : removed call to com/jsql/view/swing/tab/TabResults::removeTabAt → NO_COVERAGE
            MediatorHelper.tabResults().removeTabAt(closeTabNumber);
32
            
33 1 1. perform : removed call to com/jsql/view/swing/action/ActionCloseTabResult::displayPlaceholder → NO_COVERAGE
            ActionCloseTabResult.displayPlaceholder();
34
        }
35
    }
36
    
37
    private static void displayPlaceholder() {
38 1 1. displayPlaceholder : negated conditional → NO_COVERAGE
        if (MediatorHelper.tabResults().getTabCount() == 0) {
39
            
40
            var splitPaneTopBottom = MediatorHelper.frame().getSplitHorizontalTopBottom();
41
            JSplitPane splitPaneLeftRight = splitPaneTopBottom.getSplitVerticalLeftRight();
42
            
43
            int i = splitPaneLeftRight.getDividerLocation();
44
            
45 1 1. displayPlaceholder : negated conditional → NO_COVERAGE
            if (ComponentOrientation.LEFT_TO_RIGHT.equals(ComponentOrientation.getOrientation(I18nUtil.getLocaleDefault()))) {
46 1 1. displayPlaceholder : removed call to javax/swing/JSplitPane::setRightComponent → NO_COVERAGE
                splitPaneLeftRight.setRightComponent(
47
                    splitPaneTopBottom.getLabelPlaceholderResult()
48
                );
49
            } else {
50 1 1. displayPlaceholder : removed call to javax/swing/JSplitPane::setLeftComponent → NO_COVERAGE
                splitPaneLeftRight.setLeftComponent(
51
                    splitPaneTopBottom.getLabelPlaceholderResult()
52
                );
53
            }
54
            
55 1 1. displayPlaceholder : removed call to javax/swing/JSplitPane::setDividerLocation → NO_COVERAGE
            splitPaneLeftRight.setDividerLocation(i);
56
        }
57
    }
58
}

Mutations

15

1.1
Location : actionPerformed
Killed by : none
removed call to com/jsql/view/swing/action/ActionCloseTabResult::perform → NO_COVERAGE

19

1.1
Location : perform
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : perform
Killed by : none
changed conditional boundary → NO_COVERAGE

24

1.1
Location : perform
Killed by : none
negated conditional → NO_COVERAGE

26

1.1
Location : perform
Killed by : none
negated conditional → NO_COVERAGE

28

1.1
Location : perform
Killed by : none
removed call to com/jsql/view/swing/tab/TabHeader$Cleanable::clean → NO_COVERAGE

31

1.1
Location : perform
Killed by : none
removed call to com/jsql/view/swing/tab/TabResults::removeTabAt → NO_COVERAGE

33

1.1
Location : perform
Killed by : none
removed call to com/jsql/view/swing/action/ActionCloseTabResult::displayPlaceholder → NO_COVERAGE

38

1.1
Location : displayPlaceholder
Killed by : none
negated conditional → NO_COVERAGE

45

1.1
Location : displayPlaceholder
Killed by : none
negated conditional → NO_COVERAGE

46

1.1
Location : displayPlaceholder
Killed by : none
removed call to javax/swing/JSplitPane::setRightComponent → NO_COVERAGE

50

1.1
Location : displayPlaceholder
Killed by : none
removed call to javax/swing/JSplitPane::setLeftComponent → NO_COVERAGE

55

1.1
Location : displayPlaceholder
Killed by : none
removed call to javax/swing/JSplitPane::setDividerLocation → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.16.1