KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > mail > command > MailFolderCommandReference


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.command;
17
18 import java.io.File JavaDoc;
19 import java.lang.reflect.Array JavaDoc;
20
21 import org.columba.core.folder.DefaultFolderCommandReference;
22 import org.columba.core.folder.api.IFolder;
23 import org.columba.mail.folder.IMailFolder;
24 import org.columba.mail.message.IColumbaMessage;
25
26 /**
27  * This is a reference implemention suitable for folders containing messages.
28  * <p>
29  * Its main purpose is to store source and/or destination folders and arrays of
30  * message UIDs.
31  * <p>
32  *
33  *
34  * @author fdietz
35  */

36 public class MailFolderCommandReference extends DefaultFolderCommandReference
37         implements IMailFolderCommandReference {
38     private Integer JavaDoc[] address;
39
40     private IColumbaMessage message;
41
42     private int markVariant;
43
44     private String JavaDoc folderName;
45
46     private String JavaDoc folderType;
47
48     private int colorValue;
49
50     private File JavaDoc destFile;
51     
52     /**
53      * Constructor for MailFolderCommandReference.
54      *
55      * @param folder
56      */

57     public MailFolderCommandReference(IFolder folder) {
58         super(folder);
59     }
60
61     public MailFolderCommandReference(IFolder folder, IFolder destinationFolder) {
62         super(folder, destinationFolder);
63     }
64
65     public MailFolderCommandReference(IFolder folder, IColumbaMessage message) {
66         super(folder);
67
68         this.message = message;
69     }
70
71     /**
72      * Constructor for MailFolderCommandReference.
73      *
74      * @param folder
75      * @param uids
76      */

77     public MailFolderCommandReference(IFolder folder, Object JavaDoc[] uids) {
78         super(folder, uids);
79
80     }
81
82     /**
83      * Constructor for MailFolderCommandReference.
84      *
85      * @param sourceFolder
86      * @param destinationFolder
87      * @param uids
88      */

89     public MailFolderCommandReference(IFolder sourceFolder,
90             IMailFolder destinationFolder, Object JavaDoc[] uids) {
91         super(sourceFolder, destinationFolder, uids);
92     }
93
94     /**
95      * Constructor for MailFolderCommandReference.
96      *
97      * @param folder
98      * @param uids
99      * @param address
100      */

101     public MailFolderCommandReference(IFolder folder, Object JavaDoc[] uids,
102             Integer JavaDoc[] address) {
103         super(folder, uids);
104
105         this.address = address;
106     }
107
108     public Integer JavaDoc[] getAddress() {
109         return address;
110     }
111
112     public void setAddress(Integer JavaDoc[] address) {
113         this.address = address;
114     }
115
116     public IColumbaMessage getMessage() {
117         return message;
118     }
119
120     public void setMessage(IColumbaMessage message) {
121         this.message = message;
122     }
123
124     public void reduceToFirstUid() {
125         Object JavaDoc[] uids = getUids();
126
127         if (uids == null) {
128             return;
129         }
130
131         int size = Array.getLength(uids);
132
133         if (size > 1) {
134             Object JavaDoc[] oneUid = new Object JavaDoc[1];
135             oneUid[0] = uids[0];
136             uids = oneUid;
137         }
138     }
139
140     /**
141      * Returns the markVariant.
142      *
143      * @return int
144      */

145     public int getMarkVariant() {
146         return markVariant;
147     }
148
149     /**
150      * Sets the markVariant.
151      *
152      * @param markVariant
153      * The markVariant to set
154      */

155     public void setMarkVariant(int markVariant) {
156         this.markVariant = markVariant;
157     }
158
159     /**
160      * Returns the folderName.
161      *
162      * @return String
163      */

164     public String JavaDoc getFolderName() {
165         return folderName;
166     }
167
168     /**
169      * Sets the folderName.
170      *
171      * @param folderName
172      * The folderName to set
173      */

174     public void setFolderName(String JavaDoc folderName) {
175         this.folderName = folderName;
176     }
177
178     /**
179      * @return destFile
180      */

181     public File JavaDoc getDestFile() {
182         return destFile;
183     }
184
185     /**
186      * @param destFile
187      */

188     public void setDestFile(File JavaDoc destFile) {
189         this.destFile = destFile;
190     }
191
192     /**
193      * @return Returns the colorValue.
194      */

195     public int getColorValue() {
196         return colorValue;
197     }
198
199     /**
200      * @param colorValue
201      * The colorValue to set.
202      */

203     public void setColorValue(int colorValue) {
204         this.colorValue = colorValue;
205     }
206
207     /**
208      * @return Returns the folderType.
209      */

210     public String JavaDoc getFolderType() {
211         return folderType;
212     }
213
214     /**
215      * @param folderType
216      * The folderType to set.
217      */

218     public void setFolderType(String JavaDoc folderType) {
219         this.folderType = folderType;
220     }
221
222 }
Popular Tags