EmptyFocus.java

1
package com.jsql.view.swing.shell;
2
3
import java.awt.event.MouseEvent;
4
import java.awt.event.MouseListener;
5
6
/**
7
 * Cancel every mouse click, only gives focus.
8
 */
9
public class EmptyFocus implements MouseListener {
10
    
11
    private final AbstractShell abstractShell;
12
    
13
    public EmptyFocus(AbstractShell abstractShell) {
14
        this.abstractShell = abstractShell;
15
    }
16
17
    @Override
18
    public void mousePressed(MouseEvent e) {
19
        
20 1 1. mousePressed : removed call to java/awt/event/MouseEvent::consume → NO_COVERAGE
        e.consume();
21
        this.abstractShell.requestFocusInWindow();
22 1 1. mousePressed : removed call to com/jsql/view/swing/shell/AbstractShell::setCaretPosition → NO_COVERAGE
        this.abstractShell.setCaretPosition(this.abstractShell.getDocument().getLength());
23
    }
24
    
25
    @Override
26
    public void mouseReleased(MouseEvent e) {
27 1 1. mouseReleased : removed call to java/awt/event/MouseEvent::consume → NO_COVERAGE
        e.consume();
28
    }
29
    
30
    @Override
31
    public void mouseExited(MouseEvent e) {
32 1 1. mouseExited : removed call to java/awt/event/MouseEvent::consume → NO_COVERAGE
        e.consume();
33
    }
34
    
35
    @Override
36
    public void mouseEntered(MouseEvent e) {
37 1 1. mouseEntered : removed call to java/awt/event/MouseEvent::consume → NO_COVERAGE
        e.consume();
38
    }
39
    
40
    @Override
41
    public void mouseClicked(MouseEvent e) {
42 1 1. mouseClicked : removed call to java/awt/event/MouseEvent::consume → NO_COVERAGE
        e.consume();
43
    }
44
}

Mutations

20

1.1
Location : mousePressed
Killed by : none
removed call to java/awt/event/MouseEvent::consume → NO_COVERAGE

22

1.1
Location : mousePressed
Killed by : none
removed call to com/jsql/view/swing/shell/AbstractShell::setCaretPosition → NO_COVERAGE

27

1.1
Location : mouseReleased
Killed by : none
removed call to java/awt/event/MouseEvent::consume → NO_COVERAGE

32

1.1
Location : mouseExited
Killed by : none
removed call to java/awt/event/MouseEvent::consume → NO_COVERAGE

37

1.1
Location : mouseEntered
Killed by : none
removed call to java/awt/event/MouseEvent::consume → NO_COVERAGE

42

1.1
Location : mouseClicked
Killed by : none
removed call to java/awt/event/MouseEvent::consume → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.16.1