KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > addressbook > gui > autocomplete > DefaultAddressComboBox


1 //The contents of this file are subject to the Mozilla Public License Version 1.1
2
//(the "License"); you may not use this file except in compliance with the
3
//License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
4
//
5
//Software distributed under the License is distributed on an "AS IS" basis,
6
//WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
7
//for the specific language governing rights and
8
//limitations under the License.
9
//
10
//The Original Code is "The Columba Project"
11
//
12
//The Initial Developers of the Original Code are Frederik Dietz and Timo Stich.
13
//Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
14
//
15
//All Rights Reserved.
16
package org.columba.addressbook.gui.autocomplete;
17
18 /**
19  * JCombox includes autocomplete feature.
20  * <p>
21  * This class automatically initializes the data for the autocomplete feature.
22  *
23  * @author fdietz
24  */

25
26 public class DefaultAddressComboBox extends BasicAddressAutocompleteComboBox {
27
28     /**
29      * Default constructor
30      *
31      * @param includeGroup
32      * include group items, if true. Don't, otherwise.
33      */

34     public DefaultAddressComboBox(boolean includeGroup) {
35         super();
36
37         initData(includeGroup);
38
39         // initialize completer
40
addCompleter();
41     }
42
43     /**
44      * Constructor
45      *
46      * @param folderUid
47      * uid of folder
48      * @param includeGroup
49      * include group items, if true. Don't, otherwise.
50      */

51     public DefaultAddressComboBox(String JavaDoc folderUid, boolean includeGroup) {
52         super();
53
54         AddressCollector.getInstance().clear();
55
56         AddressCollector.getInstance().addAllContacts(folderUid, includeGroup);
57
58         // initialize completer
59
addCompleter();
60     }
61
62     /**
63      * Add data from the Personal Addressbook and Collected Addresses
64      *
65      */

66     private void initData(boolean includeGroup) {
67         AddressCollector.getInstance().clear();
68
69         AddressCollector.getInstance().addAllContacts("101", includeGroup);
70         AddressCollector.getInstance().addAllContacts("102", includeGroup);
71
72     }
73 }
Popular Tags