01: //The contents of this file are subject to the Mozilla Public License Version 1.1
02: //(the "License"); you may not use this file except in compliance with the
03: //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
04: //
05: //Software distributed under the License is distributed on an "AS IS" basis,
06: //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
07: //for the specific language governing rights and
08: //limitations under the License.
09: //
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:
17: package org.columba.mail.folder.event;
18:
19: import java.util.EventObject;
20:
21: import org.columba.mail.folder.IMailFolder;
22: import org.columba.ristretto.message.Flags;
23:
24: /**
25: * Passed to listeners to notify them of changes.
26: */
27:
28: public class FolderEvent extends EventObject implements IFolderEvent {
29: protected Object changes;
30:
31: protected int parameter;
32: protected Flags oldFlags;
33:
34: /**
35: * @param source
36: * @param changes
37: * @param parameter
38: */
39: public FolderEvent(Object source, Object changes, Flags oldFlags,
40: int parameter) {
41: super (source);
42: this .changes = changes;
43: this .parameter = parameter;
44: this .oldFlags = oldFlags;
45: }
46:
47: /**
48: * Creates a new event for the given folder.
49: */
50: public FolderEvent(IMailFolder source, Object changes) {
51: super (source);
52: this .changes = changes;
53: }
54:
55: /**
56: * @param folder
57: */
58: public FolderEvent(IMailFolder folder) {
59: super (folder);
60: }
61:
62: /**
63: * Encapsulates the changes that have occured.
64: */
65: public Object getChanges() {
66: return changes;
67: }
68:
69: /**
70: * @return Returns the parameter.
71: */
72: public int getParameter() {
73: return parameter;
74: }
75:
76: /**
77: * @return Returns the oldFlags.
78: */
79: public Flags getOldFlags() {
80: return oldFlags;
81: }
82: }
|