KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > filebuffers > IFileBufferListener


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.filebuffers;
12
13 import org.eclipse.core.runtime.IPath;
14
15 /**
16  * Interface for listeners to file buffer changes.
17  *
18  * @since 3.0
19  */

20 public interface IFileBufferListener {
21
22     /**
23      * Informs the listener about the creation of the given buffer.
24      *
25      * @param buffer the created file buffer
26      */

27     void bufferCreated(IFileBuffer buffer);
28
29     /**
30      * Informs the listener that the given buffer has been disposed.
31      * All state information has already been disposed and accessing
32      * it is forbidden. However, accessing the file buffer's content is
33      * still allowed during the notification.
34      *
35      * @param buffer the disposed file buffer
36      */

37     void bufferDisposed(IFileBuffer buffer);
38
39     /**
40      * Informs the listener about an upcoming replace of the contents of the given buffer.
41      *
42      * @param buffer the effected file buffer
43      */

44     void bufferContentAboutToBeReplaced(IFileBuffer buffer);
45
46     /**
47      * Informs the listener that the buffer of the given buffer has been replaced.
48      *
49      * @param buffer the effected file buffer
50      */

51     void bufferContentReplaced(IFileBuffer buffer);
52
53     /**
54      * Informs the listener about the start of a state changing operation on
55      * the given buffer.
56      *
57      * @param buffer the effected file buffer
58      */

59     void stateChanging(IFileBuffer buffer);
60
61     /**
62      * Informs the listener that the dirty state of the given buffer changed
63      * to the specified value
64      *
65      * @param buffer the effected file buffer
66      * @param isDirty <code>true</code> if the buffer is dirty, <code>false</code> otherwise
67      */

68     void dirtyStateChanged(IFileBuffer buffer, boolean isDirty);
69
70     /**
71      * Informs the listener that the state validation changed to the specified value.
72      *
73      * @param buffer the effected file buffer
74      * @param isStateValidated <code>true</code> if the buffer state is validated, <code>false</code> otherwise
75      */

76     void stateValidationChanged(IFileBuffer buffer, boolean isStateValidated);
77
78     /**
79      * Informs the listener that the file underlying the given file buffer has been moved to the
80      * given location.
81      * <p>
82      * This event is currently only sent if the file buffer is
83      * backed by an <code>IFile</code>.
84      * </p>
85      *
86      * @param buffer the effected file buffer
87      * @param path the new location (not just the container)
88      */

89     void underlyingFileMoved(IFileBuffer buffer, IPath path);
90
91     /**
92      * Informs the listener that the file underlying the given file buffer has been deleted.
93      *
94      * @param buffer the effected file buffer
95      */

96     void underlyingFileDeleted(IFileBuffer buffer);
97
98     /**
99      * Informs the listener that a state changing operation on the given
100      * file buffer failed.
101      *
102      * @param buffer the effected file buffer
103      */

104     void stateChangeFailed(IFileBuffer buffer);
105 }
106
Popular Tags