001: //The contents of this file are subject to the Mozilla Public License Version 1.1
002: //(the "License"); you may not use this file except in compliance with the
003: //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
004: //
005: //Software distributed under the License is distributed on an "AS IS" basis,
006: //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
007: //for the specific language governing rights and
008: //limitations under the License.
009: //
010: //The Original Code is "The Columba Project"
011: //
012: //The Initial Developers of the Original Code are Frederik Dietz and Timo Stich.
013: //Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
014: //
015: //All Rights Reserved.
016: package org.columba.addressbook.config;
017:
018: import org.columba.core.config.DefaultItem;
019: import org.columba.core.xml.XmlElement;
020:
021: /**
022: * Convinience wrapper for a contact folder configuration.
023: *
024: * @author fdietz
025: */
026: public class FolderItem extends DefaultItem {
027: /*
028: AdapterNode name;
029: AdapterNode uid;
030: AdapterNode type;
031: AdapterNode rootNode;
032: */
033: public FolderItem(XmlElement root) {
034: super (root);
035:
036: /*
037: this.rootNode = root;
038:
039: parse();
040:
041: createMissingElements();
042: */
043:
044: //filterList = new Vector();
045: }
046:
047: /*
048: protected void parse()
049: {
050: for (int i = 0; i < getRootNode().getChildCount(); i++)
051: {
052: AdapterNode child = getRootNode().getChildAt(i);
053:
054: if (child.getName().equals("name"))
055: {
056: name = child;
057: }
058: else if (child.getName().equals("uid"))
059: {
060: uid = child;
061: }
062: else if (child.getName().equals("type"))
063: {
064: type = child;
065: }
066:
067: }
068: }
069:
070: protected void createMissingElements()
071: {
072:
073: }
074:
075: public AdapterNode getRootNode()
076: {
077: return rootNode;
078: }
079:
080: public void setUid(int i)
081: {
082: Integer h = new Integer(i);
083:
084: setTextValue(uid, h.toString());
085: }
086:
087: public void setName(String str)
088: {
089: setTextValue(name, str);
090: }
091:
092: public int getUid()
093: {
094: if ( uid != null )
095: {
096: Integer i = new Integer(getTextValue(uid));
097:
098: return i.intValue();
099: }
100: else
101: {
102: return -1;
103: }
104: }
105:
106: public String getName()
107: {
108: if ( name != null )
109: return getTextValue(name);
110: else
111: return "";
112: }
113:
114: public String getType()
115: {
116: return getTextValue(type);
117: }
118: */
119: }
|