KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > mail > folder > IMailFolder


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.folder;
19
20 import java.util.Enumeration JavaDoc;
21
22 import javax.swing.tree.MutableTreeNode JavaDoc;
23 import javax.swing.tree.TreeNode JavaDoc;
24 import javax.swing.tree.TreePath JavaDoc;
25
26 import org.columba.api.plugin.IExtensionInterface;
27 import org.columba.core.folder.api.IFolder;
28 import org.columba.mail.config.IFolderItem;
29 import org.columba.mail.folder.event.IFolderListener;
30
31 /**
32  * @author fdietz
33  *
34  */

35 public interface IMailFolder extends MutableTreeNode JavaDoc, IFolder, IExtensionInterface {
36     /**
37      * Adds a listener.
38      */

39     void addFolderListener(IFolderListener l);
40
41     /**
42      * Removes a previously registered listener.
43      */

44     void removeFolderListener(IFolderListener l);
45
46     /**
47      * Method getSelectionTreePath.
48      *
49      * @return TreePath
50      */

51     TreePath JavaDoc getSelectionTreePath();
52
53     /**
54      * Returns the folder's configuration.
55      */

56     IFolderItem getConfiguration();
57
58     /**
59      * Sets the folder's configuration.
60      */

61     void setConfiguration(IFolderItem node);
62
63     /**
64      * Sets the folder's name. This method notifies registered FolderListeners.
65      */

66     void setName(String JavaDoc newName) throws Exception JavaDoc;
67
68     /**
69      * ************************** treenode management
70      * ******************************
71      */

72     void insert(IMailFolder newFolder, int newIndex);
73
74     /**
75      * Removes this folder from its parent. This method will notify registered
76      * FolderListeners.
77      */

78     void removeFolder() throws Exception JavaDoc;
79
80     /**
81      * Adds a child folder to this folder. This method will notify registered
82      * FolderListeners.
83      */

84     void addSubfolder(IMailFolder child) throws Exception JavaDoc;
85
86     /**
87      *
88      * AbstractFolder wraps XmlElement
89      *
90      * all treenode manipulation is passed to the corresponding XmlElement
91      */

92     void moveTo(IMailFolder child);
93
94     /** ******************* capabilities ************************************* */
95     boolean supportsAddMessage();
96
97     /**
98      * Returns true if this folder can have sub folders of the specified type;
99      * false otherwise.
100      *
101      * @param newFolderType
102      * the folder that is going to be inserted as a child.
103      * @return true if this folder can have sub folders; false otherwise.
104      */

105     boolean supportsAddFolder(String JavaDoc newFolderType);
106
107     /**
108      * Returns true if this folder type can be moved around in the folder tree.
109      *
110      * @return true if this folder type can be moved around in the folder tree.
111      */

112     boolean supportsMove();
113
114     /**
115      * Return the root folder of this folder.
116      * <p>
117      * This is especially useful when using IMAP. IMAP has a root folder which
118      * is labelled with the account name.
119      *
120      * @return root parent folder of this folder
121      */

122     IMailFolder getRootFolder();
123
124     void fireFolderPropertyChanged();
125
126     void fireFolderAdded(IMailFolder folder);
127
128     void fireFolderRemoved();
129
130     TreeNode JavaDoc[] getPath();
131
132     String JavaDoc getTreePath();
133     
134     Enumeration JavaDoc breadthFirstEnumeration();
135     
136     Enumeration JavaDoc depthFirstEnumeration();
137     
138     /**
139      * Add treenode as child to this parent node.
140      *
141      * @param treeNode new treenode
142      */

143     void add(IMailFolder treeNode);
144     
145     
146     public String JavaDoc getType();
147 }
Popular Tags