KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openide > filesystems > RepositoryEvent


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.openide.filesystems;
20
21
22 /** Event describing adding a filesystem to, or removing a filesystem from, the filesystem pool.
23 *
24 * @author Jaroslav Tulach
25 * @version 0.10 November 4, 1997
26 */

27 public class RepositoryEvent extends java.util.EventObject JavaDoc {
28     /** generated Serialized Version UID */
29     static final long serialVersionUID = 5466690014963965717L;
30
31     /** the modifying filesystem */
32     private FileSystem fileSystem;
33
34     /** added or removed */
35     private boolean add;
36
37     /** Create a new filesystem pool event.
38     * @param fsp filesystem pool that is being modified
39     * @param fs filesystem that is either being added or removed
40     * @param add <CODE>true</CODE> if the filesystem is added,
41     * <CODE>false</CODE> if removed
42     */

43     public RepositoryEvent(Repository fsp, FileSystem fs, boolean add) {
44         super(fsp);
45         this.fileSystem = fs;
46         this.add = add;
47     }
48
49     /** Getter for the filesystem pool that is modified.
50     * @return the filesystem pool
51     */

52     public Repository getRepository() {
53         return (Repository) getSource();
54     }
55
56     /** Getter for the filesystem that is added or removed.
57     * @return the filesystem
58     */

59     public FileSystem getFileSystem() {
60         return fileSystem;
61     }
62
63     /** Is the filesystem added or removed?
64     * @return <CODE>true</CODE> if the filesystem is added, <code>false</code> if removed
65     */

66     public boolean isAdded() {
67         return add;
68     }
69 }
70
Popular Tags