1 | void addAll(List<IContactModelPartial> list) {↵ | | 1 | void addAll(List<IEventInfo> list) {↵
|
2 | Iterator<IContactModelPartial> it = list.iterator();↵ | | 2 | Iterator<IEventInfo> it = list.iterator();↵
|
3 | while (it.hasNext()) {↵ | | 3 | while (it.hasNext()) {↵
|
4 | addElement(it.next());↵ | | 4 | addElement(it.next());↵
|
5 | }↵ | | 5 | }↵
|
6 | }↵ | | 6 | }↵
|
|
7 | public void add(IContactModelPartial result) {↵ | | 7 | public void add(IEventInfo result) {↵
|
8 | addElement(result);↵ | | 8 | addElement(result);↵
|
9 | }↵ | | 9 | }↵
|
|
10 | /**↵ | | 10 | /**↵
|
11 | * ********************** filtering↵ | | 11 | * ********************** filtering↵
|
12 | * *********************************************↵ | | 12 | * *********************************************↵
|
13 | */↵ | | 13 | */↵
|
|
14 | /**↵ | | 14 | /**↵
|
15 | * Associates filtering document listener to text component.↵ | | 15 | * Associates filtering document listener to text component.↵
|
16 | */↵ | | 16 | */↵
|
|
17 | public void installJTextField(JTextField input) {↵ | | 17 | public void installJTextField(JTextField input) {↵
|
18 | if (input != null) {↵ | | 18 | if (input != null) {↵
|
19 | FilteringModel model = (FilteringModel) getModel();↵ | | 19 | FilteringModel model = (FilteringModel) getModel();↵
|
20 | input.getDocument().addDocumentListener(model);↵ | | 20 | input.getDocument().addDocumentListener(model);↵
|
21 | }↵ | | 21 | }↵
|
22 | }↵ | | 22 | }↵
|
|
23 | /**↵ | | 23 | /**↵
|
24 | * Disassociates filtering document listener from text component.↵ | | 24 | * Disassociates filtering document listener from text component.↵
|
25 | */↵ | | 25 | */↵
|
|
26 | public void uninstallJTextField(JTextField input) {↵ | | 26 | public void uninstallJTextField(JTextField input) {↵
|
27 | if (input != null) {↵ | | 27 | if (input != null) {↵
|
28 | FilteringModel model = (FilteringModel) getModel();↵ | | 28 | FilteringModel model = (FilteringModel) getModel();↵
|
29 | input.getDocument().removeDocumentListener(model);↵ | | 29 | input.getDocument().removeDocumentListener(model);↵
|
30 | }↵ | | 30 | }↵
|
31 | }↵ | | 31 | }↵
|
|
32 | /**↵ | | 32 | /**↵
|
33 | * Doesn't let model change to non-filtering variety↵ | | 33 | * Doesn't let model change to non-filtering variety↵
|
34 | */↵ | | 34 | */↵
|
|
35 | public void setModel(ListModel model) {↵ | | 35 | public void setModel(ListModel model) {↵
|
36 | if (!(model instanceof FilteringModel)) {↵ | | 36 | if (!(model instanceof FilteringModel)) {↵
|
37 | throw new IllegalArgumentException();↵ | | 37 | throw new IllegalArgumentException();↵
|
38 | } else {↵ | | 38 | } else {↵
|
39 | super.setModel(model);↵ | | 39 | super.setModel(model);↵
|
40 | }↵ | | 40 | }↵
|
41 | }↵ | | 41 | }↵
|
|
42 | /**↵ | | 42 | /**↵
|
43 | * Adds item to model of list↵ | | 43 | * Adds item to model of list↵
|
44 | */↵ | | 44 | */↵
|
45 | public void addElement(IContactModelPartial element) {↵ | | 45 | public void addElement(IEventInfo element) {↵
|
46 | ((FilteringModel) getModel()).addElement(element);↵ | | 46 | ((FilteringModel) getModel()).addElement(element);↵
|
47 | | | 47 |
|