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

jiangxincode / ApkToolBoxGUI / #627

02 Mar 2024 01:29PM UTC coverage: 3.218% (-0.01%) from 3.232%
#627

push

jiangxincode
fix codefactor issues

0 of 175 new or added lines in 7 files covered. (0.0%)

3 existing lines in 2 files now uncovered.

240 of 7459 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.util.Vector;
5

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

13
    private static final long serialVersionUID = 1L;
14
    private AutoCompleter<E> completer;
15

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

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

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

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

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

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

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

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

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

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