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 javax.swing.*; | |
14 | import java.awt.*; | |
15 | import java.awt.event.FocusAdapter; | |
16 | import java.awt.event.FocusEvent; | |
17 | ||
18 | /** | |
19 | * A JTextArea decorated with popup menu and border. | |
20 | */ | |
21 | public class JPopupTextPane extends JPopupTextComponent<JTextPane> implements DecoratorJComponent<JTextPane> { | |
22 | | |
23 | /** | |
24 | * Build new instance of JTextField to decorate. | |
25 | * @param placeholder | |
26 | */ | |
27 | public JPopupTextPane(String placeholder) { | |
28 | this(new JTextPanePlaceholderConsole(placeholder) { | |
29 | @Override | |
30 | public boolean isEditable() { | |
31 |
1
1. isEditable : replaced boolean return with true for com/jsql/view/swing/text/JPopupTextPane$1::isEditable → NO_COVERAGE |
return false; |
32 | } | |
33 | }); | |
34 | } | |
35 | ||
36 | /** | |
37 | * Build new instance of JTextArea to decorate. | |
38 | */ | |
39 | public JPopupTextPane(JTextPane proxy) { | |
40 | | |
41 | super(proxy); | |
42 | ||
43 |
1
1. <init> : removed call to javax/swing/JTextPane::addFocusListener → NO_COVERAGE |
this.getProxy().addFocusListener(new FocusAdapter() { |
44 | @Override | |
45 | public void focusGained(FocusEvent arg0) { | |
46 |
1
1. focusGained : removed call to javax/swing/text/Caret::setVisible → NO_COVERAGE |
JPopupTextPane.this.getProxy().getCaret().setVisible(true); |
47 |
1
1. focusGained : removed call to javax/swing/text/Caret::setSelectionVisible → NO_COVERAGE |
JPopupTextPane.this.getProxy().getCaret().setSelectionVisible(true); |
48 | } | |
49 | }); | |
50 | ||
51 |
1
1. <init> : removed call to javax/swing/JTextPane::setBorder → NO_COVERAGE |
this.getProxy().setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); |
52 |
1
1. <init> : removed call to javax/swing/JTextPane::setCursor → NO_COVERAGE |
this.getProxy().setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR)); |
53 | } | |
54 | } | |
Mutations | ||
31 |
1.1 |
|
43 |
1.1 |
|
46 |
1.1 |
|
47 |
1.1 |
|
51 |
1.1 |
|
52 |
1.1 |