01: //The contents of this file are subject to the Mozilla Public License Version 1.1
02: //(the "License"); you may not use this file except in compliance with the
03: //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
04: //
05: //Software distributed under the License is distributed on an "AS IS" basis,
06: //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
07: //for the specific language governing rights and
08: //limitations under the License.
09: //
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
27: BasicAddressAutocompleteComboBox {
28:
29: /**
30: * Default constructor
31: *
32: * @param includeGroup
33: * include group items, if true. Don't, otherwise.
34: */
35: public DefaultAddressComboBox(boolean includeGroup) {
36: super ();
37:
38: initData(includeGroup);
39:
40: // initialize completer
41: addCompleter();
42: }
43:
44: /**
45: * Constructor
46: *
47: * @param folderUid
48: * uid of folder
49: * @param includeGroup
50: * include group items, if true. Don't, otherwise.
51: */
52: public DefaultAddressComboBox(String folderUid, boolean includeGroup) {
53: super ();
54:
55: AddressCollector.getInstance().clear();
56:
57: AddressCollector.getInstance().addAllContacts(folderUid,
58: includeGroup);
59:
60: // initialize completer
61: addCompleter();
62: }
63:
64: /**
65: * Add data from the Personal Addressbook and Collected Addresses
66: *
67: */
68: private void initData(boolean includeGroup) {
69: AddressCollector.getInstance().clear();
70:
71: AddressCollector.getInstance().addAllContacts("101",
72: includeGroup);
73: AddressCollector.getInstance().addAllContacts("102",
74: includeGroup);
75:
76: }
77: }
|