KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > gjt > sp > jedit > buffer > BufferChangeAdapter


1 /*
2  * BufferChangeListener.java - Buffer listener adapter
3  * :tabSize=8:indentSize=8:noTabs=false:
4  * :folding=explicit:collapseFolds=1:
5  *
6  * Copyright (C) 2001, 2003 Slava Pestov
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21  */

22
23 package org.gjt.sp.jedit.buffer;
24
25 import org.gjt.sp.jedit.Buffer;
26
27 /**
28  * An adapter you can subclass to avoid having to implement all the methods
29  * of the {@link BufferChangeListener} interface.
30  * @author Slava Pestov
31  * @version $Id: BufferChangeAdapter.java 5147 2004-11-08 04:01:22Z spestov $
32  * @since jEdit 4.0pre1
33  */

34 public abstract class BufferChangeAdapter implements BufferChangeListener
35 {
36     //{{{ foldLevelChanged() method
37
/**
38      * Called when line fold levels change.
39      * @param buffer The buffer in question
40      * @param start The start line number
41      * @param end The end line number
42      * @since jEdit 4.0pre1
43      */

44     public void foldLevelChanged(Buffer buffer, int start, int end)
45     {
46     } //}}}
47

48     //{{{ contentInserted() method
49
/**
50      * Called when text is inserted into the buffer.
51      * @param buffer The buffer in question
52      * @param startLine The first line
53      * @param offset The start offset, from the beginning of the buffer
54      * @param numLines The number of lines inserted
55      * @param length The number of characters inserted
56      * @since jEdit 4.0pre1
57      */

58     public void contentInserted(Buffer buffer, int startLine, int offset,
59         int numLines, int length) {}
60     //}}}
61

62     //{{{ preContentRemoved() method
63
/**
64      * Called when text is about to be removed from the buffer, but is
65      * still present.
66      * @param buffer The buffer in question
67      * @param startLine The first line
68      * @param offset The start offset, from the beginning of the buffer
69      * @param numLines The number of lines to be removed
70      * @param length The number of characters to be removed
71      * @since jEdit 4.2pre1
72      */

73     public void preContentRemoved(Buffer buffer, int startLine, int offset,
74         int numLines, int length) {}
75     //}}}
76

77     //{{{ contentRemoved() method
78
/**
79      * Called when text is removed from the buffer.
80      * @param buffer The buffer in question
81      * @param startLine The first line
82      * @param offset The start offset, from the beginning of the buffer
83      * @param numLines The number of lines removed
84      * @param length The number of characters removed
85      * @since jEdit 4.0pre1
86      */

87     public void contentRemoved(Buffer buffer, int startLine, int offset,
88         int numLines, int length) {}
89     //}}}
90

91     //{{{ transactionComplete() method
92
/**
93      * Called after an undo or compound edit has finished. The text area
94      * uses this event to queue up and collapse cleanup operations so they
95      * are only run once during a long transaction (such as a "Replace All"
96      * operation.)
97      *
98      * @param buffer The buffer in question
99      * @since jEdit 4.0pre6
100      */

101     public void transactionComplete(Buffer buffer) {}
102     //}}}
103

104     //{{{ foldHandlerChanged() method
105
/**
106      * Called to notify the text area that folds need to be collapsed if
107      * the "collapseFolds" property is set. This method is called after the
108      * buffer has been loaded, and also if the user changes the fold
109      * handler.
110      *
111      * @param buffer The buffer in question
112      * @since jEdit 4.2pre2
113      */

114     public void foldHandlerChanged(Buffer buffer) {}
115     //}}}
116

117     //{{{ foldHandlerChanged() method
118
/**
119      * Called to notify the text area that the buffer has been reloaded.
120      *
121      * @param buffer The buffer in question
122      * @since jEdit 4.3pre1
123      */

124     public void bufferLoaded(Buffer buffer) {}
125     //}}}
126
}
127
Popular Tags