KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > mail > gui > config > folder > OptionsItem


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.folder;
17
18 import javax.swing.Icon JavaDoc;
19
20 import org.columa.core.config.IDefaultItem;
21 import org.columba.core.config.DefaultItem;
22 import org.columba.core.xml.XmlElement;
23 import org.frapuccino.checkablelist.CheckableItem;
24
25 /**
26  * @author fdietz
27  */

28 public class OptionsItem implements CheckableItem {
29
30     private XmlElement element;
31
32     public OptionsItem(XmlElement element) {
33         this.element = element;
34     }
35
36     public void setSelected(boolean b) {
37         element.addAttribute("overwrite", Boolean.toString(b));
38     }
39
40     /**
41      * @see org.columba.core.gui.checkablelist.CheckableItem#isSelected()
42      */

43     public boolean isSelected() {
44         IDefaultItem item = new DefaultItem(element);
45
46         return item.getBooleanWithDefault("overwrite", false);
47     }
48
49     /**
50      * @see org.columba.core.gui.checkablelist.CheckableItem#getIcon()
51      */

52     public Icon JavaDoc getIcon() {
53         return null;
54     }
55
56     public String JavaDoc toString() {
57         return element.getName();
58     }
59
60     /**
61      * @return
62      */

63     public XmlElement getElement() {
64         return element;
65     }
66 }
67
Popular Tags