KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * BufferAdapter.java - Buffer listener adapter
3  * :tabSize=8:indentSize=8:noTabs=false:
4  * :folding=explicit:collapseFolds=1:
5  *
6  * Copyright (C) 2001, 2005 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 /**
26  * An adapter you can subclass to avoid having to implement all the methods
27  * of the {@link BufferListener} interface.
28  * @author Slava Pestov
29  * @version $Id: BufferAdapter.java 5339 2006-01-25 23:12:07Z spestov $
30  * @since jEdit 4.3pre3
31  */

32 public abstract class BufferAdapter implements BufferListener
33 {
34     //{{{ foldLevelChanged() method
35
/**
36      * Called when line fold levels change.
37      * @param buffer The buffer in question
38      * @param start The start line number
39      * @param end The end line number
40      * @since jEdit 4.3pre3
41      */

42     public void foldLevelChanged(JEditBuffer buffer, int start, int end)
43     {
44     } //}}}
45

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

56     public void contentInserted(JEditBuffer buffer, int startLine, int offset,
57         int numLines, int length) {}
58     //}}}
59

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

71     public void preContentRemoved(JEditBuffer buffer, int startLine, int offset,
72         int numLines, int length) {}
73     //}}}
74

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

85     public void contentRemoved(JEditBuffer buffer, int startLine, int offset,
86         int numLines, int length) {}
87     //}}}
88

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

99     public void transactionComplete(JEditBuffer buffer) {}
100     //}}}
101

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

112     public void foldHandlerChanged(JEditBuffer buffer) {}
113     //}}}
114

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

122     public void bufferLoaded(JEditBuffer buffer) {}
123     //}}}
124
}
125
Popular Tags