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 com.jsql.view.swing.util.UiUtil; | |
14 | ||
15 | import javax.swing.*; | |
16 | ||
17 | /** | |
18 | * A JTextField decorated with popup menu and border. | |
19 | */ | |
20 | public class JPopupTextField extends JPopupTextComponent<JTextField> implements DecoratorJComponent<JTextField> { | |
21 | | |
22 | public JPopupTextField(String placeholder) { | |
23 | this(new JTextFieldPlaceholder(placeholder)); | |
24 | } | |
25 | ||
26 | /** | |
27 | * Build new instance of JTextField to decorate with default text. | |
28 | * @param value Text to display | |
29 | */ | |
30 | public JPopupTextField(String placeholder, String value) { | |
31 | this(new JTextFieldPlaceholder(placeholder, value)); | |
32 | } | |
33 | ||
34 | /** | |
35 | * Decorate a provided JTextField. | |
36 | * @param proxy The JTextField to decorate | |
37 | */ | |
38 | public JPopupTextField(JTextField proxy) { | |
39 | | |
40 | super(proxy); | |
41 | ||
42 |
1
1. <init> : removed call to javax/swing/JTextField::setBorder → NO_COVERAGE |
this.getProxy().setBorder( |
43 | BorderFactory.createCompoundBorder( | |
44 | BorderFactory.createLineBorder(UiUtil.COLOR_DEFAULT_BACKGROUND, 2), | |
45 | UiUtil.BORDER_BLU | |
46 | ) | |
47 | ); | |
48 | } | |
49 | } | |
Mutations | ||
42 |
1.1 |