KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > mail > config > SpamItem


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

31 public class SpamItem extends DefaultItem {
32
33     
34     public SpamItem(XmlElement e) {
35         super(e);
36     }
37     
38     /**
39      * Check if spam filtering is enabled.
40      *
41      * @return true, if enabled. False, otherwise.
42      */

43     public boolean isEnabled() {
44         return getBooleanWithDefault("enabled", false);
45     }
46     
47     /**
48      * Enable/Disable spam filter.
49      *
50      * @param enabled true or false
51      */

52     public void setEnabled(boolean enabled) {
53         setBoolean("enabled", enabled);
54         
55     }
56     
57     public boolean isMoveIncomingJunkMessagesEnabled() {
58         return getBooleanWithDefault("move_incoming_junk_messages", false);
59     }
60     
61     public void enableMoveIncomingJunkMessage(boolean enabled) {
62         setBoolean("move_incoming_junk_messages", enabled);
63     }
64     
65     public boolean isIncomingTrashSelected() {
66         return getBooleanWithDefault("incoming_trash", true);
67     }
68     
69     public void selectedIncomingTrash(boolean select) {
70         setBoolean("incoming_trash", select);
71     }
72     
73     public String JavaDoc getIncomingCustomFolder() {
74         return getStringWithDefault("incoming_folder", "101");
75     }
76     
77     public void setIncomingCustomFolder(String JavaDoc folderId) {
78         setString("incoming_folder", folderId);
79     }
80     
81     public boolean isMoveMessageWhenMarkingEnabled() {
82         return getBooleanWithDefault("move_message_when_marking", false);
83     }
84     
85     public void enableMoveMessageWhenMarking(boolean enabled) {
86         setBoolean("move_message_when_marking", enabled);
87     }
88     
89     public boolean isMoveTrashSelected() {
90         return getBooleanWithDefault("move_trash", true);
91     }
92     
93     public void selectMoveTrash(boolean select) {
94         setBoolean("move_trash", select);
95     }
96     
97     public String JavaDoc getMoveCustomFolder() {
98         return getStringWithDefault("move_folder", "101");
99     }
100     
101     public void setMoveCustomFolder(String JavaDoc folderId) {
102         setString("move_folder", folderId);
103     }
104     
105     public boolean checkAddressbook() {
106         return getBooleanWithDefault("check_addressbook", false);
107     }
108     
109     public void enableCheckAddressbook(boolean enable) {
110         setBoolean("check_addressbook", enable);
111     }
112 }
113
Popular Tags