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.mail.gui.config.account;
17:
18: import javax.swing.JCheckBox;
19: import javax.swing.JPanel;
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 {
33: private ImapItem item;
34:
35: private JCheckBox automaticallyApplyFilterCheckBox;
36:
37: private JCheckBox 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();
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: }
|