• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jiangxincode / ApkToolBoxGUI / #631

02 Mar 2024 04:18PM UTC coverage: 3.216% (-0.02%) from 3.232%
#631

push

jiangxincode
fix codefactor issues

0 of 180 new or added lines in 11 files covered. (0.0%)

3 existing lines in 2 files now uncovered.

240 of 7463 relevant lines covered (3.22%)

0.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/edu/jiangxin/apktoolbox/swing/extend/autocomplete/AutoCompleteComboBox.java
1
package edu.jiangxin.apktoolbox.swing.extend.autocomplete;
2

3
import javax.swing.*;
4
import java.io.Serial;
5
import java.util.Vector;
6

7
/**
8
 * @author jiangxin
9
 * @author 2018-09-09
10
 *
11
 */
12
public class AutoCompleteComboBox<E> extends JComboBox<E> {
13

14
    @Serial
15
    private static final long serialVersionUID = 1L;
16
    private transient AutoCompleter<E> completer;
17

18
    public AutoCompleteComboBox() {
NEW
19
        super();
×
NEW
20
        setUI(new ScrollBasicComboBoxUI());
×
NEW
21
        addCompleter();
×
NEW
22
    }
×
23

24
    public AutoCompleteComboBox(ComboBoxModel<E> cm) {
NEW
25
        super(cm);
×
NEW
26
        addCompleter();
×
NEW
27
    }
×
28

29
    public AutoCompleteComboBox(E[] items) {
NEW
30
        super(items);
×
NEW
31
        addCompleter();
×
NEW
32
    }
×
33

34
    public AutoCompleteComboBox(Vector<E> v) {
NEW
35
        super(v);
×
NEW
36
        addCompleter();
×
NEW
37
    }
×
38

39
    private void addCompleter() {
NEW
40
        setEditable(true);
×
NEW
41
        completer = new AutoCompleter<>(this);
×
NEW
42
    }
×
43

44
    public void autoComplete(String str) {
NEW
45
        this.completer.autoComplete(str);
×
NEW
46
    }
×
47

48
    public String getText() {
NEW
49
        return ((JTextField) getEditor().getEditorComponent()).getText();
×
50
    }
51

52
    public void setText(String text) {
NEW
53
        ((JTextField) getEditor().getEditorComponent()).setText(text);
×
NEW
54
    }
×
55

56
    public boolean containsItem(String itemString) {
NEW
57
        for (int i = 0; i < this.getModel().getSize(); i++) {
×
NEW
58
            String item = " " + this.getModel().getElementAt(i);
×
NEW
59
            if (item.equals(itemString)) {
×
NEW
60
                return true;
×
61
            }
62
        }
NEW
63
        return false;
×
64
    }
65
}
66

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc