KickJava   Java API By Example, From Geeks To Geeks.

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


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
20 package org.openide.filesystems;
21
22 import java.util.EventListener JavaDoc;
23
24 /** Listener for changes in <code>FileObject</code>s. Can be attached to any <code>FileObject</code>.
25 * <P>
26 * When attached to a file it listens for file changes (due to saving from inside NetBeans) and
27 * for deletes and renames.
28 * <P>
29 * When attached to a folder it listens for all actions taken on this folder.
30 * These include any modifications of data files or folders,
31 * and creation of new data files or folders.
32 *
33 * @see FileObject#addFileChangeListener
34 *
35 * @author Jaroslav Tulach, Petr Hamernik
36 */

37 public interface FileChangeListener extends EventListener JavaDoc {
38     /** Fired when a new folder is created. This action can only be
39      * listened to in folders containing the created folder up to the root of
40      * filesystem.
41       *
42      * @param fe the event describing context where action has taken place
43      */

44     public abstract void fileFolderCreated(FileEvent fe);
45
46     /** Fired when a new file is created. This action can only be
47     * listened in folders containing the created file up to the root of
48     * filesystem.
49     *
50     * @param fe the event describing context where action has taken place
51     */

52     public abstract void fileDataCreated(FileEvent fe);
53
54     /** Fired when a file is changed.
55     * @param fe the event describing context where action has taken place
56     */

57     public abstract void fileChanged(FileEvent fe);
58
59     /** Fired when a file is deleted.
60     * @param fe the event describing context where action has taken place
61     */

62     public abstract void fileDeleted(FileEvent fe);
63
64     /** Fired when a file is renamed.
65     * @param fe the event describing context where action has taken place
66     * and the original name and extension.
67     */

68     public abstract void fileRenamed(FileRenameEvent fe);
69
70     /** Fired when a file attribute is changed.
71     * @param fe the event describing context where action has taken place,
72     * the name of attribute and the old and new values.
73     */

74     public abstract void fileAttributeChanged(FileAttributeEvent fe);
75 }
76
Popular Tags