KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > mail > gui > config > account > ImapAttributPanel


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.mail.gui.config.account;
17
18 import javax.swing.JCheckBox JavaDoc;
19 import javax.swing.JPanel JavaDoc;
20
21 import org.columba.core.gui.base.CheckBoxWithMnemonic;
22 import org.columba.mail.config.ImapItem;
23 import org.columba.mail.util.MailResourceLoader;
24
25 import com.jgoodies.forms.builder.DefaultFormBuilder;
26
27 /**
28  *
29  * @author freddy
30  * @version
31  */

32 public class ImapAttributPanel extends JPanel JavaDoc {
33     private ImapItem item;
34
35     private JCheckBox JavaDoc automaticallyApplyFilterCheckBox;
36
37     private JCheckBox JavaDoc cleanupCheckBox;
38
39     public ImapAttributPanel(ImapItem item) {
40         this.item = item;
41         initComponents();
42     }
43
44     public void updateComponents(boolean b) {
45         if (b) {
46
47             automaticallyApplyFilterCheckBox.setSelected(item
48                     .getBoolean(ImapItem.AUTOMATICALLY_APPLY_FILTER));
49         } else {
50
51             item.setBoolean(ImapItem.AUTOMATICALLY_APPLY_FILTER,
52                     automaticallyApplyFilterCheckBox.isSelected());
53         }
54     }
55
56     public void createPanel(DefaultFormBuilder builder) {
57         builder.appendSeparator(MailResourceLoader.getString("dialog",
58                 "account", "options"));
59
60         builder.append(automaticallyApplyFilterCheckBox, 4);
61         builder.nextLine();
62
63     }
64
65     protected void initComponents() {
66         cleanupCheckBox = new JCheckBox JavaDoc();
67         cleanupCheckBox.setEnabled(false);
68         cleanupCheckBox.setText(MailResourceLoader.getString("dialog",
69                 "account", "Expunge_Inbox_on_Exit"));
70
71         automaticallyApplyFilterCheckBox = new CheckBoxWithMnemonic(
72                 MailResourceLoader.getString("dialog", "account",
73                         "apply_filter"));
74     }
75
76 }
Popular Tags