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.addressbook.config; 17 18 import org.columba.core.config.DefaultItem; 19 import org.columba.core.xml.XmlElement; 20 21 22 /** 23 * Convinience wrapper for a contact folder configuration. 24 * 25 * @author fdietz 26 */ 27 public class FolderItem extends DefaultItem { 28 /* 29 AdapterNode name; 30 AdapterNode uid; 31 AdapterNode type; 32 AdapterNode rootNode; 33 */ 34 public FolderItem(XmlElement root) { 35 super(root); 36 37 /* 38 this.rootNode = root; 39 40 parse(); 41 42 createMissingElements(); 43 */ 44 45 //filterList = new Vector(); 46 } 47 48 /* 49 protected void parse() 50 { 51 for (int i = 0; i < getRootNode().getChildCount(); i++) 52 { 53 AdapterNode child = getRootNode().getChildAt(i); 54 55 if (child.getName().equals("name")) 56 { 57 name = child; 58 } 59 else if (child.getName().equals("uid")) 60 { 61 uid = child; 62 } 63 else if (child.getName().equals("type")) 64 { 65 type = child; 66 } 67 68 } 69 } 70 71 protected void createMissingElements() 72 { 73 74 } 75 76 public AdapterNode getRootNode() 77 { 78 return rootNode; 79 } 80 81 public void setUid(int i) 82 { 83 Integer h = new Integer(i); 84 85 setTextValue(uid, h.toString()); 86 } 87 88 public void setName(String str) 89 { 90 setTextValue(name, str); 91 } 92 93 public int getUid() 94 { 95 if ( uid != null ) 96 { 97 Integer i = new Integer(getTextValue(uid)); 98 99 return i.intValue(); 100 } 101 else 102 { 103 return -1; 104 } 105 } 106 107 public String getName() 108 { 109 if ( name != null ) 110 return getTextValue(name); 111 else 112 return ""; 113 } 114 115 public String getType() 116 { 117 return getTextValue(type); 118 } 119 */ 120 } 121