JPopupTextArea.java

1
/*******************************************************************************
2
 * Copyhacked (H) 2012-2020.
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 about 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.text;
12
13
import org.apache.commons.lang3.StringUtils;
14
15
import javax.swing.*;
16
import java.awt.*;
17
import java.awt.event.FocusAdapter;
18
import java.awt.event.FocusEvent;
19
20
/**
21
 * A JTextArea decorated with popup menu and border.
22
 */
23
public class JPopupTextArea extends JPopupTextComponent<JTextArea> implements DecoratorJComponent<JTextArea> {
24
    
25
    /**
26
     * Build new instance of readonly JTextArea to decorate.
27
     */
28
    public JPopupTextArea() {
29
        this(StringUtils.EMPTY);
30
    }
31
    
32
    /**
33
     * Build new instance of readonly JTextArea to decorate
34
     * with a default placeholder.
35
     */
36
    public JPopupTextArea(String placeholder) {
37
        this(new JTextAreaPlaceholder(placeholder) {
38
            @Override
39
            public boolean isEditable() {
40 1 1. isEditable : replaced boolean return with true for com/jsql/view/swing/text/JPopupTextArea$1::isEditable → NO_COVERAGE
                return false;
41
            }
42
        });
43
    }
44
45
    /**
46
     * Build new instance of JTextArea to decorate.
47
     */
48
    public JPopupTextArea(JTextArea proxy) {
49
        
50
        super(proxy);
51
52 1 1. <init> : removed call to javax/swing/JTextArea::addFocusListener → NO_COVERAGE
        this.getProxy().addFocusListener(new FocusAdapter() {
53
            @Override
54
            public void focusGained(FocusEvent arg0) {
55 1 1. focusGained : removed call to javax/swing/text/Caret::setVisible → NO_COVERAGE
                JPopupTextArea.this.getProxy().getCaret().setVisible(true);
56 1 1. focusGained : removed call to javax/swing/text/Caret::setSelectionVisible → NO_COVERAGE
                JPopupTextArea.this.getProxy().getCaret().setSelectionVisible(true);
57
            }
58
        });
59
60 1 1. <init> : removed call to javax/swing/JTextArea::setBorder → NO_COVERAGE
        this.getProxy().setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
61 1 1. <init> : removed call to javax/swing/JTextArea::setCursor → NO_COVERAGE
        this.getProxy().setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
62
    }
63
}

Mutations

40

1.1
Location : isEditable
Killed by : none
replaced boolean return with true for com/jsql/view/swing/text/JPopupTextArea$1::isEditable → NO_COVERAGE

52

1.1
Location : <init>
Killed by : none
removed call to javax/swing/JTextArea::addFocusListener → NO_COVERAGE

55

1.1
Location : focusGained
Killed by : none
removed call to javax/swing/text/Caret::setVisible → NO_COVERAGE

56

1.1
Location : focusGained
Killed by : none
removed call to javax/swing/text/Caret::setSelectionVisible → NO_COVERAGE

60

1.1
Location : <init>
Killed by : none
removed call to javax/swing/JTextArea::setBorder → NO_COVERAGE

61

1.1
Location : <init>
Killed by : none
removed call to javax/swing/JTextArea::setCursor → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.16.1